Skip to contents

Fitting a stratum effect per table costs a parameter per table, and with sparse tables the maximum-likelihood estimate is badly biased – the classic Neyman-Scott problem. The Mantel-Haenszel weights step around it: they stay consistent both when the strata are few and large and when they are many and small, which no likelihood-based weighting achieves at once.

Usage

Mhors(tables, confidence = 0.95)

Arguments

tables

Matrix or data frame with one stratum per row and four columns a, b, c, d: exposed cases, exposed non-cases, unexposed cases, unexposed non-cases.

confidence

Confidence level.

Value

List with measure, estimate, se, ci_lower, ci_upper, n, n_strata.

Details

Formula: OR_MH = sum(a_k d_k/n_k) / sum(b_k c_k/n_k). The variance of its logarithm is the Robins-Breslow-Greenland expression P/(2 S^2) + Q/(2 S T) + R/(2 T^2) with P = sum (a+d) a d / n^2, \(Q = sum ((a+d) b c + (b+c) a d) / n^2\), R = sum (b+c) b c / n^2, S = sum a d / n, T = sum b c / n.

References

Mantel, N. and Haenszel, W. (1959). Journal of the National Cancer Institute 22(4):719-748. doi:10.1093/jnci/22.4.719 . Robins, J., Breslow, N. and Greenland, S. (1986). Biometrics 42(2):311-323. doi:10.2307/2531052 .

Examples

tables <- rbind(c(a = 10, b = 20, c = 5, d = 25), c(a = 8, b = 12, c = 6, d = 24))
Mhors(tables)[c("estimate", "ci_lower", "ci_upper")]
#> $estimate
#> [1] 2.577253
#> 
#> $ci_lower
#> [1] 1.068716
#> 
#> $ci_upper
#> [1] 6.215154
#>