Problem 4 antimicrobial resistance amr is becoming a


Problem 4: Antimicrobial resistance (AMR) is becoming a significant problem due to overuse of antimicrobial drugs. The level of AMR can be estimated by testing isolates obtained from samples (say from retail chicken). Suppose that Y isolates test positive for AMR in N samples. A Bayesian model for the population prevalence of resistance, P, is Y |P ∼ B(N, P), combined with a uniform prior distribution on P. This implies a beta posterior distribution for P. (See the notes from Lecture 14.) Suppose, however, that the test has known sensitivity and specificity values,

πse = P(positive test result|resistant)

and

πsp = P(negative test result|not resistant).

A perfect test would have πse = πsp = 1 but this is rarely the case in practice. Let TP denote a "true positive" test result event; that is, a resistant isolate that tests positive. Let NT P denote the number of TP events in the sample.

Let FP denote a "false positive" test result, a non-resistant isolate that tests positive, and let NF P denote the number of such events. Similarly, let TN and FN denote "true negative" and "false negative" test results, and let NT N and NF N denote the number of times these events occur in the sample. Note that Y = NT P + NF P and N - Y = NT N + NF N .

4a: (2 points) Determine the conditional probabilities of the events TP, FP, TN an FN given P.

4b: (4 points) What is the distribution of NT P given P and Y ? What is the distribution of NT N given P and Y ? Hence, what is the distribution of (NT P , NT N ) given P and Y ?

4c: (4 points) What is the distribution of P given (NT P , NT N ) and Y ? Note that NT P +NF N is the true number of resistance isolates in the sample.

4d:  Based on your answers to problems to 4a-c write an R function to generate values from the posterior distribution of P given Y using a Gibbs sampler.

Mygibbs=function(N,Y,sens,spec,L)
{
6

# L=chain length

your code
return(Pchain)
}

Submit your function on CMS as Mygibbs.r.

4e: Use your function to estimate the posterior distribution of P based on Y = 30 positive test results out of N = 100 if πse = 0.9 and πsp = 0.8. Report estimates of the mean, median, and 2.5 and 97.5 percentiles of the posterior distribution.

Request for Solution File

Ask an Expert for Answer!!
English: Problem 4 antimicrobial resistance amr is becoming a
Reference No:- TGS01403987

Expected delivery within 24 Hours