Re: [R] Tukey HSD test using Multcomp

From: Mark Difford <mark_difford_at_yahoo.co.uk>
Date: Fri, 25 Mar 2011 02:10:47 -0700 (PDT)

Mar 25, 2011; 12:58am Simon Bate wrote:

>> I've been happily using the TukeyHSD function to produce Tukeys HSD tests
>> but have decided to try
>> out Multcomp instead. However when I carry out the test repeatedly I have
>> found that Multcomp
>> produces slightly different values each time. (see code below).

The random number generator comes into this so you need to ?set.seed to get an identical result. Insert a set.seed statement in your code:

##
for (i in 1:20)
{

set.seed(3)                ## add this

mult<-glht(lm(Resp1~Treat1, data=statdata, na.action = na.omit), linfct=mcp(Treat1="Tukey"))
multp<-summary(mult)
tabs=format(round(multp$test$pvalues, 6), nsmall=6, scientific=FALSE) print (tabs)
i=i+1
}

Regards, Mark.

--
View this message in context: http://r.789695.n4.nabble.com/Tukey-HSD-test-using-Multcomp-tp3404038p3404906.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Fri 25 Mar 2011 - 13:00:17 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 25 Mar 2011 - 13:10:24 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive