200 people were tested, 20 of those were infected. I want to get a posterior distribution for the uncertainty associated with the probability that a person is infected.
I do this like this:
n<-200
s<-20
p<-seq(0,0.3,0.001)
dp<-dbeta(p, s+1, n-s+1)
But then when I plot it, I don't know how to interpret the y axis and summary results:
plot(p, dp, type="l")
> summary(dp)
Min. 1st Qu. Median Mean 3rd Qu. Max.
0.000000 0.000011 0.032438 3.322259 3.841204 18.820899
So there is a 10% chance of.....something being 18.82? Or? What does this summary tell me?
Also, what is the difference between the first plot and the plot below?
plot(density(dp))


pbeta(0.11,21,181)-pbeta(0.09,21,181)giving0.3628953or withsum(dp[p<=0.11&p>0.09])*0.001giving0.362944– Henry Nov 18 '23 at 10:20