iccbin {aods3} | R Documentation |
Intra-Cluster Correlation for Clustered Binomial data
Description
The function estimates the intraclass correlation from clustered binomial data:
{},
where is the size of cluster
,
the number of “successes” (proportions are
), and
the number of clusters. The function uses a one-way random effect model. Three estimates, corresponding to methods referred to as “A”, “B” and “C” in Goldstein et al. (2002), can be returned.
Usage
iccbin(n, m, method = c("A", "B", "C"), nAGQ = 1, M = 1000)
## S3 method for class 'iccbin'
print(x, ...)
Arguments
n |
A vector of the sizes of the clusters. |
m |
A vector of the numbers of successes (proportions are eqny = m / n). |
method |
A character (“A”, “B” or “C”) defining the calculation method. See Details. |
nAGQ |
Same as in function |
M |
Number of Monte Carlo (MC) replicates used in method “B”. Default to 1000. |
x |
An object of class “iccbin”. |
... |
Further arguments to ba passed to “print”. |
Details
Before computations, the clustered data are split to binary “0/1” observations (observation
in cluster
). The methods of calculation are described in Goldstein et al. (2002).
Methods "A" and "B" use the 1-way logistic binomial-Gaussian model
where is a constant and
a cluster random effect with
. The ML estimate of the variance component
is calculated with the function
glmer
of package lme4. The intra-class correlation is then calculated from a first-order model linearization around
in method “A”, and with Monte Carlo simulations in method “B”.
Method "C" provides the common ANOVA (moment) estimate of . For details, see for instance Donner (1986), Searle et al. (1992) or Ukoumunne (2002).
Value
An object of class iccbin
, printed with print.iccbin
.
References
Donner A., 1986, A review of inference procedures for the intraclass correlation coefficient in the one-way random effects model. International Statistical Review 54, 67-82.
Searle, S.R., Casella, G., McCulloch, C.E., 1992. Variance components. Wiley, New York.
Ukoumunne, O. C., 2002. A comparison of confidence interval methods for the intraclass correlation coefficient in cluster randomized trials. Statistics in Medicine 21, 3757-3774.
Golstein, H., Browne, H., Rasbash, J., 2002. Partitioning variation in multilevel models. Understanding Statistics 1(4), 223-231.
See Also
Examples
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")
## Not run:
# 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")
## End(Not run)