Inference on Regression

Hypothesis tests and Intervals

Playbill

  • Promoter's rule of thumb: the best prediction for this weeks revenue is last weeks.
  • \(\hat{y} = x\).
  • Implies that \(\beta_0 = 0\) and \(\beta_1 = 1\).
  • Is this reasonable?

Playbill

playbill <- read.csv("playbill.csv")
plot(CurrentWeek ~ LastWeek, data = playbill, asp = 1)
abline(0, 1, col = "darkgreen")

plot of chunk unnamed-chunk-1

Hypothesis test for \(\hat{\beta}_1\)

Let's focus on the claim that the slope is 1.

\[ H_0: \beta_1^0 = 1 \\ H_A: \beta_1^0 \ne 1 \]

We know that

\[ T = \frac{\hat{\beta}_1 - \beta_1^0}{SE(\hat{\beta}_1)} \]

T will be t distributed with \(n-2\) degrees of freedom and with \(SE(\hat{\beta}_1)\) calculated the same as in the CI.

Hypothesis test for \(\hat{\beta}_1\)

m1 <- lm(CurrentWeek ~ LastWeek, data = playbill)
beta_1_null <- 1
beta_1_hat <- m1$coef[2]
SE_beta_1_hat <- summary(m1)$coef[2, 2]
t_stat <- (beta_1_hat - beta_1_null)/SE_beta_1_hat
n <- nrow(playbill)
pval <- pt(t_stat, df = n - 2) * 2
pval
## LastWeek 
##   0.2321

Our p-value is 0.2321, which is more than the standard \(\alpha = 0.05\), therefore we have no reason to reject \(H_0: \beta_1^0 = 1\). The promoters rule looks fine so far.

Inference for \(\hat{\beta}_0\)

Often less interesting (but not always!). You use the t-distribution again but with a different \(SE\).

summary(m1)$coef
##              Estimate Std. Error t value  Pr(>|t|)
## (Intercept) 6804.8860  9.929e+03  0.6853 5.029e-01
## LastWeek       0.9821  1.443e-02 68.0714 3.866e-21
summary(m1)$coef[1, 2]
## [1] 9929

Activity 4b

Additional questions:

  1. Is zero in your confidence interval?

  2. Conduct a hypothesis test that the slope is zero all the way through to the interpretation of the p-value.

  3. Does the conclusion of the hypothesis test agree or disagree with the inference that you drew from the confidence interval.