Tests for homogeneity of odds ratios across strata in \(2 \times 2 \times k\)
tables (i.e., whether a common odds ratio fits all strata). Generalized to handle tables
of any dimensionality beyond 3. For 4-dimensional tables, optionally provides a two-way
decomposition of the homogeneity test into row effects, column effects, and residual,
analogous to woolf_test() with decompose = TRUE.
breslow_day_test(x, OR = NA, correct = FALSE, decompose = FALSE)# S3 method for breslow_day_test
print(x, digits = 4, ...)
A list of class "breslow_day_test" (also inheriting from "htest")
containing:
the chi-squared test statistic.
degrees of freedom.
\(p\)-value.
character string describing the test.
character string giving the name of the data.
names of the first two dimensions (the 2x2 table variables).
names of the stratifying variables (dimensions 3 and beyond).
the common odds ratio used (MH estimate if OR = NA was supplied).
logical indicating whether Tarone correction was applied.
observed \(a_j\) counts (cell \([1,1]\) of each stratum).
expected \(\tilde{a}_j\) counts under the common OR.
logical indicating if decomposition was performed.
When decompose = TRUE (only for 4-dimensional tables), additional components:
list with statistic, df, p.value for row effects.
list with statistic, df, p.value for column effects.
list with statistic, df, p.value for residual (interaction).
An object of class "breslow_day_test"
The common odds ratio to test against. If NA (the default), the
Mantel-Haenszel estimate is used.
Logical. If TRUE, the Tarone (1985) correction is applied.
Defaults to FALSE.
Logical. If TRUE and x is 4-dimensional
(a \(2 \times 2 \times R \times C\) table), the test is
decomposed into row effects, column effects, and residual. Defaults to FALSE.
Ignored for non-4-dimensional tables.
Number of significant digits for the common OR. Default 4.
Additional arguments (currently unused).
Andri Signorell, Michael Friendly (enhancements)
The Breslow-Day test (Breslow & Day, 1980) tests the hypothesis that a common odds ratio \(\psi\) fits all \(k\) strata. Given a common OR (by default the Mantel-Haenszel estimate), the expected cell count \(\tilde{a}_j\) in cell \([1,1]\) of stratum \(j\) is found by solving the quadratic:
$$(\psi - 1)\tilde{a}_j^2 - [n_{2j} - m_{1j} + \psi(n_{1j} + m_{1j})]\tilde{a}_j + \psi \, m_{1j} n_{1j} = 0$$
where \(m_{1j}\) and \(m_{2j}\) are the row margins and \(n_{1j}\) and \(n_{2j}\) are the column margins of stratum \(j\). The test statistic is:
$$\chi^2_{BD} = \sum_{j=1}^{k} \frac{(a_j - \tilde{a}_j)^2}{\widehat{\text{Var}}(a_j)}$$
where \(\widehat{\text{Var}}(a_j) = (1/\tilde{a}_j + 1/\tilde{b}_j + 1/\tilde{c}_j + 1/\tilde{d}_j)^{-1}\) and \(\tilde{b}_j, \tilde{c}_j, \tilde{d}_j\) are the remaining expected cell counts. Under the null hypothesis, \(\chi^2_{BD}\) follows a chi-squared distribution with \(k - 1\) degrees of freedom.
The Tarone (1985) correction subtracts a term to account for estimation of the common OR:
$$\chi^2_{BD,T} = \chi^2_{BD} - \frac{(\sum_j a_j - \sum_j \tilde{a}_j)^2}{\sum_j \widehat{\text{Var}}(a_j)}$$
Comparison with the Woolf test: The Woolf test uses log odds ratios and tests deviation from their weighted mean, whereas the Breslow-Day test works on the cell-count scale against a specified common OR. For large samples they agree closely; Breslow-Day is generally preferred when the Mantel-Haenszel common OR is the quantity of interest.
Decomposition for 4-way tables:
For a \(2 \times 2 \times R \times C\) table, when decompose = TRUE, the overall
test is decomposed as:
$$\chi^2_{\text{Total}} = \chi^2_{\text{Rows}} + \chi^2_{\text{Cols}} + \chi^2_{\text{Residual}}$$
where the row and column components use the row- and column-marginal (pooled) tables, all tested against the same common OR as the overall test. The residual is defined by subtraction and has \((R-1)(C-1)\) degrees of freedom.
Breslow, N. E. & Day, N. E. (1980). Statistical Methods in Cancer Research. Vol. 1: The Analysis of Case-Control Studies. IARC Scientific Publications No. 32. Lyon: International Agency for Research on Cancer.
Tarone, R. E. (1985). On heterogeneity tests based on efficient scores. Biometrika, 72, 91-95.
Lachin, J. M. (2000). Biostatistical Methods: The Assessment of Relative Risks. Wiley, p. 124-125.
stats::mantelhaen.test(), woolf_test(), DescTools::BreslowDayTest()
Other association tests:
CMHtest(),
GKgamma(),
HLtest(),
woolf_test(),
zero.test()
# 3-way table
data(CoalMiners, package = "vcd")
breslow_day_test(CoalMiners)
breslow_day_test(CoalMiners, correct = TRUE) # Tarone correction
# Compare with Woolf test
woolf_test(CoalMiners)
data(Heart, package = "vcdExtra")
breslow_day_test(Heart)
# 4-way table without decomposition
data(Fungicide, package = "vcdExtra")
breslow_day_test(Fungicide)
# 4-way table with decomposition
breslow_day_test(Fungicide, decompose = TRUE)
Run the code above in your browser using DataLab