Hi!
I would like to perform a Phenotypic Trajectory Analysis but it’s not going
well so far!
Goal is to visualize the trajectory between vertebrae (5 vertebrae) across the
body of caecilians (24 sp). Would like to get 1 trajectory per species, and
this trajectory going through the 5 vertebrae.
My initial model is:
gdfmean<-geomorph.data.frame(lm=coords, vert=group2, Cs=CStot, sp=sp)
fit <- lm.rrpp (lm ~ Cs * vert , data= gdfmean, iter = 199)
I want to include the
size in the model, is it the first mistake? Should I include ‘sp’ in my model prior to perform the PTA?
Because then I would like to do the PTA:
TA <- trajectory.analysis(fit, groups = gdfmean$vert, traj.pts = gdfmean$sp)
--> “Error: Not every trajectory point has replication (more than one observation).”
Here’s what I have in
vert and sp.
I have replication in both groups… It represents the vertebra 20
for all species, and then vertebra 2 for all species, …
Maybe it has to be organized such as V20 V2 V3 V60 and V90 for one species, and
then same for the other species and so on?
Thanks a lot for your help!
Aurélien
On Mar 3, 2022, at 5:06 AM, lowiea...@gmail.com <lowiea...@gmail.com> wrote:
Hi!
I would like to perform a Phenotypic Trajectory Analysis but it’s not going well so far!
Goal is to visualize the trajectory between vertebrae (5 vertebrae) across the body of caecilians (24 sp). Would like to get 1 trajectory per species, and this trajectory going through the 5 vertebrae.
My initial model is:gdfmean<-geomorph.data.frame(lm=coords, vert=group2, Cs=CStot, sp=sp)
fit <- lm.rrpp (lm ~ Cs * vert , data= gdfmean, iter = 199)
I want to include the size in the model, is it the first mistake? Should I include ‘sp’ in my model prior to perform the PTA?
Because then I would like to do the PTA:TA <- trajectory.analysis(fit, groups = gdfmean$vert, traj.pts = gdfmean$sp)
--> “Error: Not every trajectory point has replication (more than one observation).”
Here’s what I have in vert and sp.
<Capture.PNG>
I have replication in both groups… It represents the vertebra 20 for all species, and then vertebra 2 for all species, …
Maybe it has to be organized such as V20 V2 V3 V60 and V90 for one species, and then same for the other species and so on?
Thanks a lot for your help!
Aurélien
--
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/a494f3e2-512c-41e0-97a1-d19c35d46686n%40googlegroups.com.
<Capture.PNG>
To view this discussion on the web, visit https://groups.google.com/d/msgid/geomorph-r-package/7cdb7d0a-f372-491a-a10c-04cba18a5f41n%40googlegroups.com.
On Mar 3, 2022, at 10:13 AM, lowiea...@gmail.com <lowiea...@gmail.com> wrote:
Like this then:TA <- trajectory.analysis(fit, groups = as.factor(gdfmean$vert), traj.pts = as.factor(gdfmean$sp))
It still gives the same error...
To view this discussion on the web, visit https://groups.google.com/d/msgid/geomorph-r-package/eba5f5cc-1789-4a10-a9b8-6eeb8e5d264an%40googlegroups.com.
<Capture.PNG>
Aurélien,
The plot you wish to generate does not require the trajectory analysis per se. These trajectories are quite similar to the ‘motion path’ example in the help file for trajectory.analysis in geomorph.
However, from reading the exchange you’ve been having, you still could not perform the analysis, because even for that specialized data set-up, you still require ‘groups’ of species to compare. So whether the design is of this type, or of the type you were discussing with Mike, either way you have no replication, so zero residual df. Like Mike said, there is no test to perform.
Dean
Dr. Dean C. Adams (he/him)
Distinguished Professor of Evolutionary Biology
Director of Graduate Education, EEB Program
Department of Ecology, Evolution, and Organismal Biology
Iowa State University
https://faculty.sites.iastate.edu/dcadams/
phone: 515-294-3834
To view this discussion on the web, visit https://groups.google.com/d/msgid/geomorph-r-package/9f2e51ed-e203-4882-bb47-5e2cdd56b21cn%40googlegroups.com.
Dear geomorph community,
I am conducting a phenotypic trajectory analysis to investigate possible intraspecific sexual shape dimorphism in fish species inhabiting two different areas in the Adriatic Sea that differ mainly in terms of resource availability and structure. However, I am also interested in examining sexual size dimorphism between the sampled populations and whether they follow Rensch's rule or the pattern whereby size is more female biased (i.e., the female size to male size ratio is higher) the smaller the body size of the species, whereas it becomes increasingly more male biased the larger-bodied the species.
I came across the angler package (https://github.com/TWilliamBell/angler), which seems to be compatible with geomorph as it provides the ability to calculate sexual size and shape dimorphism using landmark-based sexual dimorphism data. However, I have not been able to run the code or structure it properly. So, I was wondering if anyone has experience with this package and can provide some guidelines on how to implement the code with geomorph.
Also, if someone has some advice how to produce the RMA analysis and the plot as found in Kelly et al. (2013) – Figure 4 would be helpful, as I have difficulties creating it properly due to insufficient coding skills.
Thank you for your consideration.
Sincerely,
Igor
Reference:
Kelly, C.D., Folinsbee, K.E., Adams, D.C., Jennions, M.,D. (2013) Intraspecific sexual size and shape dimorphism in an Australian freshwater fish differs with respect to a biogeographic barrier and latitude. Evolutionary Biology, 40: 408-419.
On Jul 14, 2022, at 5:06 AM, talijan...@gmail.com <talijan...@gmail.com> wrote:
--
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/f3df59f3-f3f4-4ac7-8add-e586239c075en%40googlegroups.com.
https://github.com/DworkinLab/angler
On Jul 14, 2022, at 7:03 AM, Ian Dworkin <ian.d...@gmail.com> wrote:
To view this discussion on the web, visit https://groups.google.com/d/msgid/geomorph-r-package/823BBCA7-95FB-48D8-BBC8-8F7BAA998526%40gmail.com.
Hi everyone,
I am trying to perform a phenotypic trajectory analysis and i am having trouble.
I am comparing shape change during ontogeny of different species and I only have one shape for each trajectory point for each species.
From Esquerre et al., 2017
I read the conversations on PTA and I suspected that the issue is not having multiple replicates per trajectory point for each taxon. I tried using a similar method to the motion.path example and I keep getting this error:
gdf <- geomorph.data.frame(coords = gpa$coords, CS= gpa$Csize, age=age, taxons = taxons, families = families )
fit <- procD.lm(coords ~ log10(CS)+taxons, data = gdf, iter = 999, turbo = TRUE, RRPP = TRUE, print.progress = T)
##taxons and age are both factors.
TA <- trajectory.analysis(fit, groups = gdf$taxons, traj.pts = 2, pca = T)
Error in trajectory.analysis(fit, groups = gdf$taxons, traj.pts = 2, pca = T) :
The number of variables divided by the number of trajectory points is not an integer
I would really appreciate any help!
Unfortunately, you do not have the required replication to perform the test (or any test really).
For trajectory analysis, you either need multiple individuals per level to define each trajectory (as described in the original Collyer and Adams 2007 procedure), or you require multiple, replicate full trajectories in each group (as described in the Adams and Cerney 2007 motion trajectory procedure). Either way, one requires replication of trajectory units or individuals used to describe those units.
From your email, it seems you have a single juvenile and a single adult per species ‘trajectory’. With this, all one can do is draw lines between Juv—Adult in morphospace to visualize ontogeny. But statistical tests like those in trajectory analysis are not possible, as there is no replication in the study design. As with all statistical analyses, trajectory analysis requires replication to estimate variation against which observed patterns may be compared.
Sorry.
Dean
Dr. Dean C. Adams (he/him)
Distinguished Professor of Evolutionary Biology
Department of Ecology, Evolution, and Organismal Biology
From: geomorph-...@googlegroups.com <geomorph-...@googlegroups.com>
On Behalf Of Bassel Arnaout
Sent: Tuesday, June 27, 2023 5:40 PM
To: geomorph R package <geomorph-...@googlegroups.com>
Subject: Re: [geomorph-r-package] Phenotypic Trajectory Analysis
Hi everyone,
To view this discussion on the web, visit https://groups.google.com/d/msgid/geomorph-r-package/30cc12e4-2454-4692-85a8-da7cc8dd9484n%40googlegroups.com.
Yes, using a combination of various functions and some home-grown (read ugly!) code. Here is a simple example for 2 vectors.
Dean
library(geomorph)
## Simulate some triangles: 1 per group
Y <- arrayspecs(matrix(rnorm(24), nrow = 4), p=3, k=2)
shape <- gpagen(Y)$coords
X <- gl(2,2)
sex <- factor(c(1,2,1,2))
gp <- interaction(X,sex)
# # Fit model
fit <- procD.lm(shape~X*sex)
PW <- pairwise(fit, groups = gp)
#vector lengths (elements 1,3 & 2,4)
PW$means.dist[[1]]
# vector angles
acos(RRPP:::vec.cor.matrix(rbind(PW$LS.means[[1]][1,]-PW$LS.means[[1]][3,],
PW$LS.means[[1]][2,]-PW$LS.means[[1]][4,])))*180/pi
To view this discussion on the web, visit https://groups.google.com/d/msgid/geomorph-r-package/a9068020-b542-4e3d-bf1d-4ecb34b47b50n%40googlegroups.com.
acos(RRPP:::vec.cor.matrix(rbind(PW$LS.means[[1]][1,]-PW$LS.means[[1]][3,],
PW$LS.means[[1]][2,]-PW$LS.means[[1]][4,])))*180/pi
I couldn't understand this function and so I couldn't adapt it. It seems to be subtracting between different values of the first iteration. I couldn't understand where would (x1-x2) and (y1-y2) be?
Many Thanks again,…$means.dist is a distance matrix among group means for all groups in the interaction.
My code used the least-squares means for these. Subtracting one of those (e.g., males gp 1 – females gp 1) generates a sexual dimorphism vector. These are bound together in rowwise. Then, the correlation between those vectors is found, which is converted to an angle (mathematically, correlations are cosines of angles).
To view this discussion on the web, visit https://groups.google.com/d/msgid/geomorph-r-package/83469a0e-3ce2-48e0-a23d-4aa144582864n%40googlegroups.com.