-------- Original Message --------
Subject: MorphoJ regression scores in R
Date: Mon, 27 Feb 2012 11:55:57 -0500
From: [email protected]
To: [email protected]
CC: [email protected]
Dear all,
I'm trying to translate in R the procedure implemented in MorphoJ when
performing a multivariate regression in order to extraxct what MorphoJ
calls "regression scores" vector.
As described in Drake and Klingenberg (2008), and in MorphoJ help, given
the regression equation *y* = *xB* + *e*, where *y* is the random vector
of dependent variables (usually shape), *x* is the random vector of
independent variables, *B* is the matrix of regression coefficients, and
*e* is the random vector of error effects. A new variable /s_i / can be
defined as /s_i / = *yb*/_i /^T (*b*/_i /^T *b*/_i /)^-0.5 , where
*b*/_i / is the regression vector for the /i/-th independent variable
(/x_i /) and shape. This is simply a projection of the vector *y* onto
the direction of the regression vector *b*/_i /. In the context of a
regession of a shape vector on one or more independent variables, the
regression score /s_i / can be interpreted as the shape variable that is
most strongly associated with the /i/-th independent variable.
In R, given:
1) a lm() object
2) y: my dependent variables matrix
I defined:
mat.regcoef<-t(as.matrix(lm$coefficients[2,])) ## I transpose now it
because it is in form of vector NOT of matrix
regscores<-(y%*%t(mat.regcoef))%*%(mat.regcoef%*%t(mat.regcoef))^-0.5
but ...when I compare these scores with those extracted by MorphoJ I do
not found an exact identity. And I should do.......
Does anyone have an idea on how to fix the formula?
Thanks in advance
Paolo
--
Paolo Piras
Center for Evolutionary Ecology
and
Dipartimento di Scienze Geologiche, Università Roma Tre
Largo San Leonardo Murialdo, 1, 00146 Roma
Tel: +390657338000
email: [email protected]