playbill <- read.csv("playbill.csv") plot(CurrentWeek ~ LastWeek, data = playbill, asp = 1) abline(0, 1, col = "darkgreen")
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.
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.
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
Additional questions:
Is zero in your confidence interval?
Conduct a hypothesis test that the slope is zero all the way through to the interpretation of the p-value.
Does the conclusion of the hypothesis test agree or disagree with the inference that you drew from the confidence interval.