Question 1
> library(faraway)
> data(savings)
> head(savings)
sr pop15 pop75 dpi ddpi
Australia 11.43 29.35 2.87 2329.68 2.87
Austria 12.07 23.32 4.41 1507.99 3.93
Belgium 13.17 23.80 4.43 2108.47 3.82
Bolivia 5.75 41.89 1.67 189.13 0.22
Brazil 12.88 42.19 0.83 728.47 4.56
Canada 8.79 31.72 2.85 2982.88 2.43 |
Let’s say I want to test the significance of pop15 on sr in the above dataset. I can use anova or lm commands in R. Here is what I will do
> fit <- lm(sr ~ pop15 + pop75 + dpi + ddpi, savings)
> fit.sum <- summary(fit)
> fit1 <- lm(sr ~ pop15 + pop75 + dpi + ddpi, savings)
> fit2 <- lm(sr ~ pop75 + dpi + ddpi, savings)
> anova(fit1, fit2)
Analysis of Variance Table
Model 1: sr ~ pop15 + pop75 + dpi + ddpi
Model 2: sr ~ pop75 + dpi + ddpi
Res.Df RSS Df Sum of Sq F Pr(>F)
1 45 650.71
2 46 797.72 -1 -147.01 10.167 0.002603 **
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
> fit.sum
Call:
lm(formula = sr ~ pop15 + pop75 + dpi + ddpi, data = savings)
Residuals:
Min 1Q Median 3Q Max
-8.2422 -2.6857 -0.2488 2.4280 9.7509
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 28.5660865 7.3545161 3.884 0.000334 ***
pop15 -0.4611931 0.1446422 -3.189 0.002603 **
pop75 -1.6914977 1.0835989 -1.561 0.125530
dpi -0.0003369 0.0009311 -0.362 0.719173
ddpi 0.4096949 0.1961971 2.088 0.042471 *
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Residual standard error: 3.803 on 45 degrees of freedom
Multiple R-squared: 0.3385, Adjusted R-squared: 0.2797
F-statistic: 5.756 on 4 and 45 DF, p-value: 0.0007904 |
Ideally t value is sqrt of F value. Why is the t value for pop15 , -sqrt(F) value ? Note that p value matches!!
WHY ?