In: Statistics and Probability
Comparing two proportions The following table gives the records of accidents in 1998 compiled by the Department of Highway Safety and Motor Vehicles in Florida. Injury Safety Equipment in Use Fatal Nonfatal None 1601 162,527 Seat belt 510 412,368 Denote the number of accidents and fatalities when no safety equipment was in use by nN and yN, respectively. Similarly, let nS and yS denote the number of accidents and fatalities when a seat belt was in use. Assume that yN and yS are independent with yN distributed as binomial(nN, pN) and yS distributed as binomial(nS, pS). Assume a uniform prior is placed on the vector of probabilities (pN, pS). a) Show that pN and pS have independent beta posterior distributions. b) Use the function rbeta to simulate 1000 values from the joint posterior distribution of (pN, pS). c) Using your sample, construct a histogram of the relative risk pN/pS. Find a 95% interval estimate of this relative risk. d) Construct a histogram of the difference in risks pN − pS.