A single proportion/mean
October 6, 2026
Now let’s create some data to match our hypothetical example.
Use the base R head() function to see the first five rows.
Use the tail() function to see the last five rows.
Now let’s visualize it with a bar chart.
Is it possible to assess this hypothetical organization’s claim using the data and information presented thus far?
“Our jobs program is a success because only 15 of the 60 people that we trained did not have a job. Thus our 25% unemployment rate beats the country’s unemployment rate of 30%.”
Null hypothesis (\(H_0\)): “There is nothing going on.”
Unemployment rate among those in the jobs program is no different than the country average of 30%.
Alternative hypothesis (\(H_A\)): “There is something going on.”
Unemployment rate is lower than the country average of 30%.
sim1
employed unemployed
42 18
[1] 0.3
sim2
employed unemployed
41 19
[1] 0.3166667
sim3
employed unemployed
38 22
[1] 0.3666667
tidymodelsWe can use the tidymodels package to help with this process…
Response: outcome (factor)
Null Hypothesis: point
# A tibble: 2,000 × 2
replicate stat
<dbl> <dbl>
1 1 0.367
2 2 0.2
3 3 0.283
4 4 0.2
5 5 0.4
6 6 0.317
7 7 0.3
8 8 0.333
9 9 0.283
10 10 0.25
# ℹ 1,990 more rows
Where should this distribution be centered? Or, what should the mean be?
p-value–in what % of the simulations was the simulated sample proportion at least as extreme as the observed sample proportion?