Learn R Programming

aod (version 1.1-33)

icc: Intra-Cluster Correlation

Description

This function computes the intra-cluster correlation $\rho$ from clustered binomial data $(n, y)$, using the ML/REML and ANOVA methods.

Usage

icc(n, y, data, method = c("REML", "ML"), R = NULL)

Arguments

n
The denominator of the proportion.
y
The numerator of the proportion.
data
A data frame containing the data.
method
A character string ML (maximum likelihood) or REML (restricted ML) used in the first estimation method for $\rho$. Default to REML.
R
A scalar indicating the number of Monte Carlo (MC) replicates used to estimate the confidence interval of $\rho$ (ML/REML estimate). When R is NULL (the default value), the MC confidence interval is not computed.

Value

  • An object of formal class icc, with 7 slots:
  • CALLThe call of the function.
  • rhoA numeric vector with 2 components: REML (or ML) and ANOVA, containing the estimated values of $\rho$ according to these 2 methods.
  • varrhoA numeric scalar giving the approximate variance of $\rho$ (ML/REML estimate) estimated with the Delta method.
  • fA numeric vector with the results of the $F$ test.
  • rho.MCA numeric vector with the MC replicates of $\rho$.
  • methodA character string taking values ML or REML.
  • featuresA numeric vector with 3 components summarizing the main features of the data: N = number of clusters, n = number of subjects, y = number of cases.

Details

The function ungroups the clustered data into binary (0/1) observations $y_{ij}$ (obs. $j$ in cluster $i$). For the ML/REML method, a linear mixed-effect model is fitted: $$y_{ij} = \mu + u_i + e_{ij}$$ where $\mu$ is the general mean, $a_i$ is the random cluster effect and $e_{ij}$ is the residual error. Model assumptions are: $u \sim N(0, \sigma_u^2)$ and $e_{ij} \sim N(0, \sigma_e^2)$. The intra-cluster correlation is computed as $$\rho = \sigma_u^2 / (\sigma_u^2 + \sigma_e^2)$$ Variance components $\sigma_u^2$ and $\sigma_e^2$ (actually, vector $\nu = log(\sigma_u, \sigma_e)$) are estimated with lme (package nlme): see Pinheiro and Bates, 2000. The variance of $\rho$ is estimated with the Delta method. An $F$ test is provided to assess whether $\rho = 0$ (actually, whether $\sigma_u^2 = 0$: see Searle et al, 1992, p. 76). If the argument R is not null, a MC confidence interval of $\rho$ is computed assuming that $\nu \sim N(\nu, Var[\nu])$, where $Var[\nu]$ is the matrix apVar provided in the lme output. For the ANOVA method, see Donner (1989), Searle et al. (1992) or Zou and Donner (2004). The function assumes an homogeneous proportion $p$ across the clusters.

References

Donner, A., 1989. Statistical methods in ophthalmology: an adjusted chi-squared approach. Biometrics 45, 605-611. Pinheiro, J.C., Bates, D.M., 2000. Mixed-effects models in S and S-PLUS. Springer-Verlag, New York. Searle, S.R., Casella, G., McCulloch, C.E., 1992. Variance components. Wiley, New York. Zou, G., Donner, A., 2004. Confidence interval estimation of the intraclass correlation coefficient for binary outcome data. Biometrics 60, 807-811.

See Also

icc-class, lme icc in the contributed packages irr and psy.

Examples

Run this code
data(rats)
  icc(n, y, rats[rats$group == "CTRL", ])
  res <- icc(n, y, rats[rats$group == "TREAT", ], R = 5000)
    res
    hist(res@rho.MC)
  by(rats,
     list(group = rats$group),
     function(x) icc(n, y, data = x))

Run the code above in your browser using DataLab