raoscott {aod} | R Documentation |
Test of Proportion Homogeneity using Rao and Scott's Adjustment
Description
Tests the homogeneity of proportions between groups (H0:
) from clustered binomial
data
using the adjusted
statistic proposed by Rao and Scott (1993).
Usage
raoscott(formula = NULL, response = NULL, weights = NULL,
group = NULL, data, pooled = FALSE, deff = NULL)
Arguments
formula |
An optional formula where the left-hand side is either a matrix of the form |
response |
An optional argument: either a matrix of the form |
weights |
An optional argument used when the left-hand side of |
group |
An optional argument only used when |
data |
A data frame containing the response ( |
pooled |
Logical indicating if a pooled design effect is estimated over the |
deff |
A numerical vector of |
Details
The method is based on the concepts of design effect and effective sample size.
The design effect in each group is estimated by
, where
is
the variance of the ratio estimate of the probability in group
(Cochran, 1999, p. 32 and p. 66)
and
is the standard binomial variance. A pooled design effect (i.e., over the
groups)
is estimated if argument
pooled = TRUE
(see Rao and Scott, 1993, Eq. 6). Fixed design effects can be specified
with the argument deff
.
The are used to compute the effective sample sizes
, the effective numbers
of successes
in each group
, and the overall effective proportion
.
The test statistic is obtained by substituting these quantities in the usual
statistic,
yielding:
which is compared to a distribution with
degrees of freedom.
Value
An object of formal class “drs”: see drs-class
for details. The slot tab
provides the proportion of successes, the variances of the proportion and the design effect for each group.
Author(s)
Matthieu Lesnoff matthieu.lesnoff@cirad.fr, Renaud Lancelot renaud.lancelot@cirad.fr
References
Cochran, W.G., 1999, 2nd ed. Sampling techniques. John Wiley & Sons, New York.
Rao, J.N.K., Scott, A.J., 1992. A simple method for the analysis of clustered binary data.
Biometrics 48, 577-585.
See Also
chisq.test
, donner
, iccbin
, drs-class
Examples
data(rats)
# deff by group
raoscott(cbind(y, n - y) ~ group, data = rats)
raoscott(y/n ~ group, weights = n, data = rats)
raoscott(response = cbind(y, n - y), group = group, data = rats)
raoscott(response = y/n, weights = n, group = group, data = rats)
# pooled deff
raoscott(cbind(y, n - y) ~ group, data = rats, pooled = TRUE)
# standard test
raoscott(cbind(y, n - y) ~ group, data = rats, deff = c(1, 1))
data(antibio)
raoscott(cbind(y, n - y) ~ treatment, data = antibio)