1

I'm trying to check my understanding of how to determine the appropriate permutation restrictions for a two way anova where one of the variables is nested in the other, and making sure I understand how to enumerate the number of permutations possible with a given design.

in Anderson and ter Braak they mention that for a nested design with factor A having two levels and B within A having 3 levels, there are only 10 possible permutations for testing variable A ( MSA/ MSB(A) ) meaning the smallest p-value for testing the effect of A is 0.1

I can't figure out how to get that. When I try setting something up using the permute package, I get 5 permutations. Is it a conceptual thing I'm missing, a coding issue? What am I not getting?


# library(permute)
tmp<-data.frame(A=rep(c('A.1','A.2'),each=9),
                B=rep(c(1:3),each=3),
                obs.rep=rep(c(1:3),3))


ctrl.nestB<-permute::how(plots=permute::Plots(strata=tmp$B,
                                     type = 'free'),
                         within = permute::Within(type='none'))


permute::allPerms(tmp,ctrl.nestB)

thanks for your help and patience

2
  • Make sure to add all dependencies in your code block. For example, you mention the permute package, so you should at least have library(permute). Furthermore, when I run your code I get the error: Error in Within(type = "none") : could not find function "Within". What package are you using for Within? Commented May 24, 2025 at 14:51
  • 1
    sorry, it's been addressed Commented May 27, 2025 at 23:57

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.