The sample statistic is the difference in proportions
We will subtract the proportion of success for the treatment group from the proportion of success for the placebo group (ALPHABETICALLY)
Sample difference in proportions: \(0.17 - 0.40 = -0.23\)
The sample difference of \(-0.23\) gets converted to a z-value: \(z = -2.08\) (R Studio will do this for us!)
This value gets evaluated in a z-distribution
R Studio
my_z <-prop_test(~Success =="yes"| Treatment, data = trial,alternative ="two.sided",correct =FALSE)
Compare Sample Difference to Null Distribution
plot_z_dist(my_z)
p-Value and Decision
Since our p-value is less than 0.05 here…we will reject the null hypothesis.
z_results(my_z)
--------------------------------------------------
2-sample test for equality of proportions without continuity correction
--------------------------------------------------
H[0]: pi_1 = pi_2
H[A]: pi_1 ≠ p1_2
z = -2.078862
p = 0.03763005
--------------------------------------------------
Conclusion
We can conclude that there is likely a difference between the success rate of the new drug compared to the placebo.
Hypothesis Testing for Comparing Two Proportions Activity
Summary
Hypothesis tests help us test a claim while taking into account sampling variability.
They provide one form of evidence to help answer a research question.
We can use a z-distribution to help us conduct our test when we have two groups to compare on a categorical attribute.