Learn R Programming

aods3 (version 0.4-1.2)

iccbin: Intra-Cluster Correlation for Clustered Binomial data

Description

The function estimates the intraclass correlation \(\rho\) from clustered binomial data:

{\((n_1, m_1), (n_2, m_2), ..., (n_N, m_N)\)},

where \(n_i\) is the size of cluster \(i\), \(m_i\) the number of “successes” (proportions are \(y = m/n\)), and \(N\) 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 iccbin
print(x, ...)

Value

An object of class iccbin, printed with print.iccbin.

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 glmer of package lme4. Only for methods “A” and “B”. Default to 1.

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 \(y_{ij}\) (observation \(j\) in cluster \(i\)). The methods of calculation are described in Goldstein et al. (2002).

Methods "A" and "B" use the 1-way logistic binomial-Gaussian model

$$y_{ij} | \mu_{ij} \sim Bernoulli(\mu_{ij})$$

$$logit(\mu_{ij}) = b_0 + u_i,$$

where \(b_0\) is a constant and \(u_i\) a cluster random effect with \(u_i \sim N(0, s^2_u)\). The ML estimate of the variance component \(s^2_u\) is calculated with the function glmer of package lme4. The intra-class correlation \(\rho = Corr[y_{ij}, y_{ik}]\) is then calculated from a first-order model linearization around \(E[u_i]=0\) in method “A”, and with Monte Carlo simulations in method “B”.

Method "C" provides the common ANOVA (moment) estimate of \(\rho\). For details, see for instance Donner (1986), Searle et al. (1992) or Ukoumunne (2002).

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

Run this code
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