Displaying 2 results from an estimated 2 matches for "l_cl_exact".
2012 Mar 07
2
, Exact Confidence Interval
...90) # generating data using Binomial Logit Normal
> p<-exp(eta)/(1+exp(eta))
> for(i in 1:k)
> x<-cbind(x,rbinom(10,n,p[i]))
>
> rate<-t(t(x)/n)
>
> # Exact Confidence Interval
>
> for (i in 1:10){
>
> for (j in 1:63)
> {
>
> if (x==0)
> {
> l_cl_exact<-0
> u_cl_exact<-qbeta(.975,x+1,n-x)
> }
> else if (x==n)
> {
> l_cl_exact<-qbeta(.025,x,n-x+1)
> u_cl_exact<-1
> }
> else
> l_cl_exact<-qbeta(.025,x,n-x+1)
> u_cl_exact<-qbeta(.975,x+1,n-x)
>
> }
> }__________________________________________...
2012 Mar 09
2
qbeta function in R
...imple code I am using:
k<-3
> x<-NULL
> p<-rbeta(k,3,3)# so that the mean nausea rate is alpha/(alpha+beta)
> min<-10
> max<-60
> n<-as.integer(runif(3,min,max))
> for(i in 1:k)
+ x<-cbind(x,rbinom(5,n[i],p[i]))
>
> # Exact Confidence Interval
>
> l_cl_exact<-qbeta(.025, x, n-x+1)
Warning message:
In qbeta(p, shape1, shape2, lower.tail, log.p) : NaNs produced
> u_cl_exact<-qbeta(.975, x+1, n-x)
Warning message:
In qbeta(p, shape1, shape2, lower.tail, log.p) : NaNs produced
> x
[,1] [,2] [,3]
[1,] 8 12 14
[2,] 5 15 13
[3,]...