Lab 3D
Directions: Follow along with the slides and answer the questions in red font in your journal.
atus
(American Time Use Survey) data set, which is a survey of how a sample of Americans spent their day.
What is the mean age of people older than 15 living in the United States?
atus
data to calculate an estimate for the average age of people older than 15 living in the U.S.sample()
of our original data (atus
) WITH replacement.
size
of the sample should be the same size as the original data.mean
in three steps:
slice
those rows from our original data into our bootstrap data.sample
the row numbers we’ll use in our bootstrapped sample.
set.seed(123)
before taking the sample.slice
function to create a new data set that includes each row from our sample
bs_rows
and bs_atus
.
R
how you created bs_rows
and bs_atus
. Be sure to include an explanation of what the values of bs_rows
mean and how those values are used to create bs_atus
. Also, be sure to explain what each argument of each function does.mean
of the age
variable in your bootstrapped
data, then use a different value of set.seed()
to create your own, personal bootstrapped sample. Then calculate its mean
.
do()
500 bootstrapped samples.do()
-ing 500 bootstraps easier, we’ll code our 3-step bootstrap method into a function.
mean
for our atus
data.
The lowest 5% of our estimates are below _______ years and the highest 5% of our estimates are above_______ years.