In a comparative double-blind randomized study of single dose fosfomycin trometamol with trimethoprim in the treatment of uncomplicated urinary infections, 26 of 35 were cured with fosfomycin trometamol and 12 of 24 were cured with the reference drug trimethoprim.
Denote the eradication rates for fosfomycin trometamol and the reference drug trimethoprim by p1 and p2 respectively.
(a) Evaluate the test statistic
Z=p^1−p^2p^(1−p^)(1n1+1n2)−−−−−−−−−−−−−−−−√.
(b) Use the R function pnorm() and the value of the test statistic from (a) to find the p-value for the test H0:p1=p2 versus HA:p1≠p2.
(d) Find the p-value for the test H0:p1=p2 versus HA:p1≠p2 using the R function prop.test()
(f) Calculate a 97% two-sided confidence interval for the
difference p1−p2 using the R function prop.test(). The interval
ranges from _____
to _____.
.
p1 = 26/35 #p1(hat)
p2 = 12/24 #p2(hat)
p = 0.6441 #p(hat)
n1 = 35
n2 = 24
z = (p1-p2)/sqrt(p*(1-p)*((1/n1)+(1/n2)))
z
OUTPUT Z= 1.91392
-----------------------------------------------------------------------------------------------------------
b) pnorm(-z)
2*pnorm(-z) #p-value for two tailed test
Output = 0.05563033
-----------------------------------------------------------------------------------------------------------
d) prop.test(38,59, p = NULL,alternative = c("two.sided"),conf.level = 0.97, correct = TRUE)
p-value = 0.03725
-----------------------------------------------------------------------------------------------------------
f) 97 percent confidence interval:
0.4943414 0.7712156
Get Answers For Free
Most questions answered within 1 hours.