Hi,

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-------------->---
require(boot)

"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.


Cheers,

-- 
Seb

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to