procD.lm and advanced.procD.lm

714 views
Skip to first unread message

David Katz

unread,
Mar 2, 2017, 1:36:09 AM3/2/17
to geomorph R package
Hi everyone,

I have a sample with three taxa (A, C, and H), each includes males and females.

Research Question 1: Is sex a meaningful predictor? [FYI, it is.]

I could address this with procD.lm or advanced.procD.lm. However, advanced.procD.lm has some nice additional outputs, specifically among-taxon pairwise values. So, I fit the following model:

advanced.procD.lm(coords ~ sex, ~ sex + taxon,

                              groups = ~taxon,

                              iter=999, data = procD.df)


My question is whether the pairwise comparisons, such as the Least Squares distance matrix below, are computed after controlling for sex.


           A          C          H
A 0.00000000 0.05273518 0.03432703
C 0.05273518 0.00000000 0.06199359
H 0.03432703 0.06199359 0.00000000

Research Question 2: Does the pattern of shape sexual dimorphism differ between the taxa?

I suspect it does for at least one taxon. I'm not sure if I should think of this as differing slopes from F to M, or in terms of varying intercepts. In any event, I fit the following model. I would like to know if it is correctly specified.

advanced.procD.lm(coords ~ sex + taxon, ~ sex * taxon,

                              groups = ~taxon*sex,

                              iter=999, data = procD.df)


Thanks very much for any help.


David

Mike Collyer

unread,
Mar 3, 2017, 7:51:11 AM3/3/17
to David Katz, geomorph R package
Hi David,

To answer your first question, yes, the way you have set up the advanced.procD.lm is the way to control for the effect of sex.

Your second question was addressed mostly correctly, as well.  However, I would encourage you to use trajectory.analysis instead of advanced.procD.lm.  The attempt with advanced.procD.lm has the correct model set-up.  However, your pairwise comparisons are not as good as they could be.  advanced.procD.lm provides what I like to call “first-order” contrasts in means; trajectory.analysis provides “second-order” contrasts.  Specifically, for your research question, trajectory.analysis would find the trajectories (vectors) between males and females in each taxon and then compare these differences.  Instead of differences in means, it a difference of differences between means.  Since sexual dimorphism is a difference, it seems this is what you really want to know.

The example with the plethodon data in the help file should show you how to set up the analysis, which is actually easier than using advanced.procD.lm.

Cheers!
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 post to this group, send email to geomorph-...@googlegroups.com.
Visit this group at https://groups.google.com/group/geomorph-r-package.
To view this discussion on the web, visit https://groups.google.com/d/msgid/geomorph-r-package/c3ee4eeb-26d9-49d6-8c5e-d2af7d5f5f42%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Katz

unread,
Mar 3, 2017, 12:32:41 PM3/3/17
to geomorph R package, katz...@gmail.com
Hi Mike,

Great. So this...

trajectory.analysis(coords ~ taxon*sex, data=procD.df, iter=199)

Returns sex trajectories for the taxa...

It looks like the paths and numerical contrasts are computed for Procrustes residuals rather than the Procrustes distances (which is nice). Two questions:

1. The plot above depicts the first two PCs. I assume, however, that the numerical outputs from summary() are with respect to the entire tangent space. Is that correct?

2. Say I wanted to remove the differences in male means out of the data so that the three trajectories share a common origin. Bad idea? Can this be specified within the trajectory.analysis function, or would I center (pool by males only) my coordinates prior to submitting them to the function?

Thanks again. 

David
To unsubscribe from this group and stop receiving emails from it, send an email to geomorph-r-package+unsub...@googlegroups.com.

Mike Collyer

unread,
Mar 3, 2017, 2:16:43 PM3/3/17
to David Katz, geomorph R package
David,

1. Yes, that is correct.  Also, the PC plot uses a PCA performed on trajectory points (means), it is a projection into a plane that best represents variation among trajectory points, not individual values.

2. I do not recommend this, but if this is something you want to do, the $pc.means attribute of a trajectory.analysis object will allow you to do that extract the vectors you wish to subtract from the pc data.

Cheers!
Mike

To unsubscribe from this group and stop receiving emails from it, send an email to geomorph-r-pack...@googlegroups.com.

To post to this group, send email to geomorph-...@googlegroups.com.
Visit this group at https://groups.google.com/group/geomorph-r-package.

David Katz

unread,
Mar 3, 2017, 2:37:00 PM3/3/17
to Mike Collyer, geomorph R package
Thanks!

To unsubscribe from this group and stop receiving emails from it, send an email to geomorph-r-package+unsubscri...@googlegroups.com.

-- 
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-package+unsub...@googlegroups.com.
To post to this group, send email to geomorph-r-package@googlegroups.com.

--
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-package+unsub...@googlegroups.com.
To post to this group, send email to geomorph-r-package@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
David C. Katz, Ph.D.
Evolutionary Anthropology
University of California, Davis
Young Hall 204

David Katz

unread,
Sep 24, 2017, 7:29:09 PM9/24/17
to geomorph R package
Hi Mike and Dean,

I have a follow-up question. If I want to know if there are significant differences between taxa after accounting for sex, am I supposed to obtain pairwise comparisons like this:

my.procD <- advanced.procD.lm(coords ~ sex, ~ sex + taxon, 
                              groups = ~taxon, 
                              iter=999, data = procD.df)


or like this

my.procD <- advanced.procD.lm(coords ~ 1, ~ sex + taxon, 
                              groups = ~taxon, 
                              iter=999, data = procD.df)


In one the simpler model is a dimorphism model. In the other, and intercept model. The pairwise differences between taxa are significant for one advanced function (intercept model) but not the other (dimorphism model). I'd also like to understand why this is the case. I suspect the first model above is the correct one. 

Thanks, guys.

David

Mike Collyer

unread,
Sep 25, 2017, 7:55:17 AM9/25/17
to geomorph-...@googlegroups.com
David,

The former approach accounts for sex the latter approach does not (and only accounts for the overall mean).  Whenever a simpler null model (like the intercept model is used) the effects sizes for test statistics (pairwise difference in means, in this case) will likely be larger but misrepresentative.  The reason is, using this example, that differences between males could contribute to differences between taxa, especially if the design is not balanced (i.e., one taxon is more represented by females and one more by males) and if sexual dimorphism is a strong effect.  Also, sexual dimorphism might vary among taxa (a sex * taxa effect is significant), potentially influencing a spurious result, if not accounted for.

Your first approach is fine as long as you are not concerned about sexual dimorphism varying among taxa.

Cheers!
Mike


To unsubscribe from this group and stop receiving emails from it, send an email to geomorph-r-pack...@googlegroups.com.

To post to this group, send email to geomorph-...@googlegroups.com.
Visit this group at https://groups.google.com/group/geomorph-r-package.

David Katz

unread,
Sep 25, 2017, 5:06:06 PM9/25/17
to geomorph R package
Thanks as always!

Virus-free. www.avast.com

Thanks!


--
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-package+unsubscribe@googlegroups.com.



--
David C. Katz, Ph.D.
Evolutionary Anthropology
University of California, Davis
Young Hall 204

--
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-package+unsub...@googlegroups.com.

To post to this group, send email to geomorph-r-package@googlegroups.com.
Visit this group at https://groups.google.com/group/geomorph-r-package.

--
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-package+unsub...@googlegroups.com.
To post to this group, send email to geomorph-r-package@googlegroups.com.
Visit this group at https://groups.google.com/group/geomorph-r-package.

For more options, visit https://groups.google.com/d/optout.



--
David C. Katz, Ph.D.
Postdoctoral Fellow
Benedikt Hallgrimsson Lab
University of Calgary

Research Associate
Department of Anthropology
University of California, Davis

Reply all
Reply to author
Forward
0 new messages