# Stratified 2x2 Tables: Miettinen-Nurminen and Friends

#### Kyun-Seop Bae

## A single 2x2 table

For one 2x2 table, `RD`, `RR`, and `OR` give the risk difference, relative risk, and odds ratio with their score confidence intervals:

    RD(7, 10, 3, 10) # y1, n1, y2, n2

       p1  p2  RD       SE        lower     upper
    1 0.7 0.3 0.4 0.204939 -0.001673089 0.8016731

    RR(7, 10, 3, 10)

       p1  p2       RR     SElog     lower    upper
    1 0.7 0.3 2.333333 0.5255383 0.8329862 6.536056

    OR(7, 10, 3, 10)

          odd1      odd2       OR     SElog     lower    upper
    1 2.333333 0.4285714 5.444444 0.9759001 0.8040183 36.86729

The Miettinen-Nurminen (MN) score intervals for a single stratum are `RDmn1`, `RRmn1`, and `ORmn1`:

    RDmn1(7, 10, 3, 10)

             p1          p2          RD       lower       upper
     0.70000000  0.30000000  0.40000000 -0.04910451  0.71457639

    RRmn1(7, 10, 3, 10)

           p1        p2        RR     lower     upper
    0.7000000 0.3000000 2.3333333 0.9264279 6.8474376

    ORmn1(7, 10, 3, 10)

          odd1       odd2         OR      lower      upper
     2.3333333  0.4285714  5.4444444  0.8215414 36.0809910

These intervals perform well even in extreme cases such as zero cells:

    RDmn1(10, 10, 0, 10)

           p1        p2        RD     lower     upper
    1.0000000 0.0000000 1.0000000 0.6636451 1.0000000

    RRmn1(10, 10, 1, 10)

           p1        p2        RR     lower     upper
     1.000000  0.100000 10.000000  2.474357 55.882702

## Stratified analysis by the MN score method

When the data have strata (centers, studies, subgroups), provide a `data.frame` with columns `y1, n1, y2, n2`, one row per stratum:

    d0 = data.frame(y1=c(25, 23), n1=c(339, 370), y2=c(28, 40), n2=c(335, 364))
    RDmn(d0)

    $Strata
              p1         p2           RD       lower        upper
    1 0.07374631 0.08358209 -0.009835777 -0.05173666  0.031557500
    2 0.06216216 0.10989011 -0.047727948 -0.08979481 -0.007312602

    $Common
               p1            p2            RD         lower         upper
     0.0677085653  0.0972940300 -0.0295854647 -0.0589400053 -0.0008563609

    RRmn(d0)

    $Strata
              p1         p2        RR     lower     upper
    1 0.07374631 0.08358209 0.8823220 0.5284979 1.4721821
    2 0.06216216 0.10989011 0.5656757 0.3470167 0.9195091

    $Common
            p1         p2         RR      lower      upper
    0.06770624 0.09729930 0.69585539 0.48873173 0.98979282

    ORmn(d0)

    $Strata
            odd1       odd2        OR     lower    upper
    1 0.07961783 0.09120521 0.8729527 0.5004020 1.522954
    2 0.06628242 0.12345679 0.5368876 0.3160012 0.912411

    $Common
          odd1       odd2         OR      lower      upper
    0.07235566 0.10843574 0.67410200 0.45950894 0.98888123

The `Strata` part shows the per-stratum MN intervals, and the `Common` part shows the common (pooled) estimate with its stratified score confidence interval.

Since version 1.0.0:

- `RDmn` and `RRmn` agree with `ratesci::scoreci(weighting="MN", skew=FALSE)` by Pete Laud to 8 decimal places, including zero-cell strata.
- `ORmn` uses the inverse variance weighted score statistic with the score bias correction following Laud, and agrees with `ratesci::scoreci(contrast="OR", stratified=TRUE, skew=FALSE)` to at least 7 significant digits.

## Inverse variance (meta-analysis) and CMH methods

The `*inv` functions pool by the inverse variance method and report both the fixed effect and DerSimonian-Laird random effects results with Cochran’s Q test - the standard meta-analysis summary:

    d1 = data.frame(y1=c(25, 23), n1=c(339, 370), y2=c(28, 40), n2=c(335, 364))
    RRinv(d1)

    $RRs
              p1         p2        RR     SElog     lower     upper      pwi     pwsi
    1 0.07374631 0.08358209 0.8823220 0.2641578 0.5257455 1.4807394 52.02783 48.29184
    2 0.06216216 0.10989011 0.5656757 0.2510544 0.3458355 0.9252634 47.97217 51.70816

    $Heterogeneity
             Q      prob
    1 1.487959 0.2225334

    $tau2
    [1] 0.03240235

    $Fixed
             RR     lower     upper
    1 0.6985385 0.4889789 0.9979083

    $Random
             RR     lower    upper
    1 0.7011316 0.4536439 1.083637

The Cochran-Mantel-Haenszel common odds ratio:

    ORcmh(d1)

    $ORs
            odd1       odd2        OR     SElog     lower     upper
    1 0.07961783 0.09120521 0.8729527 0.2866293 0.4977502 1.5309816
    2 0.06628242 0.12345679 0.5368876 0.2728489 0.3145096 0.9165007

    $Common
             OR    SElog     lower     upper
    1 0.6740762 0.196439 0.4586694 0.9906452

## Example: aspirin and coronary heart disease

`aspirinCHD` contains six trials of aspirin versus placebo for post-myocardial infarction mortality:

    aspirinCHD

       y1   n1  y2   n2
    1  49  615  67  624
    2  44  758  64  771
    3  27  317  32  309
    4 102  832 126  850
    5  85  810  52  406
    6 246 2267 219 2257

    ORmn(aspirinCHD)$Common

         odd1      odd2        OR     lower     upper
    0.1128906 0.1246222 0.9030600 0.7969606 1.0232842

    ORinv(aspirinCHD)$Common

             OR      SElog     lower    upper
    1 0.9034556 0.06395705 0.7970149 1.024111

## Choosing a method

- MN score (`RDmn`, `RRmn`, `ORmn`): recommended for clinical trials with strata; asymmetric intervals with excellent small-sample coverage; no standard error reported.
- Inverse variance (`RDinv`, `RRinv`, `ORinv`): the classical meta-analysis approach with fixed and random effects and a heterogeneity test.
- CMH (`ORcmh`): the familiar Cochran-Mantel-Haenszel common odds ratio.