I'll just add one note of caution.  If you do the independent contrasts
calculations, make sure the package you use to compute correlations is
actually doing them through the origin.  In years past, I ran into stats
programs that would give you a regression through the origin (slope) as
requested, but would also report a correlation coefficient that was NOT
through the origin!  As always, trust but verify!
Cheers,
Ted

On Sun, Jun 13, 2021 at 7:04 AM Julien Clavel <julien.cla...@hotmail.fr>
wrote:

> Dear Oliver,
>
> Yes, you can use the independent contrasts to estimate the
> correlations (e.g., assuming BM). Otherwise, you can compute the
> correlations
> directly from the models fit in mvMORPH.
>
> For instance, under BM you can use:
>
> fit_bm <- mvBM(tree, data)
> cov2cor(fit_bm$sigma) # marginal correlations
> cor2pcor(fit_bm$sigma) # partial correlations
>
> Under OU, you can also retrieve the correlations from the
> variance-covariance matrix
> (which depends on both the “sigma” and “alpha” parameters, and can be
> retrieved
> with the “stationary” function):
> fit_ou <- mvOU(tree, data)
> cov2cor(stationary(fit_ou$sigma)) # marginal correlations
> cor2pcor(stationary(fit_ou)) # partial correlations
>
>
> Alternatively, you can use the “mvgls” function to do it, e.g.:
>
> fit_bm2 <- mvgls(data~1, tree=tree, model="BM", method="LL")
> cov2cor(fit_bm2$sigma$Pinv) # marginal correlations
> cor2pcor(fit_bm2$sigma$Pinv) # partial correlations
>
> You can for instance use penalized likelihood to obtain a
> regularized estimate of the evolutionary correlations:
>
> fit_bm2 <- mvgls(data~1, tree=tree, model="BM", method="PL") # Ridge
> penalization by default
> cov2cor(fit_bm2$sigma$Pinv) # marginal correlations
> cor2pcor(fit_bm2$sigma$Pinv) # partial correlations
>
> With LASSO penalization, for instance, you can find a sparse
> estimate for the partial correlations. That is, you can directly select
> the “significant”
> partial correlations from the model fit:
>
> fit_bm2 <- mvgls(data~1, tree=tree, model="BM", method="PL",
> penalty="LASSO")
> cov2cor(fit_bm2$sigma$Pinv) # marginal correlations
> cor2pcor(fit_bm2$sigma$Pinv) # partial correlations
>
> Best wishes,
>
> Julien
>
>
>
> De : R-sig-phylo <r-sig-phylo-boun...@r-project.org> de la part de Oliver
> Betz <oliver.b...@uni-tuebingen.de>
> Envoyé : dimanche 13 juin 2021 14:45
> À : r-sig-phylo@r-project.org <r-sig-phylo@r-project.org>
> Objet : [R-sig-phylo] phylogenetic correlation analysis
>
> Dear all:
>
> I would like to perform a phylogenetic correlation analysis (simlar to
> PGLS, but correlation instead of regression), so that I get a
> correlation matrix, where all the Pearson or Spearman correlation
> coefficients between all of my variables are listed. One solution
> might be to calculate PICs and do standard correlation analyses on
> them, but there might be a more direct solution available?
>
> Which R package would you recommend for such analysis?
>
>
> Thank you very much,
>
> Oliver Betz
>
> _______________________________________________
> R-sig-phylo mailing list - R-sig-phylo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
> Searchable archive at
> http://www.mail-archive.com/r-sig-phylo@r-project.org/
> _______________________________________________
> R-sig-phylo mailing list - R-sig-phylo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
> Searchable archive at
> http://www.mail-archive.com/r-sig-phylo@r-project.org/
>

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Reply via email to