[R] Definition of t-value

Achim Zeileis Achim.Zeileis at wu-wien.ac.at
Sat Jan 13 21:11:37 CET 2007

On Sat, 13 Jan 2007 algorithms at gmx.de wrote:

> My problem is that I do not know how to compute the standard error Sb of some regression coefficient, when I have done nothing more than to use the lm command in this manner:
> Out = lm(A~ data$B + data$C + data$D)

better make that
  Out <- lm(A ~ B + C + D, data = mydata)
and then
computes the usual t statistics. See the source code for what is exactly
computed. Several components of the summary also have their own extractor
function, e.g.
extract the estimated coefficients and covariance matrix respectively.
Thus, you can compute the t statistics by hand via
  coef(Out) / sqrt(diag(vcov(Out)))


More information about the R-help mailing list