[R] Regression coefficients

Jeff Newmiller jdnewmil at dcn.davis.CA.us
Sat Apr 27 01:53:22 CEST 2013


?coef

There are many introductory texts on R... I recommend getting a few.
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.

Preetam Pal <lordpreetam at gmail.com> wrote:

>Hi all,
>
>I have run a ridge regression as follows:
>
>reg=lm.ridge(final$l~final$lag1+final$lag2+final$g+final$g+final$u,
>lambda=seq(0,10,0.01))
>
>Then I enter :
>
>select(reg)   and it returns: modified HKB estimator is 19.3409
>                                     modified L-W estimator is 36.18617
>                                       smallest value of GCV  at 10
>
>I think it means that it is advisable to use the results of regression
>corresponding to lambda= 10;
>so the next thing I do is:
>
>reg=lm.ridge(final$l~final$lag1+final$lag2+final$g+final$u, lambda=10)
>
>which yields:
>
>                             final$lag1    final$lag2       final$g
>    final$u
> 3.147255e-04  1.802505e-01 -4.461005e-02 -1.728046e-09 -5.154932e-04
>
>
>If I am to use these coefficient values later in my analysis, how do I
>call
>them; for clearly reg$final$lag1  does not work.
>
>1> Any way I can access these values?
>
>2> The main issue is that I want to access these coefficient values
>automatically, i.e. R should run the regression and automatically
>provide
>me these values after taking into consideration that lambda which
>minimizes
>the GCV.   Kindly advise me how I can proceed.
>
>
>Thanks and regards,
>Preetam



More information about the R-help mailing list