Stratified 2x2 tables
stratified_2x2_tables(n, alpha = 0.05)
NULL. This function should be called for its printed output
# Smoking and lung cancer (Doll and Hill, 1950)
stratified_2x2_tables(doll_hill_1950)
#> The stratum-specific effect estimates
#> -------------------------------------
#>
#> The difference between probabilities
#> Stratum #1: deltahat_1 = 0.4409 (95% Wald CI 0.3446 to 0.5371)
#> Stratum #2: deltahat_2 = 0.2217 (95% Wald CI 0.0455 to 0.3978)
#>
#> The ratio of probabilities
#> Stratum #1: phihat_1 = 7.3928 (95% Wald CI 1.9390 to 28.1869)
#> Stratum #2: phihat_2 = 1.5950 (95% Wald CI 1.0627 to 2.3939)
#>
#> The odds ratio
#> Stratum #1: thetahat_1 = 14.0426 (95% Wald CI 3.3253 to 59.3008)
#> Stratum #2: thetahat_2 = 2.4662 (95% Wald CI 1.1723 to 5.1882)
#>
#> Estimating a common difference between probabilities
#> ----------------------------------------------------
#> The Mantel-Haenszel estimate = 0.3294
#> The inverse variance estimate = 0.3905
#>
#> Estimating a common ratio of probabilities
#> ------------------------------------------
#> The Mantel-Haenszel estimate = 2.4751
#> The inverse variance estimate = 1.8151
#>
#> Estimating a common odds ratio
#> ------------------------------
#> The Mantel-Haenszel estimate = 4.5239
#> The inverse variance estimate = 3.5563
#> The Peto OR estimate = 3.7120
#>
#> Tests of homogeneity of the difference between probabilities
#> ============================================================
#> Test P-value (test statistic)
#> -------------------------------------------------
#> Likelihood ratio 0.0393 (T = 4.248, df = 1)
#> Pearson chi-squared 0.0449 (T = 4.021, df = 1)
#> -------------------------------------------------
#>
#> Tests of homogeneity of the ratio of probabilities
#> ================================================
#> Test P-value (test statistic)
#> -------------------------------------------------
#> Likelihood ratio 0.0057 (T = 7.634, df = 1)
#> Pearson chi-squared 0.0107 (T = 6.516, df = 1)
#> -------------------------------------------------
#>
#> Tests of homogeneity of odds ratios
#> ===================================
#> Test P-value (test statistic)
#> -------------------------------------------------------------
#> Likelihood ratio 0.0166 (T = 5.737, df = 1)
#> Pearson chi-squared 0.0247 (T = 5.044, df = 1)
#> Peto 0.0930 (T = 2.822, df = 1)
#> -------------------------------------------------------------
#>
#> Tests and CIs for a common difference between probabilities
#> ===========================================================
#> Test P-value (test statistic)
#> -------------------------------------------------
#> Likelihood ratio 0.0000 (T = 31.251, df = 1)
#> Pearson chi-squared 0.0000 (T = 29.409, df = 1)
#> Wald (MH) 0.0000 (Z = 6.374)
#> Wald (IV) 0.0000 (Z = 9.062)
#> -------------------------------------------------
#> Interval method estimate 95% CI
#> -------------------------------------------------
#> Wald (MH) 0.3294 0.2281 to 0.4307
#> Wald (IV) 0.3905 0.3060 to 0.4749
#> Maximum likelihood 0.3569 0.2527 to 0.4611
#> -------------------------------------------------
#>
#> Tests and CIs for a common ratio of probabilities
#> =================================================
#> Test P-value (test statistic)
#> -------------------------------------------------
#> Likelihood ratio 0.0000 (T = 23.210, df = 1)
#> Pearson chi-squared 0.0000 (T = 22.400, df = 1)
#> Wald (MH) 0.0001 (Z = 3.975)
#> Wald (IV) 0.0026 (Z = 3.007)
#> -------------------------------------------------
#> Interval method estimate 95% CI
#> -------------------------------------------------
#> Wald (MH) 2.4751 1.5831 to 3.8698
#> Wald (IV) 1.8151 1.2307 to 2.6770
#> Maximum likelihood 2.1894 1.4919 to 3.2130
#> -------------------------------------------------
#>
#> Tests and CIs for a common odds ratio
#> =====================================
#> Test P-value (test statistic)
#> -----------------------------------------------------
#> Likelihood ratio 0.0000 (T = 26.217, df = 1)
#> Pearson chi-squared 0.0000 (T = 25.101, df = 1)
#> Cochran-Mantel-Haenszel 0.0000 (T = 1.000, df = 24.92)
#> RBG 0.0000 (Z = 4.533)
#> Woolf 0.0002 (Z = 3.763)
#> -----------------------------------------------------
#> Interval method estimate 95% CI
#> -------------------------------------------------
#> RBG (MH) 4.5239 2.3556 to 8.6880
#> Woolf (IV) 3.5563 1.8365 to 6.8866
#> Maximum likelihood 4.2549 2.3478 to 7.7112
#> -------------------------------------------------
# Prophylactice use of Lidocaine in myocardial infarction (Hine et al., 1989)
stratified_2x2_tables(hine_1989)
#> The stratum-specific effect estimates
#> -------------------------------------
#>
#> The difference between probabilities
#> Stratum #1: deltahat_1 = 0.0280 (95% Wald CI -0.0546 to 0.1106)
#> Stratum #2: deltahat_2 = 0.0000 (95% Wald CI -0.1201 to 0.1201)
#> Stratum #3: deltahat_3 = 0.0197 (95% Wald CI -0.0362 to 0.0756)
#> Stratum #4: deltahat_4 = 0.0180 (95% Wald CI -0.0467 to 0.0827)
#> Stratum #5: deltahat_5 = 0.0353 (95% Wald CI -0.0201 to 0.0908)
#> Stratum #6: deltahat_6 = 0.0440 (95% Wald CI -0.0045 to 0.0926)
#>
#> The ratio of probabilities
#> Stratum #1: phihat_1 = 2.2051 (95% Wald CI 0.2080 to 23.3779)
#> Stratum #2: phihat_2 = 1.0000 (95% Wald CI 0.2668 to 3.7487)
#> Stratum #3: phihat_3 = 1.5421 (95% Wald CI 0.4477 to 5.3120)
#> Stratum #4: phihat_4 = 1.3592 (95% Wald CI 0.4461 to 4.1416)
#> Stratum #5: phihat_5 = 2.2485 (95% Wald CI 0.5971 to 8.4671)
#> Stratum #6: phihat_6 = 2.6071 (95% Wald CI 0.8492 to 8.0045)
#>
#> The odds ratio
#> Stratum #1: thetahat_1 = 2.2703 (95% Wald CI 0.1977 to 26.0676)
#> Stratum #2: thetahat_2 = 1.0000 (95% Wald CI 0.2337 to 4.2783)
#> Stratum #3: thetahat_3 = 1.5743 (95% Wald CI 0.4315 to 5.7429)
#> Stratum #4: thetahat_4 = 1.3854 (95% Wald CI 0.4248 to 4.5185)
#> Stratum #5: thetahat_5 = 2.3333 (95% Wald CI 0.5871 to 9.2729)
#> Stratum #6: thetahat_6 = 2.7308 (95% Wald CI 0.8495 to 8.7782)
#>
#> Estimating a common difference between probabilities
#> ----------------------------------------------------
#> The Mantel-Haenszel estimate = 0.0281
#> The inverse variance estimate = 0.0294
#>
#> Estimating a common ratio of probabilities
#> ------------------------------------------
#> The Mantel-Haenszel estimate = 1.7345
#> The inverse variance estimate = 1.6989
#>
#> Estimating a common odds ratio
#> ------------------------------
#> The Mantel-Haenszel estimate = 1.7893
#> The inverse variance estimate = 1.7642
#> The Peto OR estimate = 1.7573
#>
#> Tests of homogeneity of the difference between probabilities
#> ============================================================
#> Test P-value (test statistic)
#> -------------------------------------------------
#> Likelihood ratio 0.9729 (T = 0.863, df = 5)
#> Pearson chi-squared 0.9730 (T = 0.861, df = 5)
#> -------------------------------------------------
#>
#> Tests of homogeneity of the ratio of probabilities
#> ================================================
#> Test P-value (test statistic)
#> -------------------------------------------------
#> Likelihood ratio 0.9007 (T = 1.605, df = 5)
#> Pearson chi-squared 0.9006 (T = 1.605, df = 5)
#> -------------------------------------------------
#>
#> Tests of homogeneity of odds ratios
#> ===================================
#> Test P-value (test statistic)
#> -------------------------------------------------------------
#> Likelihood ratio 0.9084 (T = 1.540, df = 5)
#> Pearson chi-squared 0.9088 (T = 1.537, df = 5)
#> Peto 0.9229 (T = 1.413, df = 5)
#> -------------------------------------------------------------
#>
#> Tests and CIs for a common difference between probabilities
#> ===========================================================
#> Test P-value (test statistic)
#> -------------------------------------------------
#> Likelihood ratio 0.0216 (T = 5.274, df = 1)
#> Pearson chi-squared 0.0230 (T = 5.165, df = 1)
#> Wald (MH) 0.0349 (Z = 2.109)
#> Wald (IV) 0.0243 (Z = 2.253)
#> -------------------------------------------------
#> Interval method estimate 95% CI
#> -------------------------------------------------
#> Wald (MH) 0.0281 0.0020 to 0.0542
#> Wald (IV) 0.0294 0.0038 to 0.0551
#> Maximum likelihood 0.0297 0.0041 to 0.0553
#> -------------------------------------------------
#>
#> Tests and CIs for a common ratio of probabilities
#> =================================================
#> Test P-value (test statistic)
#> -------------------------------------------------
#> Likelihood ratio 0.0361 (T = 4.395, df = 1)
#> Pearson chi-squared 0.0373 (T = 4.337, df = 1)
#> Wald (MH) 0.0388 (Z = 2.066)
#> Wald (IV) 0.0495 (Z = 1.964)
#> -------------------------------------------------
#> Interval method estimate 95% CI
#> -------------------------------------------------
#> Wald (MH) 1.7345 1.0287 to 2.9247
#> Wald (IV) 1.6989 1.0011 to 2.8832
#> Maximum likelihood 1.7266 1.0250 to 2.9083
#> -------------------------------------------------
#>
#> Tests and CIs for a common odds ratio
#> =====================================
#> Test P-value (test statistic)
#> -----------------------------------------------------
#> Likelihood ratio 0.0347 (T = 4.458, df = 1)
#> Pearson chi-squared 0.0359 (T = 4.400, df = 1)
#> Cochran-Mantel-Haenszel 0.0365 (T = 1.000, df = 4.37534)
#> RBG 0.0682 (Z = 1.824)
#> Woolf 0.0461 (Z = 1.994)
#> -----------------------------------------------------
#> Interval method estimate 95% CI
#> -------------------------------------------------
#> RBG (MH) 1.7893 0.9575 to 3.3437
#> Woolf (IV) 1.7642 1.0098 to 3.0821
#> Maximum likelihood 1.7889 1.0322 to 3.1005
#> -------------------------------------------------