random effects terms with procD.lm/lm.rrpp

180 views
Skip to first unread message

geha...@email.wm.edu

unread,
Feb 3, 2021, 11:24:27 AM2/3/21
to geomorph R package
Hi all, 
I have a quick question about using the error argument in anova() to incorporate nested random effects. I have some models that are structured exactly like the vignette, with a nested random factor (Y~ b.length+regime +regime:site), for which anova(error = c("Residuals", "regime:site", "Residuals")) seems to work great. But I also have a more complicated model, again using site:regime as a random factor nested within regime, but also including a species:regime interaction: (Y ~ species + regime + b.length + species:regime  + regime:site). In this case, because site is nested within regime, would the random "regime:site" term MS also be used for the denominator of the species:regime F-stat calculation (e.g., anova(error = c("Residuals", "regime:site", "Residuals", "regime:site", "Residuals"))?

I just want to make sure I was doing this the right way, since a colleague also ran this model as a traditional manova in SAS, and while we expected the results to differ between the two methods a bit, they were different enough that I wanted to double check that I am using this method properly.

Thanks very much
Grant

Mike Collyer

unread,
Feb 3, 2021, 12:47:12 PM2/3/21
to geomorph R package
Grant,

The error statement in anova.lm.rrpp can only use row names from the existing table, so as long as each term has a match to another term or the Residuals, a result is attainable.  The results are based on the random outcomes from RRPP.  Whether the result is what you expect from another program will depend on the process generating random outcomes and what the other program is doing for EMS calculations.

One really important reason for differences could be the type of SS used.  Also, the proc used for SAS might make a difference.  I would expect proc GLM to be more similar than proc Mixed, for example, as it uses LS calculations rather than REML estimation.

Hope that helps!
Mike

--
You received this message because you are subscribed to the Google Groups "geomorph R package" group.
To unsubscribe from this group and stop receiving emails from it, send an email to geomorph-r-pack...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/geomorph-r-package/aeecff75-1eab-4013-afb3-6da3d31cefe5n%40googlegroups.com.

geha...@email.wm.edu

unread,
Feb 3, 2021, 1:07:40 PM2/3/21
to geomorph R package
Thanks, that bit about the SS calculation is very good to know! What I really meant to ask was that it is clear from the vignette that the random factor "site:regime" should be used to calculate the F-stat for the main effect of "regime" because site is nested within regime, but should it also be used in an interaction between regime and another variable, like "regime:species"? Sorry I wasn't very clear in my first message.

thanks!
Grant

Mike Collyer

unread,
Feb 3, 2021, 3:25:07 PM2/3/21
to geomorph R package
Hi Grant,

I think based on your model, site:regime is the term you want in the F denominator.  It looks like site is a random effect and species is a fixed effect  The site:regime effect is the variation that makes sense for evaluating regime variation, since regimes appear to be composed of sites.

Mike

geha...@email.wm.edu

unread,
Feb 3, 2021, 3:57:33 PM2/3/21
to geomorph R package
Excellent, thanks so much for the help.

Grant

Reply all
Reply to author
Forward
0 new messages