# use this code chunk to call in all packages the document will need
library(tidyverse)
library(ssstats)R Lab: Two Sample Medians
Since the late 1960s, Scooby-Doo has been delighting audiences with a mix of spooky mysteries and goofy comedy. The show follows four friends (Fred, Daphne, Velma, and Shaggy) and their talking Great Dane, Scooby-Doo, as they drive around in the Mystery Machine solving ghostly cases. Each episode usually starts with a creepy setting and some sort of “monster,” but by the end, the gang unmasks the villain to reveal it was just someone in disguise. Scooby and Shaggy are always the most scared, but with the promise of Scooby Snacks, they somehow find the courage to help crack the case.
1. One foggy night, the Mystery Machine crew arrived at another spooky mansion. Per usual, Scooby and Shaggy trembled with fear before they even made it through the front door. Velma, hoping to calm them down so they can actually help investigate, handed over a fresh stash of Scooby Snacks. The team decides to measure Shaggy and Scooby’s fright levels (0–100) both before (before) and after (after) the snacks during a series of haunted room encounters. Sometimes the snacks help a little and sometimes they help a lot – unfortunately, the data fail the normality check.
Let’s now use the appropriate hypothesis test to determine if Scooby Snacks reliably reduce fright, based on our sample from the latest spooky mansion (scooby_fright).
- Hypotheses:
- H_0: \
- H_1: \
- Test Statistic and p-Value
- T_0 =, p =
- Rejection Region
- Reject H_0 if p < \alpha; \alpha =
- Conclusion and interpretation
- Reject or Fail to reject H_0 (p \text{ vs } \alpha \to). There is or is not sufficient evidence to suggest (the alternative hypothesis in words, not math).
2. After making it through the spooky mansion, Velma unveils two snack formulas for the next night’s investigation: Regular Scooby Snacks and a new Deluxe Scooby Snacks recipe. To keep things fair, each haunted room encounter is randomly assigned one snack type (snack; Regular or Deluxe) and the team records a single outcome per encounter: the calming effect (calming; how many points the fright level drops during the encounter). Unfortunately, the calming effects do not appear to follow a normal distribution.
Let’s now use the appropriate hypothesis test to determine if the Deluxe snacks have an increased calming affect, based on our sample from the latest spooky mansion (scooby_calm).
- Hypotheses:
- H_0: \
- H_1: \
- Test Statistic and p-Value
- T_0 =, p =
- Rejection Region
- Reject H_0 if p < \alpha; \alpha =
- Conclusion and interpretation
- Reject or Fail to reject H_0 (p \text{ vs } \alpha \to). There is or is not sufficient evidence to suggest (the alternative hypothesis in words, not math).