Let's start with the Davis dataset from car package and fit a simple regression model
data(Davis)
mod.davis <- lm(weight ~ repwt, data = Davis)
summary(mod.davis)
Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept) 5.3363 3.0369 1.757 0.0806 .
repwt 0.9278 0.0453 20.484 <2e-16 ***
Now I'd like to test \begin{align*} \beta_0 &= 5 \\ \beta_1 &= 1 \end{align*}
linearHypothesis(mod.davis, c("(Intercept) = 5", "repwt = 1"))
what I get is
Res.Df RSS Df Sum of Sq F Pr(>F)
1 183 16549
2 181 12828 2 3721 26.251 9.764e-11 ***
The low p-value is quite puzzling for me
confint(mod.davis)
2.5 % 97.5 %
(Intercept) -0.6560394 11.328560
repwt 0.8384665 1.017219
especially because of the fact, that for \begin{align*} \beta_0 &= 0 \\ \beta_1 &= 1 \end{align*}
linearHypothesis(mod.davis, c("(Intercept) = 0", "repwt = 1"))
Res.Df RSS Df Sum of Sq F Pr(>F)
1 183 13074
2 181 12828 2 245.97 1.7353 0.1793
the data suggests that $H_0$ is true. How is that? $\beta_0 = 5.33$ is the mean of the sampling distribution, so I'd expect a p-value $< 0.05$ rather for testing for $\beta_0=0$.



with(Davis, plot(repwt, weight, xlim = c(0, 130), ylim = c(0, 5*130))); abline(c(1, 5))How plausible is this hypothesis?? – whuber Dec 05 '23 at 20:42abline(5,1)and then it doesn't look particularly wrong. I get the fact that the CI for the intercept is quite wide, but still it isn't clear to me why testing for "the most probable" value of the intercept yields to such a small p-value. – Adam Bogdański Dec 05 '23 at 21:03linearHypothesis(mod.davis, "(Intercept) = 5") # p = 0.912linearHypothesis(mod.davis, "repwt = 1") #p = 0.113linearHypothesis(mod.davis, "repwt = 0.93") #p = 0.96Considering the low SE for the parameter estimate of repwt, p = 0.113 for the first test makes sense.
– Peter Flom Dec 05 '23 at 22:51