library(tidyverse)
library(tidymodels)
library(knitr)
<- read_csv("data/ncaa-football-exp.csv") football
AE 03: Inference
NCAA Football Expenditures
Go to the course GitHub organization and locate your ae-03 repo to get started.
Render, commit, and push your responses to GitHub by the end of class to submit your AE.
Set up
Data
Regression model
<- lm(total_exp_m ~ enrollment_th + type, data = football)
exp_fit
tidy(exp_fit)|>
kable(digits = 3)
term | estimate | std.error | statistic | p.value |
---|---|---|---|---|
(Intercept) | 19.332 | 2.984 | 6.478 | 0 |
enrollment_th | 0.780 | 0.110 | 7.074 | 0 |
typePublic | -13.226 | 3.153 | -4.195 | 0 |
Hypothesis test
We want to conduct a hypothesis test to determine if there is a linear relationship between enrollment and football expenditures after accounting for institution type.
We’ll start by getting estimates for statistics we’ll need for inference.
Exercise 1
We will use the vector of responses
Get
Exercise 2
Next, let’s calculate
Exercise 3
Now we’re ready to conduct the hypothesis test between enrollment and football expenditures. State the null and alternative hypotheses in words and using mathematical notation.
Exercise 4
Calculate
Exercise 5
Now we need to calculate p-value to help make our final conclusion.
State the distribution used to calculate the p-value.
Fill in the code below to calculate the p-value. Remove
#| eval: false
once you’ve filled in the code.
2 * pt([test-statistic], [df], lower.tail = FALSE)
Exercise 6
State your conclusion in the context of the data. Use a threshold of
To submit the AE:
Render the document to produce the PDF with all of your work from today’s class.
Push all your work to your AE repo on GitHub. You’re done! 🎉