Vector Comparison

31 views
Skip to first unread message

Fatih Aydık

unread,
Oct 9, 2025, 12:55:21 PMOct 9
to geomorph R package
Dear All,

I want to determine how two different variables affect the shape (of the same group) in terms of direction and magnitude.

fit1 <- procD.lm(shape ~ V1)
fit2 <- procD.lm (shape ~ V2)

What is the most suitable option for assessing the directions and testing those differences in directions? I managed to manually extract and compare the directions of the vectors of models. What I wonder is if any of RRPP or Geomorph functions exist for this purpose. I would appreciate if you provide guidance for use of it. 

Thank you,
Fatih

Mihajlo Milic

unread,
Oct 9, 2025, 2:47:08 PMOct 9
to geomorph-...@googlegroups.com
Hi Fatih,

There is a function called trajectory.analysis() within RRPP, and it tests for differences in magnitude and direction (and some additional trajectory attributes) of phenotypic change between groups, so exactly what you desire. You can find a detailed description on how to use the function within R.

Best,
Mihajlo

--
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, visit https://groups.google.com/d/msgid/geomorph-r-package/7c863583-c4d4-4ba6-9b81-91c79594037bn%40googlegroups.com.

Fatih Aydık

unread,
Oct 9, 2025, 3:37:31 PMOct 9
to geomorph R package
Hello Mihajlo,

Thank you for the answer. However I think trajectory.analysis requires a group variable which should be defined as a factor. Those models I shared belongs to the same group. Basically I want to know how V1 vs V2 differs in terms of affecting the same shape belongs to the same group. So, I couldn't manage it to work for my purpose.

Thanks again,
Fatih

9 Ekim 2025 Perşembe tarihinde saat 21:47:08 UTC+3 itibarıyla mihajlo....@gmail.com şunları yazdı:

Adams, Dean [EEOB]

unread,
Oct 9, 2025, 4:19:44 PMOct 9
to geomorph R package
Fatih,

You did not provide details on what V1 and V2 represent. However if we assume that they are continuous covariates, the function 'betaTest' in RRPP may be what you are looking for.

This function performs tests on coefficients using RRPP. One can test the coefficients against zero (the 'standard' test of coefficients), or one could specify the coefficients of the null model against which to compare the observed. The latter is similar in spirit to the approach of Cicuéndez et al. (2023) who used RRPP for evaluating allometry relative to the isometry vector (rather than the zero vector).

In your case, you could compare coefficients from the V1 model to the V2 model. This is essentially evaluating whether the direction of the coefficient vectors are concordant. A simple example is below (and the help file provides details and citations). 

### EXAMPLE
library(geomorph)
data("PlethMorph")

PlethMorph$Y <- cbind(PlethMorph$HeadLength, PlethMorph$TailLength)
fit1 <- lm.rrpp(Y ~ SVL, 
                data = PlethMorph,
                verbose = TRUE)
fit2 <- lm.rrpp(Y ~ BodyWidth, 
                data = PlethMorph,
                verbose = TRUE)

Test1 <- betaTest(fit1, coef.no = 2, Beta = coef(fit2)[2,])
summary(Test1)
###

Hope this helps.

Dean
--
Dr. Dean C. Adams
Distinguished Professor
Director, Ecology and Evolutionary Biology Graduate Program
Department of Ecology, Evolution, and Organismal Biology
Iowa State University

From: geomorph-...@googlegroups.com <geomorph-...@googlegroups.com> on behalf of Fatih Aydık <fatih...@gmail.com>
Sent: Thursday, October 9, 2025 2:37 PM
To: geomorph R package <geomorph-...@googlegroups.com>
Subject: Re: [geomorph-r-package] Vector Comparison
 

Fatih Aydık

unread,
Oct 10, 2025, 8:40:26 PMOct 10
to geomorph R package
Dear Prof. Adams,

Thank you very much for the information. Yes, I forgot to mention that variables are continuous. In short, can I proceed with regular manual vector angle comparison and assess the distances and significance with betaTest?

Best,
Fatih

9 Ekim 2025 Perşembe tarihinde saat 23:19:44 UTC+3 itibarıyla dca...@iastate.edu şunları yazdı:

Fatih Aydık

unread,
Oct 10, 2025, 8:46:45 PMOct 10
to geomorph R package
Hello,

I asked that because -if I understand correctly- betaTest mainly tests the coefficients against the zero. We basically, as Cicuendez et al. did, follow an alternative route and replace the zero with the other model's coefficients, right?

Thank you again,
Fatih
11 Ekim 2025 Cumartesi tarihinde saat 03:40:26 UTC+3 itibarıyla Fatih Aydık şunları yazdı:

Adams, Dean [EEOB]

unread,
Oct 10, 2025, 8:47:41 PMOct 10
to geomorph-...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages