In: Statistics and Probability
Immediately after a ban on using hand-held cell phones while driving was implemented, compliance with the law was measured. A random sample of 1,250 drivers found that 98.9% were in compliance. A year after the implementation, compliance was again measured to see if compliance was the same (or not) as previously measured. A different random sample of 1,100 drivers found 96.9% compliance.
a) State an appropriate null and alternative hypothesis for testing whether or not there is any statistical difference (i.e., a two-sided test) in these two proportions measured initially and then one year later. Conduct the test of hypothesis using a significance level of α= 0.05. Be sure to check the assumptions and conditions for your test. State the P-value of your test and also state your conclusion. (Use R studio and show commands and output for using R.)
b) Develop a 95% confidence interval for the true difference in proportions between the first survey and the second survey and explain what this confidence interval means in context of this problem. (Use R studio and show commands and output for using R.)
Answer:-
Given That :-
A random sample of 1,250 drivers found that 98.9% were in compliance. A year after the implementation, compliance was again measured to see if compliance was the same (or not) as previously measured. A different random sample of 1,100 drivers found 96.9% compliance.
a) State an appropriate null and alternative hypothesis for testing whether or not there is any statistical difference (i.e., a two-sided test) in these two proportions measured initially and then one year later. Conduct the test of hypothesis using a significance level of α= 0.05.
Null and alternative hypothesis for testing whether or not there is any statistical difference (i.e., a two-sided test) in these two proportions measured initially (p1) and then one year later (p2)
p1 = 98.9% ( 1236 out of 1250 )
p2= 96.9% ( 1066 out of 1100 )
H0: p1 = p2 versus HA: p1 ≠ p2
Test of hypothesis using a significance level of α= 0.05
R-commands :
#--- Run a z test
ztest <- prop.test(c(1236,1066), n = c(1250, 1100), correct =
F)
ztest
R-outputs :
p-value of test = 0.0007
Conclusion:
Since p-value < 0.025 (significance level alpha=0.05 two tailed ) ==> Reject H0
There is highly significant statistical difference (i.e., a
two-sided test) in these two proportions measured initially (p1)
and then one year later (p2)
b) Develop a 95% confidence interval for the true difference in proportions between the first survey and the second survey and explain what this confidence interval means in context of this problem.
95% confidence interval : R output
For this example, 98.8% of initial and 96.9% of one year later.
The difference in these two proportions is 98.8% - 96.9% = 1.9% and the 95% CI for this difference is (0.79% , 3.15%).
We are 95% confident that drop in proportion after one year will be between ( 0.79% and 3.15% ).
Plz like it....,