. do "C:\Users\DEFAUL~1.SID\AppData\Local\Temp\STD00000000.tmp"

. * do-file for lecture 5b (part) of VHM 802/812, Winter 2014
. version 13

. set more off

. cd "f:\vhm\vhm802\data_stata"
f:\vhm\vhm802\data_stata

.
. * conditional logistic regression
. use sal_outbrk.dta, clear

. summarize

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
   match_grp |       112    28.63393    17.16271          1         59
        date |       100    13426.43    6.449892      13418      13463
         age |        97    28.06359    15.94086   2.532512   64.43532
      gender |       112    .4732143     .501526          0          1
 casecontrol |       112    .3482143    .4785455          0          1
-------------+--------------------------------------------------------
     eatbeef |       106    .6698113     .472515          0          1
     eatpork |       106    .7924528    .4074773          0          1
     eatveal |       107    .0654206    .2484301          0          1
     eatlamb |       109    .0366972    .1888859          0          1
     eatpoul |       105    .3238095    .4701726          0          1
-------------+--------------------------------------------------------
     eatcold |       111     .972973    .1628976          0          1
      eatveg |       109    .9266055    .2619875          0          1
    eatfruit |       109    .8348624    .3730197          0          1
     eateggs |       103    .7669903    .4248156          0          1
       slt_a |       112    .4821429    .5019268          0          1
-------------+--------------------------------------------------------
       dlr_a |        99    .2121212    .4108907          0          1
       dlr_b |        99    .0707071    .2576394          0          1

. browse match_grp age gender casecontrol eatpork eatpoul eatbeef eateggs slt_a dlr_a

. list match_grp age gender casecontrol eatbeef eatpork slt_a dlr_a if match_grp==23

     +------------------------------------------------------------------------+
     | match_~p   age   gender   caseco~l   eatbeef   eatpork   slt_a   dlr_a |
     +------------------------------------------------------------------------+
 39. |       23     .     Male       case        no       yes     yes      no |
 40. |       23     .     Male      contr       yes       yes     yes      no |
 41. |       23     .     Male      contr        no       yes      no      no |
     +------------------------------------------------------------------------+

.
. * Mantel-Haenszel statistics for binary exposures
. cc casecontrol eatpork, by(match_grp) nohom

  Matching group |       OR       [95% Conf. Interval]   M-H Weight
-----------------+-------------------------------------------------
               1 |          .             0          .            0 (exact)
               2 |          .             .          .            0 (exact)
               3 |          0             0          .     .3333333 (exact)
               4 |          0             0          .     .6666667 (exact)
               5 |          .             0          .            0 (exact)
               7 |          .             0          .            0 (exact)
               9 |          .             0          .            0 (exact)
              11 |          .             0          .            0 (exact)
              12 |          0             0          .     .6666667 (exact)
              13 |          .             0          .            0 (exact)
              15 |          .             0          .            0 (exact)
              16 |          .             0          .            0 (exact)
              22 |          .             0          .            0 (exact)
              23 |          .             0          .            0 (exact)
              24 |          .             0          .            0 (exact)
              25 |          .             0          .            0 (exact)
              26 |          .             .          .            0 (exact)
              27 |          .             0          .            0 (exact)
              28 |          .             0          .            0 (exact)
              29 |          .             0          .            0 (exact)
              30 |          .             0          .            0 (exact)
              31 |          .             0          .            0 (exact)
              32 |          .             0          .            0 (exact)
              33 |          .             0          .            0 (exact)
              34 |          .             0          .            0 (exact)
              36 |          .             0          .            0 (exact)
              39 |          .             0          .            0 (exact)
              42 |          .             0          .            0 (exact)
              43 |          .             0          .            0 (exact)
              44 |          0             0          .     .6666667 (exact)
              45 |          .             .          .            0 (exact)
              46 |          .             0          .            0 (exact)
              49 |          .             0          .            0 (exact)
              50 |          .             0          .            0 (exact)
              52 |          .             0          .            0 (exact)
              53 |          .             0          .            0 (exact)
              55 |          .             0          .            0 (exact)
              58 |          .             .          .            0 (exact)
              59 |          .             .          .            0 (exact)
-----------------+-------------------------------------------------
           Crude |        2.5      .7240032   11.00641              (exact)
    M-H combined |   2.142857      .6900548   6.654307

                   Test that combined OR = 1:
                                Mantel-Haenszel chi2(1) =      1.86
                                                Pr>chi2 =    0.1732

. cc casecontrol eatpork /* incorrect 2*2-table analysis */
                                                         Proportion
                 |   Exposed   Unexposed  |      Total     Exposed
-----------------+------------------------+------------------------
           Cases |        30           4  |         34       0.8824
        Controls |        54          18  |         72       0.7500
-----------------+------------------------+------------------------
           Total |        84          22  |        106       0.7925
                 |                        |
                 |      Point estimate    |    [95% Conf. Interval]
                 +------------------------+------------------------
      Odds ratio |              2.5       |    .7240032    11.00641 (exact)
 Attr. frac. ex. |               .6       |   -.3812093    .9091439 (exact)
 Attr. frac. pop |         .5294118       |
                 +------------------------+------------------------
                               chi2(1) =     2.46  Pr>chi2 = 0.1168

. cc casecontrol eateggs, by(match_grp) nohom

  Matching group |       OR       [95% Conf. Interval]   M-H Weight
-----------------+-------------------------------------------------
               1 |          .             0          .            0 (exact)
               2 |          .             .          .            0 (exact)
               3 |          .             .          .            0 (exact)
               4 |          .             .          .            0 (exact)
               5 |          .             0          .            0 (exact)
               7 |          .             0          .            0 (exact)
               9 |          .             0          .            0 (exact)
              11 |          .             0          .            0 (exact)
              12 |          0             0          .     .6666667 (exact)
              13 |          0             0          .     .3333333 (exact)
              15 |          .             .          .            0 (exact)
              16 |          .             0          .            0 (exact)
              22 |          .             0          .            0 (exact)
              23 |          .             0          .            0 (exact)
              24 |          .             0          .            0 (exact)
              25 |          .             0          .            0 (exact)
              26 |          .             0          .            0 (exact)
              27 |          .             .          .            0 (exact)
              28 |          .             0          .            0 (exact)
              29 |          .             0          .            0 (exact)
              30 |          .             0          .            0 (exact)
              31 |          .             0          .            0 (exact)
              32 |          .             0          .            0 (exact)
              33 |          0             0          .     .3333333 (exact)
              34 |          .             0          .            0 (exact)
              36 |          .             .          .            0 (exact)
              39 |          .             0          .            0 (exact)
              42 |          .             .          .            0 (exact)
              43 |          .             0          .            0 (exact)
              44 |          .             0          .            0 (exact)
              45 |          .             0          .            0 (exact)
              46 |          .             0          .            0 (exact)
              49 |          .             0          .            0 (exact)
              50 |          .             0          .            0 (exact)
              52 |          .             0          .            0 (exact)
              53 |          .             .          .            0 (exact)
              55 |          .             .          .            0 (exact)
              58 |          .             0          .            0 (exact)
              59 |          .             0          .            0 (exact)
-----------------+-------------------------------------------------
           Crude |   1.973077       .616499   7.467738              (exact)
    M-H combined |       2.75      .6671433   11.33565

                   Test that combined OR = 1:
                                Mantel-Haenszel chi2(1) =         .
                                                Pr>chi2 =         .

. cc casecontrol slt_a, by(match_grp) nohom

  Matching group |       OR       [95% Conf. Interval]   M-H Weight
-----------------+-------------------------------------------------
               1 |          .             0          .            0 (exact)
               2 |          0             0          .     .6666667 (exact)
               3 |          0             0          .     .3333333 (exact)
               4 |          .             0          .            0 (exact)
               5 |          .             0          .            0 (exact)
               7 |          .             0          .            0 (exact)
               9 |          0             0          .     .6666667 (exact)
              11 |          .             0          .            0 (exact)
              12 |          .             .          .            0 (exact)
              13 |          .             0          .            0 (exact)
              15 |          .             0          .            0 (exact)
              16 |          .             .          .            0 (exact)
              22 |          .             0          .            0 (exact)
              23 |          .             0          .            0 (exact)
              24 |          .             0          .            0 (exact)
              25 |          0             0          .     .3333333 (exact)
              26 |          .             0          .            0 (exact)
              27 |          .             .          .            0 (exact)
              28 |          .             .          .            0 (exact)
              29 |          .             .          .            0 (exact)
              30 |          .             0          .            0 (exact)
              31 |          .             0          .            0 (exact)
              32 |          .             0          .            0 (exact)
              33 |          .             0          .            0 (exact)
              34 |          .             .          .            0 (exact)
              36 |          .             0          .            0 (exact)
              39 |          .             0          .            0 (exact)
              42 |          .             .          .            0 (exact)
              43 |          .             0          .            0 (exact)
              44 |          .             0          .            0 (exact)
              45 |          .             0          .            0 (exact)
              46 |          .             0          .            0 (exact)
              49 |          .             0          .            0 (exact)
              50 |          .             0          .            0 (exact)
              52 |          .             0          .            0 (exact)
              53 |          .             0          .            0 (exact)
              55 |          0             0          .           .5 (exact)
              58 |          .             0          .            0 (exact)
              59 |          .             .          .            0 (exact)
-----------------+-------------------------------------------------
           Crude |   3.214286      1.323847   7.940837              (exact)
    M-H combined |   3.866667      1.445059   10.34637

                   Test that combined OR = 1:
                                Mantel-Haenszel chi2(1) =      9.48
                                                Pr>chi2 =    0.0021

. cc casecontrol dlr_a, by(match_grp) nohom

  Matching group |       OR       [95% Conf. Interval]   M-H Weight
-----------------+-------------------------------------------------
               1 |          .             .          .            0 (exact)
               2 |          .             .          .            0 (exact)
               3 |          .             .          .            0 (exact)
               4 |          .             0          .            0 (exact)
               5 |          .             .          .            0 (exact)
               7 |          .             .          .            0 (exact)
               9 |          .             .          .            0 (exact)
              11 |          .             .          .            0 (exact)
              12 |          .             .          .            0 (exact)
              13 |          .             0          .            0 (exact)
              15 |          .             .          .            0 (exact)
              16 |          .             .          .            0 (exact)
              22 |          .             0          .            0 (exact)
              23 |          .             .          .            0 (exact)
              24 |          .             .          .            0 (exact)
              25 |          .             .          .            0 (exact)
              26 |          .             .          .            0 (exact)
              27 |          .             .          .            0 (exact)
              28 |          .             .          .            0 (exact)
              29 |          .             .          .            0 (exact)
              30 |          .             0          .            0 (exact)
              31 |          .             0          .            0 (exact)
              32 |          .             0          .            0 (exact)
              33 |          .             0          .            0 (exact)
              34 |          .             .          .            0 (exact)
              36 |          .             .          .            0 (exact)
              39 |          .             .          .            0 (exact)
              42 |          .             .          .            0 (exact)
              43 |          .             .          .            0 (exact)
              44 |          .             0          .            0 (exact)
              45 |          .             0          .            0 (exact)
              46 |          .             0          .            0 (exact)
              49 |          0             0          .     .6666667 (exact)
              50 |          .             0          .            0 (exact)
              52 |          .             .          .            0 (exact)
              53 |          .             .          .            0 (exact)
              55 |          .             .          .            0 (exact)
              58 |          .             0          .            0 (exact)
              59 |          .             .          .            0 (exact)
-----------------+-------------------------------------------------
           Crude |   4.140351      1.342934    12.8559              (exact)
    M-H combined |       7.75      1.203515   49.90588

                   Test that combined OR = 1:
                                Mantel-Haenszel chi2(1) =         .
                                                Pr>chi2 =         .

.
. * univariate CLR (conditional logistic regression)
. clogit casecontrol slt_a, group(match_grp)

Iteration 0:   log likelihood = -36.017955
Iteration 1:   log likelihood =  -35.82051
Iteration 2:   log likelihood = -35.820042
Iteration 3:   log likelihood = -35.820042

Conditional (fixed-effects) logistic regression   Number of obs   =        112
                                                  LR chi2(1)      =      10.00
                                                  Prob > chi2     =     0.0016
Log likelihood = -35.820042                       Pseudo R2       =     0.1225

-------------+----------------------------------------------------------------
  casecontrol |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       slt_a |    1.485215    .5181015      2.87    0.004      .4697549     2.500676
-------------+----------------------------------------------------------------

. clogit casecontrol slt_a, group(match_grp) or

Iteration 0:   log likelihood = -36.017955
Iteration 1:   log likelihood =  -35.82051
Iteration 2:   log likelihood = -35.820042
Iteration 3:   log likelihood = -35.820042

Conditional (fixed-effects) logistic regression   Number of obs   =        112
                                                  LR chi2(1)      =      10.00
                                                  Prob > chi2     =     0.0016
Log likelihood = -35.820042                       Pseudo R2       =     0.1225

-------------+----------------------------------------------------------------
  casecontrol | Odds Ratio    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       slt_a |    4.415916    2.287893      2.87    0.004      1.599602     12.19073
-------------+----------------------------------------------------------------

. clogit casecontrol dlr_a, group(match_grp) /* note missing values of dlr_a */
note: 10 groups (16 obs) dropped because of all positive or
      all negative outcomes.

Iteration 0:   log likelihood = -26.449441
Iteration 1:   log likelihood = -25.564131
Iteration 2:   log likelihood =  -25.56413

Conditional (fixed-effects) logistic regression   Number of obs   =         83
                                                  LR chi2(1)      =       9.35
                                                  Prob > chi2     =     0.0022
Log likelihood =  -25.56413                       Pseudo R2       =     0.1546

-------------+----------------------------------------------------------------
  casecontrol |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       dlr_a |      2.4749    1.064786      2.32    0.020      .3879573     4.561843
-------------+----------------------------------------------------------------

. table match_grp casecont if dlr_a~=. /* 10 sets with no case or no controls */

----------+-----------------
          |   Case-control
Matching  |      status
group     | control     case
----------+-----------------
        1 |       2        1
        2 |       2
        3 |       2        1
        4 |       2        1
        5 |       2        1
        7 |       1        1
        9 |       2        1
       11 |       2        1
       12 |       2
       13 |       2        1
       15 |       1        1
       16 |       1        1
       22 |       2        1
       23 |       2        1
       24 |       2        1
       25 |       2        1
       26 |       2        1
       27 |       2
       28 |       2        1
       29 |       2
       30 |       2        1
       31 |       2        1
       32 |       1        1
       33 |       2        1
       34 |       1
       36 |       2        1
       39 |       2        1
       42 |       2
       43 |                1
       44 |       2        1
       45 |       2        1
       46 |                1
       49 |       2        1
       50 |       2        1
       52 |       2        1
       53 |       2        1
       55 |       1
       58 |       2        1
       59 |       2
----------+-----------------

. clogit casecontrol eatpork, group(match_grp) /* note missing values of eatpork */
note: 5 groups (10 obs) dropped because of all positive or
      all negative outcomes.

Iteration 0:   log likelihood = -33.935682
Iteration 1:   log likelihood = -33.924226
Iteration 2:   log likelihood =  -33.92422
Iteration 3:   log likelihood =  -33.92422

Conditional (fixed-effects) logistic regression   Number of obs   =         96
                                                  LR chi2(1)      =       1.99
                                                  Prob > chi2     =     0.1582
Log likelihood =  -33.92422                       Pseudo R2       =     0.0285

-------------+----------------------------------------------------------------
  casecontrol |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
     eatpork |    .7832009    .5874627      1.33    0.182     -.3682049     1.934607
-------------+----------------------------------------------------------------

. clogit casecontrol eateggs, group(match_grp) /* note missing values of eateggs */
note: 7 groups (13 obs) dropped because of all positive or
      all negative outcomes.

Iteration 0:   log likelihood = -31.705811
Iteration 1:   log likelihood = -31.640388
Iteration 2:   log likelihood = -31.640261
Iteration 3:   log likelihood = -31.640261

Conditional (fixed-effects) logistic regression   Number of obs   =         90
                                                  LR chi2(1)      =       2.17
                                                  Prob > chi2     =     0.1412
Log likelihood = -31.640261                       Pseudo R2       =     0.0331

-------------+----------------------------------------------------------------
  casecontrol |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
     eateggs |    .9698158    .6979461      1.39    0.165     -.3981333     2.337765
-------------+----------------------------------------------------------------

.
. * multivariable CLR
. clogit casecontrol slt_a dlr_a, group(match_grp)
note: 10 groups (16 obs) dropped because of all positive or
      all negative outcomes.

Iteration 0:   log likelihood = -23.453038
Iteration 1:   log likelihood = -22.838773
Iteration 2:   log likelihood = -22.838098
Iteration 3:   log likelihood = -22.838098

Conditional (fixed-effects) logistic regression   Number of obs   =         83
                                                  LR chi2(2)      =      14.80
                                                  Prob > chi2     =     0.0006
Log likelihood = -22.838098                       Pseudo R2       =     0.2447

-------------+----------------------------------------------------------------
  casecontrol |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       slt_a |    1.471547    .6853288      2.15    0.032      .1283273     2.814767
       dlr_a |    1.629739    1.103103      1.48    0.140     -.5323029     3.791781
-------------+----------------------------------------------------------------

. estimates store full

. clogit casecontrol slt_a if dlr_a~=., group(match_grp)
note: 10 groups (16 obs) dropped because of all positive or
      all negative outcomes.

Iteration 0:   log likelihood =  -24.38806
Iteration 1:   log likelihood = -24.348329
Iteration 2:   log likelihood = -24.348232
Iteration 3:   log likelihood = -24.348232

Conditional (fixed-effects) logistic regression   Number of obs   =         83
                                                  LR chi2(1)      =      11.78
                                                  Prob > chi2     =     0.0006
Log likelihood = -24.348232                       Pseudo R2       =     0.1948

-------------+----------------------------------------------------------------
  casecontrol |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       slt_a |     1.89557    .6441469      2.94    0.003      .6330655     3.158075
-------------+----------------------------------------------------------------

. lrtest full /* LR-test gives lower P than Wald test */

Likelihood-ratio test                                 LR chi2(1)  =      3.02
(Assumption: . nested in full)                        Prob > chi2 =    0.0822

. clogit casecontrol slt_a eatpork, group(match_grp)
note: 5 groups (10 obs) dropped because of all positive or
      all negative outcomes.

Iteration 0:   log likelihood = -29.752114
Iteration 1:   log likelihood = -29.561902
Iteration 2:   log likelihood = -29.561307
Iteration 3:   log likelihood = -29.561307

Conditional (fixed-effects) logistic regression   Number of obs   =         96
                                                  LR chi2(2)      =      10.72
                                                  Prob > chi2     =     0.0047
Log likelihood = -29.561307                       Pseudo R2       =     0.1535

-------------+----------------------------------------------------------------
  casecontrol |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       slt_a |    1.536735    .5772246      2.66    0.008      .4053956     2.668074
     eatpork |    .5658754    .6030214      0.94    0.348     -.6160248     1.747776
-------------+----------------------------------------------------------------

. clogit casecontrol slt_a eateggs, group(match_grp)
note: 7 groups (13 obs) dropped because of all positive or
      all negative outcomes.

Iteration 0:   log likelihood = -24.847337
Iteration 1:   log likelihood = -24.412117
Iteration 2:   log likelihood =  -24.40982
Iteration 3:   log likelihood = -24.409819

Conditional (fixed-effects) logistic regression   Number of obs   =         90
                                                  LR chi2(2)      =      16.63
                                                  Prob > chi2     =     0.0002
Log likelihood = -24.409819                       Pseudo R2       =     0.2540

-------------+----------------------------------------------------------------
  casecontrol |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       slt_a |    2.289793    .7645301      3.00    0.003      .7913412     3.788244
     eateggs |    .9915344    .7623728      1.30    0.193     -.5026889     2.485758
-------------+----------------------------------------------------------------

. clogit casecontrol slt_a##gender, group(match_grp)
note: 1.gender omitted because of no within-group variance.

Iteration 0:   log likelihood = -35.894695
Iteration 1:   log likelihood =  -35.19821
Iteration 2:   log likelihood = -35.197693
Iteration 3:   log likelihood = -35.197693

Conditional (fixed-effects) logistic regression   Number of obs   =        112
                                                  LR chi2(2)      =      11.24
                                                  Prob > chi2     =     0.0036
Log likelihood = -35.197693                       Pseudo R2       =     0.1377

-------------+----------------------------------------------------------------
  casecontrol |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       slt_a |
        yes  |    1.063157    .6159625      1.73    0.084     -.1441072     2.270421
             |
      gender |
     Female  |           0   (omitted)
             |
slt_a#gender |
 yes#Female  |     1.28332    1.234781      1.04    0.299     -1.136806     3.703446
-------------+----------------------------------------------------------------

. clogit casecontrol slt_a##c.age, group(match_grp)
note: 3 groups (4 obs) dropped because of all positive or
      all negative outcomes.

Iteration 0:   log likelihood = -29.807362
Iteration 1:   log likelihood = -29.446815
Iteration 2:   log likelihood = -29.444699
Iteration 3:   log likelihood = -29.444699

Conditional (fixed-effects) logistic regression   Number of obs   =         93
                                                  LR chi2(3)      =       8.75
                                                  Prob > chi2     =     0.0328
Log likelihood = -29.444699                       Pseudo R2       =     0.1294

-------------+----------------------------------------------------------------
  casecontrol |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       slt_a |
        yes  |    2.493701    1.259868      1.98    0.048      .0244059     4.962996
         age |   -2.997822    3.967855     -0.76    0.450     -10.77467     4.779031
             |
 slt_a#c.age |
        yes  |   -.0466566    .0422594     -1.10    0.270     -.1294835     .0361703
-------------+----------------------------------------------------------------

.
. * OLR (ordinary logistic regression) - not recommended
. logit casecontrol slt_a /* bias towards the null */

Iteration 0:   log likelihood =  -72.38943
Iteration 1:   log likelihood =  -68.28612
Iteration 2:   log likelihood = -68.254451
Iteration 3:   log likelihood = -68.254443
Iteration 4:   log likelihood = -68.254443

Logistic regression                               Number of obs   =        112
                                                  LR chi2(1)      =       8.27
                                                  Prob > chi2     =     0.0040
Log likelihood = -68.254443                       Pseudo R2       =     0.0571

-------------+----------------------------------------------------------------
  casecontrol |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       slt_a |    1.167605    .4163185      2.80    0.005      .3516358     1.983574
       _cons |   -1.241713    .3148735     -3.94    0.000     -1.858854    -.6245725
-------------+----------------------------------------------------------------

. * OLR with matching variables as confounders - validity unclear
. logit casecontrol slt_a age gender

Iteration 0:   log likelihood = -62.833219
Iteration 1:   log likelihood = -60.025885
Iteration 2:   log likelihood = -60.009335
Iteration 3:   log likelihood = -60.009333

Logistic regression                               Number of obs   =         97
                                                  LR chi2(3)      =       5.65
                                                  Prob > chi2     =     0.1301
Log likelihood = -60.009333                       Pseudo R2       =     0.0449

-------------+----------------------------------------------------------------
  casecontrol |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       slt_a |    1.021105    .4434945      2.30    0.021      .1518712     1.890338
         age |    .0012583    .0141469      0.09    0.929     -.0264691     .0289858
      gender |    .0997614    .4444179      0.22    0.822     -.7712817     .9708044
       _cons |    -1.23389    .5883852     -2.10    0.036     -2.387104    -.0806764
-------------+----------------------------------------------------------------

.
. * CLR diagnostics using add-on command clfit
. clogit casecontrol slt_a, group(match_grp)

Iteration 0:   log likelihood = -36.017955
Iteration 1:   log likelihood =  -35.82051
Iteration 2:   log likelihood = -35.820042
Iteration 3:   log likelihood = -35.820042

Conditional (fixed-effects) logistic regression   Number of obs   =        112
                                                  LR chi2(1)      =      10.00
                                                  Prob > chi2     =     0.0016
Log likelihood = -35.820042                       Pseudo R2       =     0.1225

-------------+----------------------------------------------------------------
  casecontrol |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       slt_a |    1.485215    .5181015      2.87    0.004      .4697549     2.500676
-------------+----------------------------------------------------------------

. clfit, graph /* Stata add-on for CLR diagnostics */

Clogit model for casecontrol

number of observations=      112

. * Stata 13 also gives the same diagnostics (+ more) with the predict command
. predict p, p

. predict pearson, residuals

. sort _gdbeta match_grp casecontrol

. list match_grp casecontrol slt_a _hat _d* _g* in -6/-1, sep(10)

     +-----------------------------------------------------------------------------------------+
     | match_~p   caseco~l   slt_a        _hat        _dx2      _dbeta       _gdx2     _gdbeta |
     +-----------------------------------------------------------------------------------------+
107. |        2      contr     yes   .00124723   .44970566   .00056159   9.0116723   .18386783 |
108. |        2      contr     yes   .00124723   .44970566   .00056159   9.0116723   .18386783 |
109. |        2       case      no   .02203069    8.112261   .18274466   9.0116723   .18386783 |
110. |        9      contr     yes   .00124723   .44970566   .00056159   9.0116723   .18386783 |
111. |        9      contr     yes   .00124723   .44970566   .00056159   9.0116723   .18386783 |
112. |        9       case      no   .02203069    8.112261   .18274466   9.0116723   .18386783 |
     +-----------------------------------------------------------------------------------------+

. * analysis without sets 2 & 9
. clogit casecontrol slt_a if match_grp~=2 & match_grp~=9, group(match_grp)

Iteration 0:   log likelihood = -31.242356
Iteration 1:   log likelihood = -30.745445
Iteration 2:   log likelihood = -30.744678
Iteration 3:   log likelihood = -30.744678

Conditional (fixed-effects) logistic regression   Number of obs   =        106
                                                  LR chi2(1)      =      15.75
                                                  Prob > chi2     =     0.0001
Log likelihood = -30.744678                       Pseudo R2       =     0.2039

-------------+----------------------------------------------------------------
  casecontrol |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       slt_a |    2.081011    .6328898      3.29    0.001      .8405703     3.321453
-------------+----------------------------------------------------------------

.
end of do-file

. exit, clear