### R code from vignette source 'meas'
### Encoding: UTF-8

###################################################
### code chunk number 1: meas.rnw:2-6
###################################################
options( width=90,
#        prompt=" ", continue=" ",
         SweaveHooks=list( fig=function()
         par(mar=c(3,3,1,1),mgp=c(3,1,0)/1.6,las=1,bty="n") ) )


###################################################
### code chunk number 2: meas.rnw:33-34
###################################################
16281/5534738


###################################################
### code chunk number 3: meas.rnw:72-77
###################################################
library( Epi )
X <- 16281
N <- 5534738
mp <- glm( cbind( X, N-X ) ~ 1, family=binomial )
round( ci.pred( mp ) * 100, 4 )


###################################################
### code chunk number 4: meas.rnw:114-115
###################################################
2648 / 150000 


###################################################
### code chunk number 5: meas.rnw:144-145
###################################################
2648/300


###################################################
### code chunk number 6: meas.rnw:184-189
###################################################
library( Epi )
D <- 2648
Y <- 300000
mm <- glm( D ~ 1, offset=log(Y), family=poisson )
round( ci.pred( mm, newdata=data.frame(Y=1000) ), 3 )


###################################################
### code chunk number 7: meas.rnw:224-227
###################################################
mr <- glm( cbind(D,Y/1000) ~ 1, family=poisreg )
round( ci.pred( mr, newdata=data.frame(x=NA) ), 3 )
round( ci.pred( mr ), 3 )


