Skip to content
Prev 205629 / 398506 Next

Extract p-value from linear model

On 07-Jan-10 14:15:07, Trafim Vanishek wrote:
summary(lm(a~(b+0)))
  # [...]
  # Coefficients:
  #   Estimate Std. Error t value Pr(>|t|)    
  # b  0.90777    0.07134   12.72 4.67e-07 ***
  # ---

  summary(lm(a~(b+0)))$coef[,4]
  # [1] 4.665795e-07
summary(lm(a~b))
  # [...]
  # Coefficients:
  #             Estimate Std. Error t value Pr(>|t|)   
  # (Intercept)   7.7957     2.1661   3.599  0.00699 **
  # b            -0.6230     0.4279  -1.456  0.18351   
  # ---

  summary(lm(a~b))$coef[,4]
  # (Intercept)           b 
  # 0.006992306 0.183511560 

Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding at manchester.ac.uk>
Fax-to-email: +44 (0)870 094 0861
Date: 07-Jan-10                                       Time: 14:39:46
------------------------------ XFMail ------------------------------