Question: Write a R script: 5. Is there a weekly cyclical component to the numbers of daily births, similar to what McFarlane et al. (2019) described

Write a R script:

5. Is there a weekly cyclical component to the numbers of daily births, similar to what McFarlane et al. (2019) described as "a regular weekly cycle with the numbers of births each day increasing from Mondays to Fridays, with lower numbers of births on Saturdays and the lowest numbers of births on Sundays"? It is possible that by "averaging" the observed proportion of daily births on a given day (in a given year) with those of the 6 days following it, the assumption of discrete uniform distribution becomes more tenable, albeit for aggregate weekly births,, since the data are "smoothed" (Nunnikhoven, 1992). Verify that this is indeed the case by plotting the "smoothed" weekly birth frequencies in a given year, or aggregated over M years. As in (4), the annual weekly births distribution is a multinomial distribution with the 52 weeks of the year as multinomial categories, with corresponding probabilities 3 P1, . .. , Pig given by TE Pj = 365 , for f = 1, . .. , 51, Pe = P(a birth occurs on week () j-72-6 = 365 Pj =: 365 , for { = 52. 7 358 To determine if the observed weekly births distribution is statistically significantly different from the assumed discrete "uniform" annual weekly births distribu- tion", with Pe = 7/365, for { = 1, ... . 51, and P:2 = 8/365, carry out a goodness-of-fit test of the latter to see how well it fits the former. This can be done using the R function chisq.test(x = x.wk, p = c(rep(7/365, times = 51), 8/365), on data x.wk, the 52 x 1 vector containing the weekly numbers of births in each of the M years or aggregated over the M years

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!