[R] prevent aov re-ordering of model terms

Pascal A. Niklaus Pascal.Niklaus at unibas.ch
Thu Dec 18 16:17:37 CET 2003


Is there a way to prevent the re-ordering of factors by aov? I do have a 
three-way interaction that I do want to fit before a two-way interaction 
(different factors, so they are not nested), but R moves the two-way 
interaction to the front. I know it generally makes sense to fit the 
two-way interactions first, but in this case I think I know what I'm doing.

                   + hv
                   + hv:rep
                   + hv:soil
                   + hv:spdiv
                   + hv:spdivnom
                   + hv:fgdiv
                   + hv:fgdivnom
                   + hv:soil:spdiv
                   + hv:soil:spdivnom
                   + hv:soil:fgdiv
                   + hv:soil:fgdivnom
                   + hv:mx                    #<-- that one here
                   + hv:soil:mx

mx is a random factor, and I do want to semi-manually test the three-way 
interactions against "hv:mx". soil is treated as fixed effect.

I know I can fit the first part, then save the residuals, and then fit 
the last two terms, but it would be really nice not to have to do this 
in two steps.

Pascal




More information about the R-help mailing list