# NOT RUN {
data(hmeq)
df <- rbind(Reduce(rbind,
lapply(split(hmeq, floor(hmeq$CLAGE)),
function(d) data.frame(AGE = unique(floor(d$CLAGE)),
NUM = sum(d$BAD),
DEN = nrow(d)))),
data.frame(AGE = NA,
NUM = sum(hmeq[is.na(hmeq$CLAGE), ]$BAD),
DEN = nrow(hmeq[is.na(hmeq$CLAGE), ])))
pool_bin(df$AGE, df$NUM, df$DEN, log = TRUE)
# }
Run the code above in your browser using DataLab