[R] question about 'coef' method and fitted_value calculation

Berton Gunter gunter.berton at gene.com
Mon Aug 21 23:51:10 CEST 2006


I'm ignorant about this, so no answer. But as you seem interested in
coefficient shrinkage, have you tried the lars or lasso2 package?

-- Bert Gunter
Genentech Non-Clinical Statistics
South San Francisco, CA
 
"The business of the statistician is to catalyze the scientific learning
process."  - George E. P. Box
 
 

> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch 
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of jz7 at duke.edu
> Sent: Monday, August 21, 2006 2:40 PM
> To: r-help at stat.math.ethz.ch
> Subject: [R] question about 'coef' method and fitted_value calculation
> 
> 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
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list