Question: Hi would you be able to help me with this please? I am struggling with the R and Bayesian Inference. Here is the link to
Hi would you be able to help me with this please? I am struggling with the R and Bayesian Inference.
Here is the link to the RSA survey. https://www.rsa.ie/Documents/Road%20Safety/A%20Survey%20of%20Driver%20Attitudes%20and%20Behaviour/A%20Survey%20of%20Driver%20Attitudes%20and%20Behaviour.pdf

Exercise 2 Getting around Galway can be hazardous; and people using their phone while driving is a growing concern. Here you will carry out a full Bayesian analysis of the probability that people use their phone while driving. You may nd the R code contained in the lecture slides to be useful as you complete this practical. 1. You are interested in the proportion H of people who use their phone while driving Start by creating a suitable prior distribution for I9. The following survey may be useful. Have a lool at latest REA. survey [check the summary], which surveyed l people and found that 42 use their phone while driving 'at least sometimes\" a. Use the Learnayes package to determine the values for a and E for the Beta prior you would like to use. \"iat would you choose for the Beta prior parameters as a prior for the proportion H of people who use their phone while driving? It should be based on some prior data |e.g. any other mobile phone use data you can find online], your belief or a combination of both. b. Give a justication for your choice and plot your prior using the code above. 2. New update your Beta prior with the data observed in the REA survey using Bayes rule to nd the posterior probability distribution 311:3 |x]. 3. Compare the prior and posterior distributions using the triglot function in the LearnBages package [see the R code that accompanied the lectures]. 4. Calculate the Posterior mean for H. 5. Calculate a 95% Credible Interval for H and interpret the result carefully. 6. The RSA will launch a new initiative if the probability of drivers using their phone exceeds 50%. Find the probability that 50% of drivers use their phone from your posterior distribution. The gheta function in R will be useful here
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
