here is part a and b, i need part c,d,e please! in R.
2. A Mixture Prior for Heart Transplant Surgeries A hospital in the United States wants to evaluate their success rate of heart transplant surgeries. We observe the number of deaths, 3;, in a number of heart transplant surgeries. Let y ~ P0lS(V/\\) where A is the rate of deaths/ patient and u is the exposure (total number of heart transplant patients). When measuring rare events with low rates, maximum likelihood estimation can be notoriously bad. We'll tak a Bayesian approach. To construct your prior distribution you talk to two experts. The rst expert thinks that p10) with a gamma(3, 2000) density is a reasonable prior. The second expert thinks that 1320) with a gamma(7, 1000) density is a reasonable prior distribution. You decide that each expert is equally credible so you combine their prior distributions into a mixture prior with equal weights: p(z\\) = 0.5 a: p100 + 0.5 an: p20) 23.. What does each expert think the mean rate is, a prior??? Which expert is more condent about the value of A a priori (i.e. before seeing any data)? The rst experts mean rate a priori is A = W360, which seems to be more condent since he gave a lower rate of deaths/ patients and over a larger amount of total heart transplant patients. Whereas the second experts mean rate a priori is A = , which is more than 4 times the rate of deaths/patient when there are half the amount of total heart transplant patients. 2b. Plot the mixture prior distribution. 2c. Suppose the hospital has 1; = 8 deaths with an exposure of V = 1767 surgeries performed. Write the posterior distribution up to a proportionality constant by multiplying the likelihood and the prior density. Warning: be very careful about what constitutes a proportionality constant in this example. 2d. Let K = f L(A;y)p()\\)d/\\ be the integral of the proportional posterior. Then the proper posterior density, i.e. a true density integrates to 1: can be expressed as p(/\\ l y) = W. Compute this posterior density and clearly express the density as a mixture of two gamma distributions. Type your answer here, replacing this text. 29. Plot the posterior distribution. Add vertical lines clearly indicating the prior means from each expert. Also add a vertical line for the maximum likelihood estimate