perm.fact.test {asbio} | R Documentation |
Provides permutation tests for two and three way designs, using permutations of of the response vector with respect to factor levels. One way permutation tests are provided by MC.test
, and the function oneway_test
in coin
.
perm.fact.test(Y, X1, X2, X3 = NA, perm = 100)
Y |
A vector of response data. A quantitative vector. |
X1 |
A vector of factor levels describing factor one. |
X2 |
A vector of factor levels describing factor two. |
X3 |
If necessary, a vector of factor levels describing factor three. |
perm |
Number of permutations. |
The method used here is based on Manly (1997).
A dataframe is returned describing initial F test statistics for main effects and interactions, degrees of freedom, and permutation p-values.
Ken Aho
Manly, B. F. J. (1997) Randomization and Monte Carlo methods in biology, 2nd edition. Chapman and Hall, London.
lizard<-data.frame(ants=c(13,242,105,8,59,20,515,488,88,18,44,21,182,21,7,24,312,68,460,1223,990,140,40,27),size=factor(c(rep(1,12),rep(2,12))),month=factor(rep(rep(c(1,2,3,4),each=3),2))) attach(lizard) perm.fact.test(ants,month,size,perm=100)