[R-sig-eco] Rotations for PCoA?

Jan Hanspach jan.hanspach at ufz.de
Wed Oct 21 13:21:02 CEST 2009


Dear Jari and all others, thanks for your responses!
> Howdy Folks,
>
> Actually, it is "trivial" to have rotation scores for continuous variables:
> it is nothing but matrix multiplication. The problem here is that the
> original analysis used Gower distance for mixed metrics, and we should map
> the factor variables onto continuous variables in the same way as the Gower
> distance does. After that it is "easy" to find the "rotation" scores (but
> see below on metrics). While this can be done, this probably is not wanted
> since the interpretation of "rotation" for factors is non-intuitive, to put
> it mildly. Gower distance handles factors in a special way, and they are not
> the simple factor contrasts you get in standard R functions. How they are
> actually handled can be seen in the Fortran code for daisy or in Gower's
> paper. An extra complication is that Gower distance uses Manhattan metric.
> Therefore it is not possible to just transform data matrix into a form that
> would give the rotation scores in Euclidean PCoA.
>
> The standard way (that is not used in Gower distance) to transform factors
> into continuous data is to use
>
>  mm <- model.matrix(~ ., mydatawithfactors)
>   
That would have be my alternative when the envfit method (see below) was 
not appropriate.
> Which gives you a model matrix where factors are broken into continuous
> contrast variables. You can get "rotation", biplot scores or what ever you
> call for these contrasts, but that is only the beginning of the problems --
> what are you going to do with those scores?
>   
I want to present the scores in table (or possibly a biplot) to 
illustrate interrelatedness of variables. I want to use the variables 
(not the scores) later in a multi-variable regression and want to give 
the reader an idea of the data structure. I don't need the scores for 
further analysis/calculations. So they do not have to be precise in a 
strict sense, but at least the method should be justified and not 
completely wrong.

> Perhaps you can try vegan function envfit which finds the "rotation" scores
> for continuous variables and class centroids for factor variables. They are
> not the same as the strict rotation scores for factors in Gower metric (but
> should be the same as the Legendre scores for continuous variables), but may
> be more intuitive. 
>   
O.k., I'll keep it in mind, that envfit scores do not equal "Gower-PCoA-scores", but they are some kind of easily obtainable substitute and I hope they represent the true scores sufficiently well for my illustrative purposes.

Thanks again for your advice
Best
Jan



More information about the R-sig-ecology mailing list