The Horror Movie Shuffle

Lab 2E

Directions: Follow along with the slides, completing the questions in blue on your computer, and answering the questions in red in your journal.

Space, Click, Right Arrow or swipe left to move to the next slide.

Playing with permutations

Initial thoughts…

Tally whoa … !

tally(~gender | survival, data = slasher, margin = TRUE)
tally(~survival | gender, data = slasher, margin = TRUE)
tally(~survival | gender, format = "percent", data = slasher, margin = TRUE)
##           gender
## survival      Female      Male
##   Dies      77.47748  86.69202
##   Survives  22.52252  13.30798
##   Total    100.00000 100.00000

Examining differences

Do the shuffle!

tally(~survival | gender, data = slasher)
tally(~shuffle(survival) | gender, 
      data = slasher)

Let’s compare …

Detecting differences

set.seed(7)
shuffled_outcomes <- do(10) * tally(~shuffle(survival) | gender, 
                                    format = "percent", 
                                    data = slasher)
View(shuffled_outcomes)

Now what?

shuffled_outcomes <- mutate(shuffled_outcomes, 
            diff = ____ - ____)

Time to decide

add_line(vline = 22.52252 - 13.30798)

Summary

On your own