0
$\begingroup$

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!

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

1 Answer 1

0
$\begingroup$

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

$\endgroup$
3
  • 1
    $\begingroup$ Thank you @Llopis ! It sounds like a great solution. I will give it a try and let you know how it goes. $\endgroup$ Sep 20, 2018 at 9:32
  • $\begingroup$ 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 $\endgroup$ Sep 24, 2018 at 0:28
  • $\begingroup$ Do you have any character in the matrices A? Are you sure it is numeric? $\endgroup$
    – llrs
    Sep 24, 2018 at 14:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.