data(rats)
z <- rats[rats$group == "TREAT", ]
# A: glmm (model linearization)
iccbin(z$n, z$m, method = "A")
iccbin(z$n, z$m, method = "A", nAGQ = 10)
# B: glmm (Monte Carlo)
iccbin(z$n, z$m, method = "B")
iccbin(z$n, z$m, method = "B", nAGQ = 10, M = 1500)
# C: lmm (ANOVA moments)
iccbin(z$n, z$m, method = "C")
if (FALSE) {
# Example of CI calculation with nonparametric bootstrap
require(boot)
foo <- function(X, ind) {
n <- X$n[ind]
m <- X$m[ind]
iccbin(n = n, m = m, method = "C")$rho
}
res <- boot(data = z[, c("n", "m")], 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