Learn R Programming

aods3 (version 0.4-1.2)

drs: Test of Proportion Homogeneity between Groups using Donner's and Rao-Scott's Adjustments

Description

The function tests the homogeneity of probabilities between \(J\) groups (H_0: \(\mu_1 = \mu_2 = ... = \mu_J\)) from clustered binomial data {\((n_1, m_1), (n_2, m_2), ..., (n_N, m_N)\)}, where \(n_i\) is the size of cluster \(i\), \(m_i\) the number of “successes” (proportions are \(y = m/n\)), and \(N\) the number of clusters. The function uses adjusted chi-squared statistics, with either the correction proposed by proposed by Donner (1989) or the correction proposed by Rao and Scott (1993).

Usage

drs(formula, data, type = c("d", "rs"), C = NULL, pooled = FALSE)
  
  # S3 method for drs
print(x, ...)

Value

An object of class drs, printed with print.drs.

Arguments

formula

An formula where the left-hand side is a matrix of the form cbind(m, n-m) (the modelled proportion is \(m / n\)). The right-hand side must specify a single grouping variable.

type

A character string: either “d” for the Donner's test and “rs” for the Rao and Scott's test.

data

A data frame containing n, m) and the grouping variable.

C

An optional vector of a priori \(J\) cluster correction factors used for the Donner's test or design effects factors used for the Rao-Scott's test. If C is set no NULL (default), it is calculated internally (see details).

pooled

Logical indicating if a pooled design effect is estimated over the \(J\) groups for the Rao-Scott's test (see details). Default to FALSE.

x

An object of class “drf”.

...

Further arguments to be passed to print.

Details

Donner's test
The chi-squared statistic is adjusted with the correction factor \(C_j\) computed in each group \(j\). The test statistic is given by:

$$X^2 = \sum_{j} ( (m_j - n_j * \mu)^2 / (C_j * n_j * \mu * (1 - \mu)) )$$

where \(\mu = \sum_{j} (m_j) / \sum_{j} (n_j)\) and \(C_j = 1 + (n_{A,j} - 1) * \rho\). \(n_{A,j}\) is a scalar depending on the cluster sizes, and \(\rho\) is the ANOVA estimate of the intra-cluster correlation assumed common across groups (see Donner, 1989 or Donner et al., 1994). The statistic is compared to a chi-squared distribution with \(J - 1\) degrees of freedom. Fixed correction factors \(C_j\) can be specified with the argument C.

Rao ans Scott's test
The method uses design effects and “effective” sample sizes. The design effect \(C_j\) in each group \(j\) is estimated by \(C_j = v_{ratio,j} / v_{bin,j}\), where \(v_{ratio,j}\) is the variance of the ratio estimate of the probability in group \(i\) (Cochran, 1999, p. 32 and p. 66) and \(v_{bin,j}\) is the standard binomial variance. The \(C_j\) are used to compute the effective sample sizes \(n_{adj,j} = n_j / C_j\), the effective numbers of successes \(m_{adj,j} = m_j / C_j\) in each group \(j\), and the overall effective proportion \(mu_adj = \sum_{j} m_{adj,j} / \sum_{j} C_j\). The test statistic is obtained by substituting these quantities in the usual chi-squared statistic, yielding:

$$X^2 = \sum_{j} ( (m_{adj,j} - n_{adj,j} * muadj)^2 / (n_{adj,j} * muadj * (1 - muadj)) )$$

which is compared to a chi-squared distribution with \(J - 1\) degrees of freedom.
A pooled design effect over the \(J\) groups is estimated if argument pooled = TRUE (see Rao and Scott, 1993, Eq. 6). Fixed design effects \(C_j\) can be specified with the argument C.

References

Donner, A., 1989. Statistical methods in ophthalmology: an adjusted chi-squared approach. Biometrics 45, 605-611.
Donner, A., 1993. The comparison of proportions in the presence of litter effects. Prev. Vet. Med. 18, 17-26.
Donner, A., Eliasziw, M., Klar, N., 1994. A comparison of methods for testing homogeneity of proportions in teratologic studies. Stat. Med. 13, 1253-1264.

See Also

Examples

Run this code
data(dja)
# Donner
drs(formula = cbind(m, n - m) ~ group, data = dja, type = "d")
# Rao and Scott
drs(formula = cbind(m, n - m) ~ group, type = "rs", data = dja)
drs(formula = cbind(m, n - m) ~ group, type = "rs", data = dja, pooled = TRUE)
# standard chi2 test
drs(formula = cbind(m, n - m) ~ group, data = dja, type = "d", C = c(1:1))
drs(formula = cbind(m, n - m) ~ group, data = dja, type = "rs", C = c(1:1))

Run the code above in your browser using DataLab