Hang out with the TAs from STA 199! This is a casual conversation and a fun opportunity to meet the members of the STA 199 teaching team. The only rule is these can’t turn into office hours!
Tea with a TA counts as a statistics experience.
🍁 Happy STA 199 Fall break! 🍁
Let’s watch the experiment from Mythbusters.
We’ll use simulation-based inference to assess the claim that yawning is contagious, i.e.
\[H_0: p_t = p_c \\ H_a: p_t > p_c\]
We will simulate the null distribution using playing cards and permutation!
A regular deck of cards is comprised of 52 cards:
Take out two aces from the deck of cards and set them aside.
Take out Jokers if you have them.
The remaining 50 playing cards to represent each participant in the study:
Shuffle the 50 cards at least 7 times2 to ensure that the cards counted out are from a random process.
Count out the top 16 cards and set them aside. These cards represent the people in the control group. Count the number of face cards. This represents the number of people who yawned in the control group.
Out of the remaining 34 cards (treatment group) count the number of face cards. This represents the number of people who yawned in the treatment group.
Calculate the difference in proportions of yawners, \(\hat{p}_{treatment} - \hat{p}_{control}\).
Click here to report the difference you find.
If you finish early, repeat steps 1 - 5 to run the simulation again!
Have one group member share their screen so you can do the simulation as a group.
Your selections should look like this:
Under “Step 4”, click Draw cards.
You will see page with 16 randomly drawn cards. Your page will be similar to the one here:
In my example, there are 3 face cards in the control group.
In my example, there are 11 (14 - 3) face cards in the treatment group.
Calculate the difference in proportions of yawners, \(\hat{p}_{treatment} - \hat{p}_{control}\).
Click here to report the difference you find.
Repeat steps 1 - 5 to run the simulation again! Run the simulation at least 3 times.
library(usethis)
use_git_config(user.name= "your github username", user.email="your email")
library(tidyverse)
library(infer)
Remove eval = F
from the code chunk header to see your simulation results!
sim_data <- read_csv("https://sta199-fa20-002.netlify.app/appex/data/yawn-sim.csv")
ggplot(data = sim_data, mapping = aes(x = diff_in_prop)) +
geom_histogram(binwidth = 0.05) +
labs(title = "Your Results: Difference in Proportion of Yawners")
What is the approximate center of the distribution? Is this what you expected? Why or why not?
The observed difference in proportions from the Mythbusters episode is 0.0441. Based on your simulated distribution, is there evidence that yawning is contagious?
Let’s use the data from the Mythbusters episode. Based on their experiment, is there evidence that yawning is contagious?
Evaluate this question using a simulation based approach. State the null and alternative hypotheses, the p-value, and conclusion in the context of the research problem.
# yawn data from Mythbusters
yawn <- read_csv("https://sta199-fa20-002.netlify.app/appex/data/yawn.csv")
Suppose we want to evaluate whether the proportion of yawners in the treatment group is equal to the proportion of yawners in the control group, i.e. if yawning and seeing someone yawn are independent.
Use a confidence interval to evaluate this claim. Construct the confidence interval using a simulation-based method.
Simulation activity from Data science in a box↩︎
In Shuffling Cards, 7 Is Winning Number by Gina Kolata↩︎