- In this project, we are going to estimate the population mean \(\mu\) of miles-per-gallon.
- R has a sample called ‘mtcars’ which contains 32 cars
- Here is the formula for \(\hat{\mu}\).
\[\hat{\mu}\;=\;\frac{1}{n}\sum_{i=1}^{n}X_i\]
\[\hat{\mu}\;=\;\frac{1}{n}\sum_{i=1}^{n}X_i\]
The goal of standard error is to turn the result of 1000 means into one number.
Standard error = standard deviation of those means. \[SE \;=\; \sqrt{\frac{1}{999}\sum_{j=1}^{1000}\bigl(\hat{\mu}_j-\overline{\hat{\mu}}\bigr)^2}\;\;\;=\;\;\; \boxed{\;1.0\ \text{MPG}\;}\]
The point estimate 20.1 MPG will miss the true average by roughly 1 MPG on average
ggplot(mtcars,aes(wt,mpg))+geom_point()+geom_smooth(method="lm",se=F)
## `geom_smooth()` using formula = 'y ~ x'
20 MPG estimate is average of everything despite weight.
The downward trend in the scatter plot shows why the MPG varies so much. Heavier cars pull MPG average down and lighter cars pull the average up.
The key takeaway is that the 20.1 MPG average is still good, but doesnt reveal the whole story about car MPG.