Reference no: EM132376562
Problem -
In STATS 250 you learned how to test for differences in population proportions. To do so in R we use the command prop.test ( ). For example, if I flip one coin 30 times and see 20 heads, and a second coin 12 times and see 3 heads, then
In [7]: prop.test(x = c(20, 3), n = c(30, 12))
2-sample test for equality of proportions with continuity correction
data: c(20, 3) out of c(30, 12)
X-squared = 4.4427, df = 1, p-value = 0.03505
alternative hypothesis: two.sided
95 percent confidence interval:
0.06088074 0.77245259
sample estimates:
prop 1 prop 2
0.6666667 0.2500000
tells me that there is a significant difference in the success probabilities of the two coins at the 5% level, though not at the 1% level (p-value 0.035).
From the preceding exercise, it seems like the fraction of babies with names ending in o grew substantially in the 21st century. Check this by testing whether the proportion of such babies born between 1980 and 1999 (inclusive) is different from the proportion from the year 2000 onwards. (Hint: there were 1,594,457 born in 2000 or later whose name ends in o.)
Interpret your result. What is driving this change? How do these data support that conclusion?
Note - Attached is the same document in R if it is helpful.
Attachment:- R Programming Assignment Files.rar