Re: [R] Definition of t-value

From: Achim Zeileis <Achim.Zeileis_at_wu-wien.ac.at>
Date: Sat 13 Jan 2007 - 20:11:37 GMT


On Sat, 13 Jan 2007 algorithms@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
  summary(Out)
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.
  coef(Out)
  vcov(Out)
extract the estimated coefficients and covariance matrix respectively. Thus, you can compute the t statistics by hand via   coef(Out) / sqrt(diag(vcov(Out)))

hth,
Z



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sun Jan 14 07:13:13 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sat 13 Jan 2007 - 20:30:38 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.