Lab 2E
Directions: Follow along with the slides and answer the questions in red font in your journal.
data
function to load the slasher
data file.
Male
or Female
.Dies
or Survives
.survival
status to each observation. Compare the resulting table to the one you wrote down.do()
function to shuffle our data many times and see how often our actual difference occurred by chance.do
, tally
and shuffle
functions to shuffle
the survival
variable and tally
the proportion of women who survived 500 times. Assign
your 500 shuffles the name shuffles
View
your shuffled data and explain what the rows and each column represents.shuffles
, what is the difference between proportion of females who survived and the proportion of males who survived?mutate
function.
Survives.Female
and Survives.Male
to our shuffles
data.histogram
of the difference
s in our shuffles
data. Based on your plot, answer the following
gender
play a role in whether or not a character will survive in a horror film? Explain your reasoning.survival
label, we made it so that the proportion of males and females who survived the slasher film was random.
gender
variable instead of the survival
variable.
set.seed(1)
before your 500 simulations to make your answer reproducible.gender
variable instead of the survival
variable change your answer to the question Does gender
play a role in whether or not a character will survive in a horror film?