Skip to contents

One-way random-effects decomposition: with the unequal-size correction n0 = (N - sum n_i^2 / N) / (a - 1), the between-cluster variance is (MSB - MSW)/n0 and rho = var_a / (var_a + MSW). Kish's design effect follows as DEFF = 1 + (nbar - 1) rho. rho can come out negative when within-cluster spread exceeds between; that is reported as computed rather than clipped, because clipping hides a badly specified clustering.

Usage

morie_icc_rho(y, cluster)

Arguments

y

response, one value per unit.

cluster

cluster label per unit.

Value

list: rho, deff, msb, msw, n0, var_between, n_clusters, n_obs, cluster_sizes, mean_cluster_size, effective_n, method.

References

Kish, L. (1965), Survey Sampling, Wiley, sec. 5.4. Cross-checked against ICCbare in the ICC package.

Examples

morie_icc_rho(c(1, 1, 1, 5, 5, 5, 9, 9, 9), c(0, 0, 0, 1, 1, 1, 2, 2, 2))$rho
#> [1] 1