Jin Yung,

Evaluating Rsq for multivariate data can be a bit tricky, as our intuition 
tends to gravitate to ‘what is a large Rsq’ and ‘what is a small Rsq’ in the 
univariate context.  To interpret the importance of a model effect in 
multivariate models, I much prefer a formal effect size.

We (Collyer, Sekora and Adams 2015: Heredity) described a Z-score approach for 
helping one intuit the strength of a model effect. If the Z-score for a 
particular term in the model is large, then there is a large effect on the 
patterns in the data, implying it is important to interpret biologically.  
Examples in the Collyer et al paper show their use for anova models (a related 
method is found in Adams and Collyer 2016).

In your case, I suggest that you first evaluate the Z-score for the interaction 
term, rather than its Rsq, to determine whether this statistically significant 
interaction is also biologically important. These are provided in the 
Procrustes ANOVA tables in geomorph (see help file).

Dean

Dr. Dean C. Adams
Professor
Department of Ecology, Evolution, and Organismal Biology
       Department of Statistics
Iowa State University
www.public.iastate.edu/~dcadams/<http://www.public.iastate.edu/~dcadams/>
phone: 515-294-3834

From: Wong Jin Yung [mailto:wongjiny...@gmail.com]
Sent: Tuesday, December 13, 2016 9:54 PM
To: Adams, Dean [EEOBS] <dcad...@iastate.edu>
Cc: MORPHMET <morphmet@morphometrics.org>
Subject: Re: [MORPHMET] allometry adjustment in R

Dear Dean,
Thank you for pointing out my conceptual mistake and explaining it in a way 
easy to understand. For my data, I think the interaction is not biologically 
meaningful, so I do not intend to further investigate the difference in 
allometric trajectories.

Following discussion is for everyone, I will elaborate more and see if people 
here are interested on my specific case -- maybe my case could help other 
students like me too: I have two groups, A & B. A has strong allometry but B 
does not (I tried running regression of shape~size on A & B separately, B gave 
insignificant result and low Rsq -- which is the reason why I have no interest 
on difference in allometric trajectories). But when I ran the regression on the 
full dataset with shape~size*group, I got significant size:group term with low 
Rsq (0.03) and significant HOS test with large angle. Shape prediction from 
common slope (with a simple shape~size on full dataset) did not account for the 
true allometric changes of group A (from separate shape~size for A) like what 
Dean said but did captured most of it, and is off for group B (but then group B 
has little & non-significant allometric changes...). Any further opinion will 
be appreciated, many thanks.

Best,
Jin Yung

On Tue, Dec 13, 2016 at 10:28 PM, Adams, Dean [EEOBS] 
<dcad...@iastate.edu<mailto:dcad...@iastate.edu>> wrote:
Jin Yung,

Before sorting out an R-code equivalent for what MorphoJ does, I recommend that 
you revisit and re-read the last few posts on Morphmet concerning statistical 
and biological significance of comparisons of slopes.  The important thing to 
determine first and foremost is whether or not the significant interaction term 
in your model is biologically meaningful (ie, does it represent the underlying 
patterns in the data or is it spurious for some reason). If it does represent 
the underlying patterns in  your data, than any pooled-group or common 
regression-based allometric residuals makes no sense.

Think of it this way: both a common slope model and a pooled within-group model 
assume that patterns of within-group covariation are equivalent (‘the same’ in 
vernacular speech).  If that assumption can be made, then one can fit a common 
slope or pooled-within group model and obtain so-called allometry-free 
residuals.  However, if the groups really do have different slopes, that means 
the within-group allometric trajectories are different. In this case it makes 
no sense to obtain allometric residuals from a common slope model, or a 
pooled-within group model, as these models do not account for the different 
shape~size relationships in each group. Thus, the common-slope analysis is not 
accounting for the actual allometric patterns in any of the groups. What that 
means is that the residuals for group A are not residuals from the shape~size 
allometric relationship in group A, but rather are the allometric residuals of 
this group +/- the difference in that groups’ slope versus the common-slope 
model. And likewise for group B, group C, etc.   Importantly, note that the 
difference in actual within-group residuals from common-slope residuals is not 
a constant across groups: meaning that there is no way to make these residuals 
comparable units for downstream analyses.

Additionally, obtaining residuals from a separate slopes model (i.e., a model 
containing the interaction term, as you have in your post) also makes little 
sense because here the residuals are obtained from different allometric 
trajectories for each group.  Thus, those residuals are not comparable, because 
they have accounted for a different shape~size relationship for each group. In 
other words, they are residuals of different models for each group, and are not 
comparable units for subsequent analyses either.

Thus it is ONLY the case that allometric residuals can be used in downstream 
analyses when those groups are deemed to have a common allometric slope.  When 
they do not, allometric residuals from a common model or separate models, 
should not be placed together and used in subsequent analyses.

What I’m getting at here is that when the allometric slopes between groups 
truly are different, then biology has changed your question. The question now 
is in understanding how those allometric trajectories differ, not whether the 
groups differ in the allometric residuals themselves. That is not always what 
the biologist sets out to ask, but sometimes the data tell us what we should be 
asking. Data has a funny way of refocusing our gaze to the questions we should 
have asked!

‘The data are’ as the great Dr. Sokal told many of us over the years.

Hope this helps.

Best,

Dean


Dr. Dean C. Adams
Professor
Department of Ecology, Evolution, and Organismal Biology
       Department of Statistics
Iowa State University
www.public.iastate.edu/~dcadams/<http://www.public.iastate.edu/~dcadams/>
phone: 515-294-3834<tel:(515)%20294-3834>

From: wongjinyung [mailto:wongjiny...@gmail.com<mailto:wongjiny...@gmail.com>]
Sent: Tuesday, December 13, 2016 7:53 AM
To: MORPHMET <morphmet@morphometrics.org<mailto:morphmet@morphometrics.org>>
Subject: [MORPHMET] allometry adjustment in R

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<mailto:morphmet+unsubscr...@morphometrics.org>.

-- 
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