X^2 / lambda_bar treated as chi-square_{k-1}, with lambda_bar the
mean generalized design effect: trace-based when the covariance V
of the estimated proportions is supplied, or the paper's cell-deff
estimate sum_i (1 - p0_i) d_i/(k - 1). If V = c P0 (uniform
clustering), every eigenvalue is c and X^2/c is exactly
chi-square_{k-1}.
Usage
morie_raoscot(p_hat, p0, n, V = NULL, deffs = NULL)
Arguments
- p_hat
Estimated cell proportions (sum to 1).
- p0
Hypothesized positive proportions (sum to 1).
- n
Sample size.
- V
Optional n * covariance matrix of p_hat.
- deffs
Optional positive cell design effects.
Value
A list with elements statistic, corrected,
lambda_bar, df, p_value, method.
References
Rao, J. N. K. and Scott, A. J. (1981). The analysis of
categorical data from complex sample surveys. JASA, 76(374),
221-230.
Examples
morie_raoscot(p_hat = c(0.3, 0.3, 0.4), p0 = c(1, 1, 1) / 3, n = 500, deffs = c(1.5, 1.4, 1.6))[c("statistic", "corrected", "p_value")]
#> $statistic
#> [1] 10
#>
#> $corrected
#> [1] 6.666667
#>
#> $p_value
#> [1] 0.03567399
#>