data(rats)
tmp <- rats[rats$group == "TREAT", ]
# A: glmm (model linearization)
iccbin(n, y, data = tmp, method = "A")
iccbin(n, y, data = tmp, method = "A", nAGQ = 10)
# B: glmm (Monte Carlo)
iccbin(n, y, data = tmp, method = "B")
iccbin(n, y, data = tmp, method = "B", nAGQ = 10, M = 1500)
# C: lmm (ANOVA moments)
iccbin(n, y, data = tmp, method = "C")
if (FALSE) {
# Example of confidence interval calculation with nonparametric bootstrap
require(boot)
foo <- function(X, ind) {
n <- X$n[ind]
y <- X$y[ind]
X <- data.frame(n = n, y = y)
iccbin(n = n, y = y, data = X, method = "C")@rho[1]
}
res <- boot(data = tmp[, c("n", "y")], statistic = foo, R = 500, sim = "ordinary", stype = "i")
res
boot.ci(res, conf = 0.95, type = "basic")
}
Run the code above in your browser using DataLab