set.seed(1203)
response <- c(rnorm(12),rpois(12,0.5),rnorm(12,2,1))
fact1 <- gl(3,12,labels=LETTERS[1:3])
fact2 <- gl(3,1,36,labels=letters[1:3])
fact3 <- gl(6,6,labels=letters[1:6])
block <- gl(2,6,36,labels=letters[1:2])
# Not enough permutations here but faster to run
# 2 crossed fixed factors with interaction
perm.anova(response~fact1*fact2,nperm=49)
# 2 nested fixed factors
perm.anova(response~fact1/fact2,nperm=49)
# 2 nested factors, fact2 being random
perm.anova(response~fact1/fact3,nest.f2="random",nperm=49)
# 1 fixed factor and 1 blocking (random) factor
perm.anova(response~fact1|block,nperm=49)
Run the code above in your browser using DataLab