Aan de slagGa gratis aan de slag

Average commute time of Americans

Each year since 2005, the US Census Bureau surveys about 3.5 million households with The American Community Survey (ACS). Data collected from the ACS have been crucial in government and policy decisions, helping to determine the allocation of federal and state funds each year. Data from the 2012 ACS is available in the acs12 dataset.

When given one argument, t.test() tests whether the population mean of its input is different than 0. That is \(H_0: \mu_{diff} = 0\) and \(H_A: \mu_{diff} \ne 0\). It also provides a 95% confidence interval.

Deze oefening maakt deel uit van de cursus

Inference for Numerical Data in R

Cursus bekijken

Oefeninstructies

  • Filter the acs12 dataset for individuals whose employment status is "employed", and save this new dataset as acs12_emp.
  • Use a t-test to construct a 95% confidence interval for the average commute time of Americans.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Filter for employed respondents
acs12_emp <- acs12 %>%
  ___

# Construct 95% CI for avg time_to_work
t.test(___)
Code bewerken en uitvoeren