Displaying 1 result from an estimated 1 matches for "lowsp".
Did you mean:
lows
2012 Jan 05
2
Bayesian estimate of prevalence with an imperfect test
...revalence_estimation.R/
(the folllowing code has been cut and pasted directly from the web resource
- the only change I have made is to fill in my values for T, n, low/high
se/sp and the alpha beta for the distributions)
prevalence.bayes<-function(theta,T,n,lowse=0.5,highse=1.0,
sea=1,seb=1,lowsp=0.5,highsp=1.0,spa=1,spb=1,ngrid=20,coverage=0.95) {
ibeta<-function(x,a,b) {
pbeta(x,a,b)*beta(a,b)
}
ntheta<-length(theta)
bin.width<-(theta[ntheta]-theta[1])/(ntheta-1)
theta<-theta[1]+bin.width*(0:(ntheta-1))
integrand<-array(0,c(ntheta,ngrid,ngrid))...