donner.RdTests the homogeneity of proportions between \(I\) groups (H0: \(p_1 = p_2 = ... = p_I\) ) from clustered binomial data \((n, y)\) using the adjusted \(\chi^2\) statistic proposed by Donner (1989).
donner(formula = NULL, response = NULL,
weights = NULL, group = NULL, data, C = NULL)An optional formula where the left-hand side is either a matrix of the form cbind(y, n-y), where
the modelled probability is y/n, or a vector of proportions to be modelled (y/n). In both cases, the
right-hand side must specify a single grouping variable. When the left-hand side of the formula is a vector of
proportions, the argument weight must be used to indicate the denominators of the proportions.
An optional argument indicating either a matrix of the form cbind(y, n-y), where the modelled
probability is y/n, or a vector of proportions to be modelled (y/n).
An optional argument used when the left-hand side of formula or response is a vector
of proportions: weight is the denominator of the proportion.
An optional argument only used when response is used. In this case, this argument is a factor
indicating a grouping variable.
A data frame containing the response (n and y) and the grouping variable.
If not NULL, a numerical vector of \(I\) cluster correction factors.
The \(\chi^2\) statistic is adjusted with the correction factor \(C_i\)
computed in each group \(i\). The test statistic is given by:
$$X^2 = \sum_{i}\frac{(y_i - n_i * p)^2}{C_i * n_i * p * (1 - p)}$$
where \(C_i = 1 + (nA_i - 1) * \rho\), \(nA_i\) 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^2\)
distribution with \(I - 1\) degrees of freedom. Fixed correction factors can be specified
with the argument C.
An object of formal class “drs”: see drs-class for details. The slot tab
provides the proportion of successes and the correction factor for each group.
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.
data(rats)
donner(formula = cbind(y, n - y) ~ group, data = rats)
#>
#> Test of proportion homogeneity (Donner, 1989)
#> ---------------------------------------------
#> donner(formula = cbind(y, n - y) ~ group, data = rats)
#> N = 32 clusters, n = 303 subjects, y = 254 cases, I = 2 groups.
#>
#> Data and correction factors:
#> group N n y p C
#> 1 CTRL 16 158 142 0.8987 3.350
#> 2 TREAT 16 145 112 0.7724 3.115
#>
#> Intra-cluster correlation (anova estimate): 0.2506
#>
#> Adjusted chi-squared test:
#> X2 = 2.8, df = 1, P(> X2) = 0.0966
donner(formula = y/n ~ group, weights = n, data = rats)
#>
#> Test of proportion homogeneity (Donner, 1989)
#> ---------------------------------------------
#> donner(formula = y/n ~ group, weights = n, data = rats)
#> N = 32 clusters, n = 303 subjects, y = 254 cases, I = 2 groups.
#>
#> Data and correction factors:
#> group N n y p C
#> 1 CTRL 16 158 142 0.8987 3.350
#> 2 TREAT 16 145 112 0.7724 3.115
#>
#> Intra-cluster correlation (anova estimate): 0.2506
#>
#> Adjusted chi-squared test:
#> X2 = 2.8, df = 1, P(> X2) = 0.0966
donner(response = cbind(y, n - y), group = group, data = rats)
#>
#> Test of proportion homogeneity (Donner, 1989)
#> ---------------------------------------------
#> donner(response = cbind(y, n - y), group = group, data = rats)
#> N = 32 clusters, n = 303 subjects, y = 254 cases, I = 2 groups.
#>
#> Data and correction factors:
#> group N n y p C
#> 1 CTRL 16 158 142 0.8987 3.350
#> 2 TREAT 16 145 112 0.7724 3.115
#>
#> Intra-cluster correlation (anova estimate): 0.2506
#>
#> Adjusted chi-squared test:
#> X2 = 2.8, df = 1, P(> X2) = 0.0966
donner(response = y/n, weights = n, group = group, data = rats)
#>
#> Test of proportion homogeneity (Donner, 1989)
#> ---------------------------------------------
#> donner(response = y/n, weights = n, group = group, data = rats)
#> N = 32 clusters, n = 303 subjects, y = 254 cases, I = 2 groups.
#>
#> Data and correction factors:
#> group N n y p C
#> 1 CTRL 16 158 142 0.8987 3.350
#> 2 TREAT 16 145 112 0.7724 3.115
#>
#> Intra-cluster correlation (anova estimate): 0.2506
#>
#> Adjusted chi-squared test:
#> X2 = 2.8, df = 1, P(> X2) = 0.0966
# standard test
donner(cbind(y, n - y) ~ group, data = rats, C = c(1, 1))
#>
#> Test of proportion homogeneity (Donner, 1989)
#> ---------------------------------------------
#> donner(formula = cbind(y, n - y) ~ group, data = rats, C = c(1,
#> 1))
#> N = 32 clusters, n = 303 subjects, y = 254 cases, I = 2 groups.
#>
#> Data and correction factors:
#> group N n y p C
#> 1 CTRL 16 158 142 0.8987 1
#> 2 TREAT 16 145 112 0.7724 1
#>
#> Intra-cluster correlation (anova estimate): 0.2506
#>
#> Adjusted chi-squared test:
#> X2 = 8.9, df = 1, P(> X2) = 0.0029
data(antibio)
donner(cbind(y, n - y) ~ treatment, data = antibio)
#>
#> Test of proportion homogeneity (Donner, 1989)
#> ---------------------------------------------
#> donner(formula = cbind(y, n - y) ~ treatment, data = antibio)
#> N = 24 clusters, n = 542 subjects, y = 67 cases, I = 4 groups.
#>
#> Data and correction factors:
#> treatment N n y p C
#> 1 1 7 144 18 0.12500 2.030
#> 2 2 6 129 8 0.06202 1.982
#> 3 3 5 130 24 0.18462 2.224
#> 4 4 6 139 17 0.12230 2.129
#>
#> Intra-cluster correlation (anova estimate): 0.0439
#>
#> Adjusted chi-squared test:
#> X2 = 4.3, df = 3, P(> X2) = 0.2318