Re: [R] environmental data as vector in PCA plots

About this list Date view Thread view Subject view Author view Attachment view

From: Jari Oksanen (jari.oksanen@oulu.fi)
Date: Tue 11 May 2004 - 02:09:16 EST


Message-id: <629D19E0-A29C-11D8-B2E8-000A95C76CA8@oulu.fi>


On 10 May 2004, at 17:15, Heike Schmitt wrote:

> I want to include a vector representing the sites - environmental data
> correlation in a PCA.
> I currently use prcomp (no scaling) to perform the PCA, and envfit to
> retrieve the coordinates of the environmental data vector. However, the
> vector length is different from the one obtained in CAnoco when
> performing
> a species - environmental biplot (scaling -2). How can I scale the
> vector
> in order to be in accordance with Canoco, or which other scaling
> options
> are there?

Canoco scaling abs(2) does not scale sites, but the sum of squares of
site scores = 1 for all axes. In contrast, prcomp scales site axes by
eigenvalue, like does Canoco with scaling abs(1). Therefore you cannot
get similar results as in Canoco. A simple solution that *may* (or may
not) work is to transpose your data: instead of prcomp(x), try
prcomp(t(scale(x, scale=F), center=F). This does the centring to the
columns of x (like it should be done), then transposes your data and
prcomp's without new centring -- which was already made for columns (I
didn't test this, but this way it was done in the olden times). Another
alternative is to use the function rda in the same package where you
found envfit (vegan), since it is not unlike Canoco in its scaling.
However, it won't give you negative scalings of PCA (RDA without
constraints), since its author (that's I) thinks that you shouldn't use
negative scaling of Canoco in RDA/PCA. The package ships with a pdf
document which discusses PCA scaling in prcomp, princomp, rda (of
vegan) and Canoco (of Cajo ter Braak), and even hints how to get the
minus scalings that the author doesn't approve.

cheers, jari oksanen

--
Jari Oksanen, Oulu, Finland

______________________________________________ R-help@stat.math.ethz.ch mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html


About this list Date view Thread view Subject view Author view Attachment view

This archive was generated by hypermail 2.1.3 : Mon 31 May 2004 - 23:05:08 EST