[R] randomization test for a two-way ANOVA

From: Sebastian Luque <spluque_at_gmail.com>
Date: Tue 04 Jul 2006 - 15:38:46 EST


I've looked into ways of implementing this procedure, i.e. repeating the two-way ANOVA many times, scrambling the order of cases across the treatments, to produce a distribution of F ratios for each effect. This seemed a job for the 'boot' package. However, I'm not sure I'm doing an actual randomization test, as opposed to a bootstrap here. This is how I've coded the test (using the poisons data):

---<---------------cut here---------------start-------------->---

"boot.lm" <- function(data, i)

    mod <- lm(time ~ treat * poison, data=data[i, ])     anova(mod)["F value"][[1]][-4] # the F ratios for each effect }

poisons.boot <- boot(poisons, boot.lm, R=1000, sim="permutation")
---<---------------cut here---------------end---------------->---

Is this the right way to ask for a randomization test using 'boot'? Thanks in advance.



R-help@stat.math.ethz.ch mailing list
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Tue Jul 04 16:49:10 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Tue 04 Jul 2006 - 18:15:07 EST.

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