Write down the R solutions of the following questions.
Two types of medication for COVID-19 are being tested to determine if there is a difference in the percentage of adult patient reactions. 20 out of a random sample of 200 adults given Medication_A still had COVID-19 30 minutes after taking the medication. 12 out of another random sample of 200 adults given Medication_B still had COVID-19 30 minutes after taking the medication. Test the equality of proportions at a 1% level of significance.
"x_a=20"
"n_a=200"
"x_b=12"
"n_b=200"
"\\alpha=0.01"
"H0:P_a=P_b"
"Ha:P_a\\ne P_b"
The following R code can be used (with continuity correction).
> prop.test(x=c(20,12),n=c(200,200),conf.level = .99)
The results are;
2-sample test for equality of proportions with continuity correction
data: c(20, 12) out of c(200, 200)
X-squared = 1.6644, df = 1, p-value = 0.197
alternative hypothesis: two.sided
99 percent confidence interval:
-0.03469035 0.11469035
sample estimates:
prop 1 prop 2
0.10 0.06
The p-value is 0.197 which is greater than 0.01. Thus, we fail to reject the null hypothesis and conclude that that there is no significant difference between the two proportions.
Comments
Leave a comment