Estimating the difference of two means using a t-interval
Earlier we used summary statistics and a visualization to compare the hourly pay of citizens vs. non-citizens. In this exercise we estimate the difference between the average hourly pay between these two groups.
The acs12_complete_hrlypay_citizen
is already loaded for you.
This exercise is part of the course
Inference for Numerical Data in R
Exercise instructions
- Run a t-test to find a confidence interval for the difference in average hourly pay,
hrly_pay
between citizen and non-citizens,citizen
in theacs12_complete_hrlypay_citizen
dataset. Assign totest_results
.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Construct 95% CI using a t-test
test_results <- ___
# See the results
test_results