Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

deff

Design Effect and Intra-cluster Correlation


Description

Computes the Kish design effect and corresponding intra-cluster correlation for a single cluster-sampled variable

Usage

deff(y, cluster)

Arguments

y

variable to analyze

cluster

a variable whose unique values indicate cluster membership. Any type of variable is allowed.

Value

a vector with named elements n (total number of non-missing observations), clusters (number of clusters after deleting missing data), rho(intra-cluster correlation), and deff (design effect).

Author(s)

Frank Harrell
Department of Biostatistics
Vanderbilt University
fh@fharrell.com

See Also

Examples

set.seed(1)
blood.pressure <- rnorm(1000, 120, 15)
clinic <- sample(letters, 1000, replace=TRUE)
deff(blood.pressure, clinic)

Hmisc

Harrell Miscellaneous

v4.5-0
GPL (>= 2)
Authors
Frank E Harrell Jr <fh@fharrell.com>, with contributions from Charles Dupont and many others.
Initial release
2021-02-27

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.