[R] how to improve summary.lm

Oliver Kullmann O.Kullmann at swansea.ac.uk
Sun Aug 21 09:16:58 CEST 2011


Hello,

I need a shorter summary.lm, instead of
--------------------------------------------
Call:
lm(formula = E$t ~ E$cfs)

Residuals:
       Min        1Q    Median        3Q       Max 
-0.239674 -0.007694  0.006430  0.014330  2.496551 

Coefficients:
              Estimate Std. Error t value Pr(>|t|)    
(Intercept) -1.994e-02  1.419e-04  -140.5   <2e-16 ***
E$cfs        1.675e-05  4.714e-09  3552.7   <2e-16 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 

Residual standard error: 0.03238 on 65268 degrees of freedom
Multiple R-squared: 0.9949,     Adjusted R-squared: 0.9949 
F-statistic: 1.262e+07 on 1 and 65268 DF,  p-value: < 2.2e-16 
--------------------------------------------

I need

--------------------------------------------
lm(formula = E$t ~ E$cfs)
              Estimate Std. Error t value Pr(>|t|)          
(Intercept) -1.994e-02  1.419e-04  -140.5   <2e-16 ***
E$cfs        1.675e-05  4.714e-09  3552.7   <2e-16 ***
Multiple R-squared: 0.9949,     Adjusted R-squared: 0.9949      
--------------------------------------------

I looked at the code of summary.lm, with the intention
to copy parts of it into a new function "short_sum_lm",
but couldn't find the parts I'm interested in.

I hope it's not too complicated to achieve that.
(In general it would be great to have more influence
on the summary-function -- typically it's too spacious.)

Thanks for your attention

Oliver



More information about the R-help mailing list