[R] Extracting t-tests on coefficients in lm

David C. Howell David.Howell at uvm.edu
Wed Jun 20 23:14:02 CEST 2007


I am writing a resampling program for multiple regression using lm(). I 
resample the data 10,000 times, each time extracting the regression 
coefficients. At present I extract the individual regression 
coefficients using

  brg = lm(Newdv~Teach + Exam + Knowledge + Grade + Enroll)
  bcoef[i,] = brg$coef

This works fine.

But now I want to extract the t tests on these coefficients. I cannot 
find how these coefficients are stored, if at all. When I try
    attributes(brg)
I do not find the t values as the attributes of the object. Typing 
summary(brg) will PRINT the coefficients, their standard errors, t, and 
the associated probability. I would like to type something like
    tcoeff[i,] = brg$tvalue
but, of course, tvalue doesn't exist.

Is there a simple way to extract, or compute if necessary, these values?

Thanks,
Dave Howell



-- 
David C. Howell
PO Box 770059
627 Meadowbrook Circle
Steamboat Springs, CO
80477



More information about the R-help mailing list