Dear all,

My goal is to carry out allometry adjustment to produce 'allometry-free' 
shapes and visualize the result. This has been brought up a lot recently, 
but I still wish to check whether what I did was correct, both in terms of 
concepts and implementation. 

Currently I'm doing allometry adjustment in R in this way (without taking 
group into consideration):

mod1 <- lm(shape ~ size) 
mean.shape <- apply(shape, 2, mean)
allometry.free.shape <- t(apply(mod1$residuals, 1, `+`, mean.shape))

But I also have a factor (let's call it 'group'). When I run Procrustes 
ANOVA using procD.lm in geomorph, both group and size:group terms are 
significant, and HOS test in procD.allometry is significant too. If I want 
to take this into consideration to get the allometry free shape, what can I 
do?

I came across MorphoJ's procedure of pooled within group regression and I 
think maybe this is what I am looking for (side note: I'm very confused on 
the difference between what I read from the discussion on this forum some 
time ago 
<https://groups.google.com/a/morphometrics.org/forum/#!topic/morphmet/K7vtiKl2xhI>
 
and MorphoJ's explanation on pooled within group regression, I am not good 
in stats). Following is the explanation from MorphoJ's user manual 
<http://www.flywings.org.uk/MorphoJ_guide/frameset.htm?covariation/regression.htm>
:

*The bottom element is for selecting a pooled within-group regression. This 
type of regression is suitable, for instance, for removing the effect of 
within-group variation of a variable such as size, age or environmental 
factors before comparisons between groups. The analysis is performing a 
regression using the deviations of the dependent and independent variables 
from the respective group means (the group means are added back to the 
residuals and predicted values in the output dataset). *

How can I do this in R? This is what I have came out with:

mod2 <- lm(shape ~ group)
mod3 <- lm(shape ~ size * group)
allometry.free.shape <- mod3$residuals + predict(mod2)

The output visualization made sense but I am not confident. Did it do what 
MorphoJ does? If it was wrong, how can I do it? And is it conceptually 
correct to get allometry free shapes this way for data with significant 
size:group interaction?

Many thanks

Cheers,
Jin Yung

-- 
MORPHMET may be accessed via its webpage at http://www.morphometrics.org
--- 
You received this message because you are subscribed to the Google Groups 
"MORPHMET" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to morphmet+unsubscr...@morphometrics.org.

Reply via email to