Lecture 25
Duke University
STA 199 - Fall 2026
December 2, 2025
Give feedback!
Take 2 minutes to fill out the TA evaluation form – link in your email! Due Monday, December 8th.
Nominate a TA for the StatSci TA of the Year award by sending an email to dus@stat.duke.edu with a brief narrative for your nomination.
Please also fill out the course evaluation (on DukeHub) as well, I’d love to your feedback!
![]() Allison Yang |
![]() Anric Ngan |
![]() Carl Emerson |
![]() Chelsea Nguyen |
![]() Ethan Cho |
![]() Helen Chen |
![]() Hellen Han |
![]() Hyunjin Lee |
![]() Josh Lim |
![]() Juan Pablo L. Escamilla |
![]() Kenna Roberts |
![]() Max Niu |
![]() Oliver Gao |
![]() Robbie Hao |
![]() Sophie Schwartz |
![]() Tally Coulter |
![]() Yasmine Abdel-Rahman |
Most likely to win in Vegas
Best team name
R reports a p-value of 0. What’s the best interpretation?

Go to wooclap.com and use the code KLELKIE.
Which conclusion is best supported by this hypothesis test?

Go to wooclap.com and use the code KLELKIE.
In Example 1 (screen time and sleep), the p-value was about 0.23, so we fail to reject \(H_0\). What does that mean?

Go to wooclap.com and use the code KLELKIE.
A study investigating sex discrimination in the 1970s was set in the context of personnel decisions within a bank. The research question we hope to answer is, “Are individuals who identify as female discriminated against in promotion decisions made by their managers who identify as male?”
This study considered sex roles, and only allowed for options of “male” and “female”. The identities being considered are not gender identities and the study allowed only for a binary classification of sex.
Participants: 48 bank supervisors who identified as male, attending a management institute at the University of North Carolina in 1972
Task: Assume the role of the personnel director of a bank and judge whether a candidate should be promoted to a branch manager position based on personnel files they were randomly assigned
Personnel files: Identical except that half of them indicated the candidate identified as male and the other half indicated the candidate identified as female
Variables: sex (male or female), decision (promoted or not promoted)
Which of the following is the correct null hypothesis for this study?

Go to wooclap.com and use the code KLELKIE.
Which of the following is the correct alternative hypothesis for this study?

Go to wooclap.com and use the code KLELKIE.
p = Proportion of candidates promoted
Null hypothesis: Sex and promotion decision are independent, i.e., males and females are equally likely to be promoted.
\[ p_{Male} = p_{Female} \]
Alternative hypothesis: Sex and promotion decision are dependent, i.e., males and females are not equally likely to be promoted.
\[ p_{Male} \ne p_{Female} \]
# A tibble: 2 × 5
sex promoted `not promoted` total p_prmtd
<fct> <int> <int> <int> <dbl>
1 male 21 3 24 0.875
2 female 14 10 24 0.583
Observed difference in promotion rates
(male - female)
= 0.875 - 0.583
= 0.292
Response: decision (factor)
Explanatory: sex (factor)
Null Hypothesis: indepe...
# A tibble: 10,000 × 2
replicate stat
<int> <dbl>
1 1 -0.208
2 2 0.125
3 3 -0.0417
4 4 -0.0417
5 5 0.125
6 6 -0.125
7 7 -0.0417
8 8 -0.0417
9 9 -0.0417
10 10 -0.0417
# ℹ 9,990 more rows
With a p-value smaller than 0.05, we reject the null hypothesis and conclude that the data provide convincing evidence of a discernible difference between the male and female promotion rate, i.e., sex discrimination in promotion decisions.
What is the probability of getting an outcome \(\ge\) 4 when rolling a 6-sided die? What is the probability when rolling a 12-sided die?

Go to wooclap.com and use the code KLELKIE.
You’re playing a game where you win if the die roll is \(\ge\) 4. If you could get your pick, which die would you prefer to play this game with?
I have two dice: one 6-sided, the other 12-sided.
We’re going to play a game where I’m going to call them die A and die B, and you won’t know which one is which.
You pick die A or B, I roll it, and I tell you if you win or not, where winning is getting a number \(\ge\) 4. If you win, you get a piece of candy. If you lose, I get to keep the candy.
We’ll play this multiple times with different contestants.
I will not swap die A and B at any point.
We’ll record which die each contestant picks and whether they won or lost.
The ultimate goal is to come to a class consensus about whether A or B is the good die.
You get to pick how long you want to keep playing, but remember, each time you guess wrong, you lose a piece of candy (so there is a cost associated with too many tries). If you make the wrong decision, you lose all the candy.
Sampling isn’t free!
At each trial you risk losing pieces of candy if you lose (the die comes up \(<\) 4). Too many trials means you won’t have much candy left. And if we spend too much class time and we may not get through all the material.
You have no idea if I have chosen A to be the good die (12-sided) or bad die (6-sided). Then, before we collect any data, what is your best guess for A is the good die and B is the bad die?

Go to wooclap.com and use the code KLELKIE.
These are your prior probabilities for the two competing claims (hypotheses):
That is, these probabilities represent what you believe before seeing any data.
You could have conceivably made up these probabilities, but instead you have chosen to make an educated guess.
What is your decision?
How did you make this decision?
What is the probability, based on the outcome of the {first} roll, that A is the good die (and B is the bad die)?
Scenario 1: A, won

Contestant picked A and won.
\[ \begin{aligned} &P(\text{A good} \mid \text{win}) \\ &= \frac{P(\text{A good and win})}{P(\text{win})} \\ &= \frac{0.375}{0.375 + 0.250} \\ &= 0.6 \end{aligned} \]
Winning with A makes us more confident that A is the good die: 0.5 \(\rightarrow\) 0.6.
Scenario 2: A, lost

Contestant picked A and lost.
\[ \begin{aligned} &P(\text{A good} \mid \text{lose}) \\ &= \frac{P(\text{A good and lose})}{P(\text{lose})} \\ &= \frac{0.125}{0.125 + 0.250} \\ &\approx 0.333 \end{aligned} \]
Losing with A makes us less confident that A is the good die: 0.5 \(\rightarrow\) 0.333.
Scenario 3: B, won

Contestant picked B and won.
\[ \begin{aligned} &P(\text{A good} \mid \text{win}) \\ &= \frac{P(\text{A good and win})}{P(\text{win})} \\ &= \frac{0.250}{0.250 + 0.375} \\ &= 0.4 \end{aligned} \]
Winning with B makes us less confident that A is the good die: 0.5 \(\rightarrow\) 0.4.
Scenario 4: B, lost

Contestant picked B and lost.
\[ \begin{aligned} &P(\text{A good} \mid \text{lose}) \\ &= \frac{P(\text{A good and lose})}{P(\text{lose})} \\ &= \frac{0.250}{0.250 + 0.125} \\ &\approx 0.667 \end{aligned} \]
Losing with B makes us more confident that A is the good die: 0.5 \(\rightarrow\) 0.667.
\[ {P(A~is~good~|~outcome~of~1^{st}~roll)} \]
is also called the posterior probability.
Posterior probability is generally defined as P(hypothesis \(|\) data). It tells us the probability of a hypothesis we set forth, given the data we just observed. It depends on both the prior probability we set and the observed data.
This is different than a p-value (a Frequentist concept) which is roughly P(data \(|\) hypothesis).
In the next iteration (roll) we get to take advantage of what we learned from the data.
In other words, we update our prior with our posterior.
Take advantage of prior information, like a previously published study or a physical model.
Naturally integrate data as you collect it, and update your priors.
Avoid the counter-intuitive Frequentist definition of a p-value as the P(observed or more extreme outcome \(|\) \(H_0\) is true). Instead base decisions on the posterior probability, P(hypothesis is true \(|\) observed data).
Watch out! A good prior helps, a bad prior hurts, but the prior matters less the more data you have.
More advanced Bayesian techniques offer flexibility not present in Frequentist models.