[R-sig-eco] PCA for composition data followed by RLQ
Terri Lacourse
t|@cour@ @end|ng |rom uv|c@c@
Tue Feb 22 04:10:58 CET 2022
Dear Diogo,
I don’t see a way to run a “compositional PCA” in ade4. I presume you mean log-ratios as proposed by Aitchison? Could you determine the log-ratios first and then send that to the dudi matrix?
Perhaps you could use Hellinger transformation instead for your compositional data. That is what I do, and then I set the RLQ environment in this way:
data1_L <- dudi.coa(data1, scannf=F, nf=2) # these are Hellinger-transformed compositional data like your diet data
data2_R <- dudi.pca(data2, scannf=F, nf=2, row.w=data1_L$lw)
data3_Q <- dudi.pca(data3, scannf=F, nf=2, row.w=data1_L$cw)
rlq.output <- rlq(data2_R, data1_L, data3_Q, scannf=F, nf=2)
Best wishes,
-Terri
~~~~~~~~~~~~~~~~~~~
Terri Lacourse
Associate Professor
Department of Biology
University of Victoria
Victoria, BC
Canada V8W 2Y2
tlacours using uvic.ca
~~~~~~~~~~~~~~~~~~~
> On Feb 21, 2022, at 12:14 PM, Diogo B. Provete <dbprovete using gmail.com> wrote:
>
> Dear members,
> I'm trying to run an RLQ analysis to test for a covariation between skull
> shape (set of eigenvectors) and diet composition for a set of bat species.
> The point is, the data for diet is expressed as percentage, with rows
> (species) summing to 100. Therefore, it's better treated as compositional
> data.
>
> I have already run a compositional PCA in the R package compositions, which
> returns an object of the class princomp. However, ade4::rlq only accepts
> dudi matrices. I don't know how to convert a princomp to a dudi object or
> perhaps run a compositional PCA in ade4. as.dudi seems not to be called
> directly by the user.
>
> Does anyone have any clue on how to do this?
>
> Thank you in advance,
> Diogo
>
> --
>
> Diogo B. Provete, PhD
>
> Assistant Professor
>
> Biodiversity Synthesis lab <http://diogoprovete.weebly.com/>
>
> Biosciences Institute | Federal University of Mato Grosso do Sul | Brazil
>
>
> Skype: diogoprovete
>
>
> Director of Graduate studies in Animal Biology
> <https://ppgbioanimal.ufms.br/>
> __
> Biodiversity & Conservation Section Editor at PeerJ
> Open Access Journals
> peerj.com/diogoprovete <https://peerj.com/diogoprovete/>
>
> Associate Editor: Austral Ecology
> <https://onlinelibrary.wiley.com/page/journal/14429993/homepage/editorialboard.html>
> | Amphibia-Reptilia
> <https://brill.com/view/journals/amre/amre-overview.xml> | BMC Ecology and
> Evolution | Ecosphere
> <https://esajournals.onlinelibrary.wiley.com/hub/journal/21508925/editorial-board/editorial-board>
> | Ecology and Evolution | Frontiers in Ecology and the Environment |
> Journal of Biogeography | Journal of Herpetology
> <https://journalofherpetology.com/>
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-ecology mailing list
> R-sig-ecology using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
More information about the R-sig-ecology
mailing list