For example, the following R code performs a linear regression:
set.seed(123)
x <- 1:40
y <- rnorm(40)+((x-20)/10)^2
fit.linear <- lm(y~x)
summary(fit.linear)
and outputs:
Call:
lm(formula = y ~ x)
Residuals:
Min 1Q Median 3Q Max
-3.2849 -1.2145 -0.2076 1.4374 3.2221
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 1.200322 0.533666 2.249 0.0304 *
x 0.008774 0.022684 0.387 0.7011
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 1.656 on 38 degrees of freedom
Multiple R-squared: 0.003922, Adjusted R-squared: -0.02229
F-statistic: 0.1496 on 1 and 38 DF, p-value: 0.7011
How are the t-values for the intercept as well as the coefficient of x computed?
I see that each t-value is equal to the his estimate of the coefficient divided by its standard error. But how is the standard error computed?