# Which analysis to use to discriminate morphometrics measurements from different species from 2 different environment?

So I have a dataset of measurements (lengths, surface areas, volumes...) from 3 species from 2 different environments, with 3 individuals per species. Can be summarised like that:

ENVIRO  SPECIES  INDIV  meas1  meas2   ...
1       sp1       A     8017    4.5    ...
1       sp1       B     5019    4.5    ...
1       sp1       C     8017    4.6    ...
2       sp2       D     8870    2.1    ...
2       sp2       E     8305    2.0    ...
2       sp2       F     8305    2.2    ...
2       sp3       G     8221    2.6    ...
2       sp3       H     8994    2.5    ...
2       sp3       I     8775    2.5    ...


I have about 40 measurement variables... I was looking at trying to do a something like a linear discriminant analysis do discriminate between environment 1 and 2. However, I have way too many variables (~40) compared to observations (9) to make it work.

Could anyone advise me on which other analysis (on R) would allow me to study the relationships of these morphological measurements with an environment? (if that is even possible before getting more observations).

I would appreciate any ideas. Thank you!

• If I understood correctly you have the same (3) species in the 2 environments?
– llrs
Sep 18, 2018 at 14:22
• No sorry, I have only species 1 in enviro 1 and species 2 and 3 in enviro 2 Sep 18, 2018 at 23:42

This is how I would do it with R, assuming that the data is in the object data.

library("RGCCA") # Library for the canonical correlation analysis
environment <- data[, 1]
measures <- data[, 4:44]
A <- list(environment, measures)
tau <- c(1, tau.estimate(measures)) # Regularization parameter, 1 for covariance with the environment.
C <- matrix(c(0, 1, 1, 0), ncol = 2, nrow = 2) # Design matrix
CCA <- rgcca(A, tau, C, scheme = "centroid")


However, I think this is to few data to make an accurate relationship between environment and measurements. It would be perfect if you could have more samples/individuals for both environments

• Thank you @Llopis ! It sounds like a great solution. I will give it a try and let you know how it goes. Sep 20, 2018 at 9:32
• I get this error on R: > CCA <- rgcca(A, tau, C, scheme = "centroid") Computation of the RGCCA block components based on the centroid scheme Error in colMeans(x, na.rm = TRUE) : 'x' must be numeric Sep 24, 2018 at 0:28
• Do you have any character in the matrices A? Are you sure it is numeric?
– llrs
Sep 24, 2018 at 14:30