[R] Format regression result summary
Thiemo Fetzer
tf at devmag.net
Fri Apr 11 18:05:34 CEST 2008
Hello to the whole group.
I am a newbie to R, but I got my way through and think it is a lot easier to
handle than other software packages (far less clicks necessary).
However, I have a problem with respect to the summary of regression results.
The summary function gives sth like:
Residuals:
Min 1Q Median 3Q Max
-0.46743 -0.09772 0.01810 0.11175 0.42252
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 3.750367 0.172345 21.761 < 2e-16 ***
Var1 -0.002334 0.009342 -0.250 0.802948
Var2 0.012551 0.005927 2.117 0.035444 *
Var3 0.015380 0.074537 0.206 0.836730
Var3 0.098602 0.026448 3.728 0.000250 ***
...
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 0.1614 on 202 degrees of freedom
Multiple R-squared: 0.1983, Adjusted R-squared: 0.1506
F-statistic: 4.163 on 12 and 202 DF, p-value: 7.759e-06
However, my wish is the output to have a format like:
Estimate
(Intercept) 3.750367***
(0.172345)
Var1 -0.002334
(0.009342)
Var2 0.012551*
(0.005927)
Etc. so that the standard errors are in parantheses below the estimates.
Next to the estimates should be the * indicating significance.
I thought that should go by accessing the elements in the summary object,
yet, I got started and figured that is quite complicated.
Is there a quick and dirty way?
Basically I want the same print-out as the summary, except that I don't want
the t-statistic and not the p-value, only the significance codes.
Thanks a lot in advance
Thiemo
More information about the R-help
mailing list