Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Use R-Studio; Show ALL codes: Suppose researchers wish to study the effectivenes

ID: 3221243 • Letter: U

Question

Use R-Studio; Show ALL codes:

Suppose researchers wish to study the effectiveness of a new drug to alleviate hives due to math anxiety. Seven hundred math students are randomly assigned to take either this drug or a placebo. Suppose 34 of the 350 students who took the drug break out in hives compared to 56 of the 350 students who took the placebo. (a) Compute a Compute a 95% confidence interval for the proportion of students taking the drug who break out in hives. The proportion of students taking the drug who break out in hives. (b) Compute a 95% confidence interval for the proportion of students on the placebo who break out in hives. (c) Do the intervals overlap? What, if anything, can you conclude about the effectiveness of the drug? (d) Compute a 95% confidence interval for the difference in proportions of students who break out in hives by using or not using this drug and give a sentence interpreting this interval.

Explanation / Answer

a) 95% confidence interval for the proportion of student taking the drug is ( 0.06913692 0.13429260)

R-Code

> x=34
> n=350
> prop.test(x,n,conf.level = 0.95)

   1-sample proportions test with continuity
   correction

data: x out of n, null probability 0.5
X-squared = 225.6, df = 1, p-value < 2.2e-16
alternative hypothesis: true p is not equal to 0.5
95 percent confidence interval:
0.06913692 0.13429260
sample estimates:
p
0.09714286

b) The 95% confidence interval for the proportion of students on the placebo is (0.1240384 0.2036158)

R-code

> y=56
> m=350
> prop.test(y,m,conf.level = 0.95)

   1-sample proportions test with continuity
   correction

data: y out of m, null probability 0.5
X-squared = 160.48, df = 1, p-value < 2.2e-16
alternative hypothesis: true p is not equal to 0.5
95 percent confidence interval:
0.1240384 0.2036158
sample estimates:
p
0.16

c) Yes the intervals overlap, yes, we can conlude that effectiveness of the drug since the confidence interval of drug is high values than the confidence interval of placebo

d) The 95% confidence interval for the difference in proportion of students who are using drug and placebo is

R-Code:

> z=c(34,56)
> N=c(350,350)
> prop.test(z,N,conf.level = 0.95)

   2-sample test for equality of proportions
   with continuity correction

data: z out of N
X-squared = 5.623, df = 1, p-value = 0.01773
alternative hypothesis: two.sided
95 percent confidence interval:
-0.11508783 -0.01062645
sample estimates:
prop 1 prop 2
0.09714286 0.16000000

> x=34
> n=350
> prop.test(x,n,conf.level = 0.95)

   1-sample proportions test with continuity
   correction

data: x out of n, null probability 0.5
X-squared = 225.6, df = 1, p-value < 2.2e-16
alternative hypothesis: true p is not equal to 0.5
95 percent confidence interval:
0.06913692 0.13429260
sample estimates:
p
0.09714286

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Chat Now And Get Quote