[R] question about 'coef' method and fitted_value calculation
jz7 at duke.edu
jz7 at duke.edu
Mon Aug 21 23:39:35 CEST 2006
Dear all,
I am trying to calculate the fitted values using a ridge model
(lm.ridge(), MASS library). Since the predict() does not work for lm.ridge
object, I want to get the fitted_value from the coefficients information.
The following are the codes I use:
fit = lm.ridge(myY~myX,lambda=lamb,scales=F,coef=T)
coeff = fit$coef
However, it seems that "coeff" (or "fit$coef") is not really the
coefficients matrix. From the manual, "Note that these are not on the
original scale and are for use by the 'coef' method...".
Could anyone please point out what is the 'coef' method the manual
mentioned, and how should I get the fitted value? I have tried simple
multiplication of the coeff and my X matrix ("coeff%*%X"). But the results
seems to be in the wrong scale.
Thanks so much!
Sincerely,
Jeny
More information about the R-help
mailing list