-------------
      name:  <unnamed>
       log:  \\Client\C$\cem601_lab\Ebola_VariableSelection_August_26.smcl
  log type:  smcl
 opened on:  26 Aug 2015, 15:02:28

. do "C:\Users\blevy\AppData\Local\Temp\5\STD00000000.tmp"

.   gen lnpop=log(population)

.   ***************************************************
.                 *TRY POISSON
. ***************************************************************************
.
.    *first try univariate models
.
.     glm casecount iwi, offset(lnpop) fam(poi) eform

Iteration 0:   log likelihood = -8101.6621
Iteration 1:   log likelihood = -7335.9209
Iteration 2:   log likelihood =  -7335.289
Iteration 3:   log likelihood =  -7335.289

Generalized linear models                          No. of obs      =        36
Optimization     : ML                              Residual df     =        34
                                                   Scale parameter =         1
Deviance         =  14433.88263                    (1/df) Deviance =   424.526
Pearson          =  15259.93895                    (1/df) Pearson  =  448.8217

Variance function: V(u) =  u                       [Poisson]
Link function    : g(u) =  ln(u)                   [Log]

                                                   AIC             =  407.6272
Log likelihood   = -7335.288972                    BIC             =  14312.04

-------------+----------------------------------------------------------------
             |                 OIM
    casecount |        IRR    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
         iwi |    1.006263    .0005245     11.98    0.000      1.005235     1.007291
       _cons |    .0006057    .0000122   -368.58    0.000      .0005823       .00063
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

.
.     glm casecount edyr, offset(lnpop) fam(poi) eform

Iteration 0:   log likelihood = -6633.4284
Iteration 1:   log likelihood = -5943.3025
Iteration 2:   log likelihood = -5942.9406
Iteration 3:   log likelihood = -5942.9406

Generalized linear models                          No. of obs      =        36
Optimization     : ML                              Residual df     =        34
                                                   Scale parameter =         1
Deviance         =  11649.18583                    (1/df) Deviance =  342.6231
Pearson          =  13150.98595                    (1/df) Pearson  =  386.7937

Variance function: V(u) =  u                       [Poisson]
Link function    : g(u) =  ln(u)                   [Log]

                                                   AIC             =  330.2745
Log likelihood   = -5942.940572                    BIC             =  11527.35

-------------+----------------------------------------------------------------
             |                 OIM
    casecount |        IRR    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
        edyr |    1.202628      .00402     55.20    0.000      1.194775     1.210533
       _cons |    .0003407    6.14e-06   -443.36    0.000      .0003289      .000353
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

.
.         glm casecount edyr_fem, offset(lnpop) fam(poi) eform

Iteration 0:   log likelihood =  -6593.269
Iteration 1:   log likelihood = -5864.8336
Iteration 2:   log likelihood = -5864.3888
Iteration 3:   log likelihood = -5864.3888

Generalized linear models                          No. of obs      =        36
Optimization     : ML                              Residual df     =        34
                                                   Scale parameter =         1
Deviance         =  11492.08236                    (1/df) Deviance =  338.0024
Pearson          =  12912.21447                    (1/df) Pearson  =   379.771

Variance function: V(u) =  u                       [Poisson]
Link function    : g(u) =  ln(u)                   [Log]

                                                   AIC             =  325.9105
Log likelihood   = -5864.388838                    BIC             =  11370.24

-------------+----------------------------------------------------------------
             |                 OIM
    casecount |        IRR    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
    edyr_fem |    1.226521    .0043865     57.09    0.000      1.217954     1.235148
       _cons |    .0003961    6.07e-06   -511.27    0.000      .0003844     .0004082
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

.
.         glm casecount edyr_male, offset(lnpop) fam(poi) eform

Iteration 0:   log likelihood = -6716.6455
Iteration 1:   log likelihood = -6045.5642
Iteration 2:   log likelihood = -6045.1823
Iteration 3:   log likelihood = -6045.1823

Generalized linear models                          No. of obs      =        36
Optimization     : ML                              Residual df     =        34
                                                   Scale parameter =         1
Deviance         =  11853.66922                    (1/df) Deviance =  348.6373
Pearson          =  13248.20089                    (1/df) Pearson  =   389.653

Variance function: V(u) =  u                       [Poisson]
Link function    : g(u) =  ln(u)                   [Log]

                                                   AIC             =  335.9546
Log likelihood   = -6045.182268                    BIC             =  11731.83

-------------+----------------------------------------------------------------
             |                 OIM
    casecount |        IRR    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
   edyr_male |    1.185708    .0038148     52.94    0.000      1.178254     1.193208
       _cons |    .0002905    6.18e-06   -383.15    0.000      .0002787     .0003029
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

.
.         glm casecount urban, offset(lnpop) fam(poi) eform

Iteration 0:   log likelihood = -7335.6207
Iteration 1:   log likelihood = -6554.3308
Iteration 2:   log likelihood = -6553.2245
Iteration 3:   log likelihood = -6553.2244

Generalized linear models                          No. of obs      =        36
Optimization     : ML                              Residual df     =        34
                                                   Scale parameter =         1
Deviance         =  12869.75347                    (1/df) Deviance =  378.5222
Pearson          =  14332.62135                    (1/df) Pearson  =  421.5477

Variance function: V(u) =  u                       [Poisson]
Link function    : g(u) =  ln(u)                   [Log]

                                                   AIC             =  364.1791
Log likelihood   = -6553.224396                    BIC             =  12747.91

-------------+----------------------------------------------------------------
             |                 OIM
    casecount |        IRR    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       urban |    1.009456    .0002238     42.45    0.000      1.009017     1.009895
       _cons |    .0005009    6.80e-06   -559.83    0.000      .0004878     .0005144
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

.
.         glm casecount wrk_agri, offset(lnpop) fam(poi) eform

Iteration 0:   log likelihood = -7502.0462
Iteration 1:   log likelihood = -6753.0085
Iteration 2:   log likelihood = -6752.4823
Iteration 3:   log likelihood = -6752.4823

Generalized linear models                          No. of obs      =        36
Optimization     : ML                              Residual df     =        34
                                                   Scale parameter =         1
Deviance         =  13268.26926                    (1/df) Deviance =  390.2432
Pearson          =  14309.36289                    (1/df) Pearson  =  420.8636

Variance function: V(u) =  u                       [Poisson]
Link function    : g(u) =  ln(u)                   [Log]

                                                   AIC             =   375.249
Log likelihood   = -6752.482288                    BIC             =  13146.43

-------------+----------------------------------------------------------------
             |                 OIM
    casecount |        IRR    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
    wrk_agri |    .9891893    .0002907    -36.99    0.000      .9886198     .9897592
       _cons |    .0012701    .0000195   -434.52    0.000      .0012324     .0013088
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

.
.         glm casecount wrk_lnagr, offset(lnpop) fam(poi) eform

Iteration 0:   log likelihood =  -7577.859
Iteration 1:   log likelihood = -6853.2522
Iteration 2:   log likelihood = -6852.7845
Iteration 3:   log likelihood = -6852.7845

Generalized linear models                          No. of obs      =        36
Optimization     : ML                              Residual df     =        34
                                                   Scale parameter =         1
Deviance         =  13468.87374                    (1/df) Deviance =  396.1433
Pearson          =  14522.65585                    (1/df) Pearson  =  427.1369

Variance function: V(u) =  u                       [Poisson]
Link function    : g(u) =  ln(u)                   [Log]

                                                   AIC             =  380.8214
Log likelihood   = -6852.784527                    BIC             =  13347.03

-------------+----------------------------------------------------------------
             |                 OIM
    casecount |        IRR    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
   wrk_lnagr |    1.013043    .0003889     33.76    0.000      1.012281     1.013806
       _cons |    .0004338    8.31e-06   -404.09    0.000      .0004178     .0004504
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

.
.         glm casecount wrk_unagr, offset(lnpop) fam(poi) eform

Iteration 0:   log likelihood = -7618.9443
Iteration 1:   log likelihood = -6579.3027
Iteration 2:   log likelihood = -6570.1403
Iteration 3:   log likelihood = -6570.1329
Iteration 4:   log likelihood = -6570.1329

Generalized linear models                          No. of obs      =        36
Optimization     : ML                              Residual df     =        34
                                                   Scale parameter =         1
Deviance         =  12903.57055                    (1/df) Deviance =  379.5168
Pearson          =  13649.08246                    (1/df) Pearson  =  401.4436

Variance function: V(u) =  u                       [Poisson]
Link function    : g(u) =  ln(u)                   [Log]

                                                   AIC             =  365.1185
Log likelihood   = -6570.132932                    BIC             =  12781.73

-------------+----------------------------------------------------------------
             |                 OIM
    casecount |        IRR    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
   wrk_unagr |    1.049157    .0011808     42.64    0.000      1.046845     1.051474
       _cons |    .0004807    6.87e-06   -534.31    0.000      .0004674     .0004943
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

.
.         glm casecount tv, offset(lnpop) fam(poi) eform

Iteration 0:   log likelihood = -8074.4792
Iteration 1:   log likelihood = -7260.7765
Iteration 2:   log likelihood = -7259.8009
Iteration 3:   log likelihood = -7259.8009

Generalized linear models                          No. of obs      =        36
Optimization     : ML                              Residual df     =        34
                                                   Scale parameter =         1
Deviance         =  14282.90644                    (1/df) Deviance =  420.0855
Pearson          =  15147.50443                    (1/df) Pearson  =  445.5148

Variance function: V(u) =  u                       [Poisson]
Link function    : g(u) =  ln(u)                   [Log]

                                                   AIC             =  403.4334
Log likelihood   = -7259.800879                    BIC             =  14161.07

-------------+----------------------------------------------------------------
             |                 OIM
    casecount |        IRR    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
          tv |    1.005403    .0003096     17.50    0.000      1.004796      1.00601
       _cons |    .0006595    7.52e-06   -642.09    0.000      .0006449     .0006744
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

.
.         glm casecount density, offset(lnpop) fam(poi) eform

Iteration 0:   log likelihood =  -7858.521
Iteration 1:   log likelihood =  -6993.545
Iteration 2:   log likelihood = -6991.7371
Iteration 3:   log likelihood = -6991.7367

Generalized linear models                          No. of obs      =        36
Optimization     : ML                              Residual df     =        34
                                                   Scale parameter =         1
Deviance         =  13746.77817                    (1/df) Deviance =   404.317
Pearson          =  14527.94826                    (1/df) Pearson  =  427.2926

Variance function: V(u) =  u                       [Poisson]
Link function    : g(u) =  ln(u)                   [Log]

                                                   AIC             =  388.5409
Log likelihood   = -6991.736745                    BIC             =  13624.94

-------------+----------------------------------------------------------------
             |                 OIM
    casecount |        IRR    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
     density |    1.000169    5.59e-06     30.17    0.000      1.000158     1.000179
       _cons |    .0006598    6.37e-06   -758.98    0.000      .0006474     .0006724
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

.
.         glm casecount phone, offset(lnpop) fam(poi) eform

Iteration 0:   log likelihood = -7860.1025
Iteration 1:   log likelihood = -6990.3535
Iteration 2:   log likelihood = -6988.6661
Iteration 3:   log likelihood =  -6988.666

Generalized linear models                          No. of obs      =        36
Optimization     : ML                              Residual df     =        34
                                                   Scale parameter =         1
Deviance         =  13740.63659                    (1/df) Deviance =  404.1364
Pearson          =  14353.92527                    (1/df) Pearson  =  422.1743

Variance function: V(u) =  u                       [Poisson]
Link function    : g(u) =  ln(u)                   [Log]

                                                   AIC             =  388.3703
Log likelihood   = -6988.665954                    BIC             =   13618.8

-------------+----------------------------------------------------------------
             |                 OIM
    casecount |        IRR    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       phone |    1.013501    .0004656     29.19    0.000      1.012589     1.014414
       _cons |    .0003012      .00001   -243.74    0.000      .0002822     .0003215
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

.
.         glm casecount electr, offset(lnpop) fam(poi) eform

Iteration 0:   log likelihood = -8090.0232
Iteration 1:   log likelihood = -7294.9392
Iteration 2:   log likelihood =  -7293.926
Iteration 3:   log likelihood = -7293.9259

Generalized linear models                          No. of obs      =        36
Optimization     : ML                              Residual df     =        34
                                                   Scale parameter =         1
Deviance         =  14351.15656                    (1/df) Deviance =  422.0928
Pearson          =  15167.03193                    (1/df) Pearson  =  446.0892

Variance function: V(u) =  u                       [Poisson]
Link function    : g(u) =  ln(u)                   [Log]

                                                   AIC             =  405.3292
Log likelihood   = -7293.925939                    BIC             =  14229.32

-------------+----------------------------------------------------------------
             |                 OIM
    casecount |        IRR    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
      electr |     1.00422    .0002765     15.30    0.000      1.003678     1.004762
       _cons |    .0006835    7.19e-06   -693.27    0.000      .0006695     .0006977
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

.
.         glm casecount small_house, offset(lnpop) fam(poi) eform

Iteration 0:   log likelihood = -6400.7219
Iteration 1:   log likelihood = -5928.4542
Iteration 2:   log likelihood = -5928.0875
Iteration 3:   log likelihood = -5928.0875

Generalized linear models                          No. of obs      =        36
Optimization     : ML                              Residual df     =        34
                                                   Scale parameter =         1
Deviance         =  11619.47975                    (1/df) Deviance =  341.7494
Pearson          =  13131.16017                    (1/df) Pearson  =  386.2106

Variance function: V(u) =  u                       [Poisson]
Link function    : g(u) =  ln(u)                   [Log]

                                                   AIC             =  329.4493
Log likelihood   = -5928.087535                    BIC             =  11497.64

-------------+----------------------------------------------------------------
             |                 OIM
    casecount |        IRR    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
 small_house |    1.049349    .0008917     56.69    0.000      1.047603     1.051098
       _cons |    .0003486    6.03e-06   -460.40    0.000       .000337     .0003606
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

.
.         glm casecount large_house, offset(lnpop) fam(poi) eform

Iteration 0:   log likelihood = -6386.8074
Iteration 1:   log likelihood = -5971.9296
Iteration 2:   log likelihood = -5971.6712
Iteration 3:   log likelihood = -5971.6712

Generalized linear models                          No. of obs      =        36
Optimization     : ML                              Residual df     =        34
                                                   Scale parameter =         1
Deviance         =  11706.64714                    (1/df) Deviance =  344.3132
Pearson          =  12583.79795                    (1/df) Pearson  =  370.1117

Variance function: V(u) =  u                       [Poisson]
Link function    : g(u) =  ln(u)                   [Log]

                                                   AIC             =  331.8706
Log likelihood   = -5971.671226                    BIC             =  11584.81

-------------+----------------------------------------------------------------
             |                 OIM
    casecount |        IRR    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
 large_house |    .9671895     .000594    -54.32    0.000       .966026     .9683544
       _cons |    .0052296    .0001827   -150.39    0.000      .0048835     .0056002
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

.
.         glm casecount qual_floor, offset(lnpop) fam(poi) eform

Iteration 0:   log likelihood = -7829.3962
Iteration 1:   log likelihood = -6930.1833
Iteration 2:   log likelihood =  -6928.471
Iteration 3:   log likelihood = -6928.4708

Generalized linear models                          No. of obs      =        36
Optimization     : ML                              Residual df     =        34
                                                   Scale parameter =         1
Deviance         =  13620.24633                    (1/df) Deviance =  400.5955
Pearson          =  14597.48538                    (1/df) Pearson  =  429.3378

Variance function: V(u) =  u                       [Poisson]
Link function    : g(u) =  ln(u)                   [Log]

                                                   AIC             =  385.0262
Log likelihood   = -6928.470825                    BIC             =  13498.41

-------------+----------------------------------------------------------------
             |                 OIM
    casecount |        IRR    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
  qual_floor |    1.022537    .0007075     32.21    0.000      1.021151     1.023924
       _cons |    .0006119    6.70e-06   -675.36    0.000      .0005989     .0006251
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

.
.         glm casecount bad_floor, offset(lnpop) fam(poi) eform

Iteration 0:   log likelihood = -7751.1825
Iteration 1:   log likelihood = -6869.2891
Iteration 2:   log likelihood =   -6866.52
Iteration 3:   log likelihood = -6866.5196

Generalized linear models                          No. of obs      =        36
Optimization     : ML                              Residual df     =        34
                                                   Scale parameter =         1
Deviance         =  13496.34391                    (1/df) Deviance =  396.9513
Pearson          =  14852.41529                    (1/df) Pearson  =  436.8357

Variance function: V(u) =  u                       [Poisson]
Link function    : g(u) =  ln(u)                   [Log]

                                                   AIC             =  381.5844
Log likelihood   = -6866.519616                    BIC             =   13374.5

-------------+----------------------------------------------------------------
             |                 OIM
    casecount |        IRR    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
   bad_floor |    .9890872     .000325    -33.39    0.000      .9884504     .9897244
       _cons |    .0012306    .0000196   -420.54    0.000      .0011928     .0012697
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

.
.         glm casecount tap_water, offset(lnpop) fam(poi) eform

Iteration 0:   log likelihood = -7894.6153
Iteration 1:   log likelihood = -7349.9776
Iteration 2:   log likelihood = -7349.9415
Iteration 3:   log likelihood = -7349.9415

Generalized linear models                          No. of obs      =        36
Optimization     : ML                              Residual df     =        34
                                                   Scale parameter =         1
Deviance         =  14463.18769                    (1/df) Deviance =  425.3879
Pearson          =  15143.19069                    (1/df) Pearson  =   445.388

Variance function: V(u) =  u                       [Poisson]
Link function    : g(u) =  ln(u)                   [Log]

                                                   AIC             =  408.4412
Log likelihood   = -7349.941504                    BIC             =  14341.35

-------------+----------------------------------------------------------------
             |                 OIM
    casecount |        IRR    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
   tap_water |    .9960232    .0003967    -10.00    0.000      .9952459      .996801
       _cons |      .00079    7.39e-06   -763.88    0.000      .0007757     .0008046
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

.
.         glm casecount bad_water, offset(lnpop) fam(poi) eform

Iteration 0:   log likelihood =    -8028.6
Iteration 1:   log likelihood = -7402.9941
Iteration 2:   log likelihood = -7402.8217
Iteration 3:   log likelihood = -7402.8217

Generalized linear models                          No. of obs      =        36
Optimization     : ML                              Residual df     =        34
                                                   Scale parameter =         1
Deviance         =  14568.94805                    (1/df) Deviance =  428.4985
Pearson          =  15378.25228                    (1/df) Pearson  =  452.3015

Variance function: V(u) =  u                       [Poisson]
Link function    : g(u) =  ln(u)                   [Log]

                                                   AIC             =   411.379
Log likelihood   = -7402.821682                    BIC             =  14447.11

-------------+----------------------------------------------------------------
             |                 OIM
    casecount |        IRR    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
   bad_water |    .9993237    .0004397     -1.54    0.124      .9984624     1.000186
       _cons |    .0007663    .0000115   -477.77    0.000      .0007441     .0007892
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

.
.         glm casecount flush_toilet, offset(lnpop) fam(poi) eform

Iteration 0:   log likelihood = -8063.3651
Iteration 1:   log likelihood = -7371.3102
Iteration 2:   log likelihood = -7370.9727
Iteration 3:   log likelihood = -7370.9727

Generalized linear models                          No. of obs      =        36
Optimization     : ML                              Residual df     =        34
                                                   Scale parameter =         1
Deviance         =  14505.25015                    (1/df) Deviance =   426.625
Pearson          =  15381.12441                    (1/df) Pearson  =   452.386

Variance function: V(u) =  u                       [Poisson]
Link function    : g(u) =  ln(u)                   [Log]

                                                   AIC             =  409.6096
Log likelihood   = -7370.972733                    BIC             =  14383.41

-------------+----------------------------------------------------------------
             |                 OIM
    casecount |        IRR    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
flush_toilet |    1.003523     .000427      8.27    0.000      1.002687      1.00436
       _cons |    .0007141    7.40e-06   -699.17    0.000      .0006998     .0007288
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

.
.         glm casecount bad_toilet, offset(lnpop) fam(poi) eform

Iteration 0:   log likelihood = -7130.8652
Iteration 1:   log likelihood = -6198.2398
Iteration 2:   log likelihood =  -6196.518
Iteration 3:   log likelihood = -6196.5179

Generalized linear models                          No. of obs      =        36
Optimization     : ML                              Residual df     =        34
                                                   Scale parameter =         1
Deviance         =   12156.3405                    (1/df) Deviance =  357.5394
Pearson          =  13022.61196                    (1/df) Pearson  =   383.018

Variance function: V(u) =  u                       [Poisson]
Link function    : g(u) =  ln(u)                   [Log]

                                                   AIC             =  344.3621
Log likelihood   = -6196.517911                    BIC             =   12034.5

-------------+----------------------------------------------------------------
             |                 OIM
    casecount |        IRR    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
  bad_toilet |    .9826759    .0003389    -50.67    0.000      .9820118     .9833404
       _cons |    .0017801    .0000311   -362.77    0.000      .0017202      .001842
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

.
.
.         *ALL SHOW EVIDENCE OF DISPERSION WITH (1/DF)DEVIANCE IN THE HUNDREDS
.
.
.
.
.    poisson casecount iwi-density, offset(lnpop)

Iteration 0:   log likelihood = -27886.765
Iteration 1:   log likelihood = -8764.0206
Iteration 2:   log likelihood = -4425.1029
Iteration 3:   log likelihood = -1240.9091
Iteration 4:   log likelihood = -1220.1141
Iteration 5:   log likelihood =  -1220.082
Iteration 6:   log likelihood =  -1220.082

Poisson regression                                Number of obs   =         36
                                                  LR chi2(20)     =   12367.85
                                                  Prob > chi2     =     0.0000
Log likelihood =  -1220.082                       Pseudo R2       =     0.8352

-------------+----------------------------------------------------------------
    casecount |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
         iwi |   -.3686416    .0327173    -11.27    0.000     -.4327663    -.3045169
        edyr |   -5.364139    .3200662    -16.76    0.000     -5.991457    -4.736821
    edyr_fem |    3.363442    .1735875     19.38    0.000      3.023216     3.703667
   edyr_male |    2.775146    .1544045     17.97    0.000      2.472518     3.077773
       urban |   -.0265898    .0025295    -10.51    0.000     -.0315475    -.0216321
    wrk_agri |   -17.12214    .6415687    -26.69    0.000     -18.37959    -15.86469
   wrk_lnagr |   -17.19598    .6426289    -26.76    0.000     -18.45551    -15.93645
   wrk_unagr |   -17.06997    .6390044    -26.71    0.000     -18.32239    -15.81754
          tv |    .0114841    .0141108      0.81    0.416     -.0161726     .0391408
       phone |    .0632342    .0047128     13.42    0.000      .0539972     .0724711
      electr |    .0108893    .0054809      1.99    0.047       .000147     .0216316
 small_house |   -.1641448    .0083753    -19.60    0.000       -.18056    -.1477296
 large_house |   -.0786292     .004206    -18.69    0.000     -.0868727    -.0703856
  qual_floor |    .4762973    .0167512     28.43    0.000      .4434655     .5091292
   bad_floor |   -.0094331    .0033817     -2.79    0.005     -.0160611     -.002805
   tap_water |     .011337    .0054372      2.09    0.037      .0006803     .0219937
   bad_water |   -.0321513    .0024464    -13.14    0.000     -.0369462    -.0273564
flush_toilet |   -.0455427    .0064872     -7.02    0.000     -.0582574    -.0328281
  bad_toilet |   -.0325677    .0020154    -16.16    0.000     -.0365179    -.0286176
     density |   -.0006727    .0000927     -7.26    0.000     -.0008543    -.0004911
       _cons |    1720.241    64.30613     26.75    0.000      1594.203     1846.279
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

.    *all show significant except tv
.
.
.    * backward stepwise
.     * no "forward" at the end means go backward
.         sw poisson casecount iwi-density, offset(lnpop) pr(0.051) pe(0.0499)
                      begin with full model
p = 0.4157 >= 0.0510  removing tv

Poisson regression                                Number of obs   =         36
                                                  LR chi2(19)     =   12367.19
                                                  Prob > chi2     =     0.0000
Log likelihood = -1220.4139                       Pseudo R2       =     0.8352

-------------+----------------------------------------------------------------
    casecount |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
         iwi |   -.3466933    .0184353    -18.81    0.000     -.3828258    -.3105609
        edyr |   -5.292584    .3075724    -17.21    0.000     -5.895414    -4.689753
    edyr_fem |    3.335718    .1701801     19.60    0.000      3.002172     3.669265
   edyr_male |    2.740504    .1483307     18.48    0.000      2.449781     3.031227
       urban |   -.0274757    .0022825    -12.04    0.000     -.0319493    -.0230021
    wrk_agri |   -17.18733    .6362579    -27.01    0.000     -18.43438    -15.94029
   wrk_lnagr |   -17.26136    .6372987    -27.09    0.000     -18.51044    -16.01228
   wrk_unagr |   -17.13876    .6331027    -27.07    0.000     -18.37962     -15.8979
     density |   -.0006305    .0000768     -8.21    0.000     -.0007811      -.00048
       phone |    .0607626    .0035893     16.93    0.000      .0537277     .0677975
      electr |    .0132858    .0046272      2.87    0.004      .0042167     .0223549
 small_house |   -.1601955    .0068199    -23.49    0.000     -.1735623    -.1468287
 large_house |   -.0784533    .0042016    -18.67    0.000     -.0866883    -.0702183
  qual_floor |    .4736941    .0164357     28.82    0.000      .4414808     .5059075
   bad_floor |   -.0083329    .0031065     -2.68    0.007     -.0144215    -.0022442
   tap_water |    .0088912    .0045437      1.96    0.050     -.0000143     .0177966
   bad_water |   -.0308337    .0018246    -16.90    0.000     -.0344097    -.0272576
flush_toilet |    -.044345    .0063242     -7.01    0.000     -.0567403    -.0319497
  bad_toilet |   -.0325685    .0020175    -16.14    0.000     -.0365228    -.0286142
       _cons |    1726.292    63.84639     27.04    0.000      1601.155     1851.429
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

.    *all show significant except tv
.
.
.
.
.
.         *testing for overdispersion. Run the glm framwork with poisson family and
.         *check if dispersion=deviance/df is greater than 1.05 or 1.25 (depending
.                 *on sample size)
.
.
.         glm casecount iwi-wrk_unagr phone-density, offset(lnpop) fam(poi) eform

Iteration 0:   log likelihood = -1907.5896
Iteration 1:   log likelihood = -1252.5769
Iteration 2:   log likelihood = -1220.6706
Iteration 3:   log likelihood = -1220.4139
Iteration 4:   log likelihood = -1220.4139

Generalized linear models                          No. of obs      =        36
Optimization     : ML                              Residual df     =        16
                                                   Scale parameter =         1
Deviance         =  2204.132515                    (1/df) Deviance =  137.7583
Pearson          =  2871.023552                    (1/df) Pearson  =   179.439

Variance function: V(u) =  u                       [Poisson]
Link function    : g(u) =  ln(u)                   [Log]

                                                   AIC             =  68.91188
Log likelihood   = -1220.413916                    BIC             =  2146.796

-------------+----------------------------------------------------------------
             |                 OIM
    casecount |        IRR    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
         iwi |    .7070221    .0130341    -18.81    0.000      .6819317     .7330357
        edyr |    .0050288    .0015467    -17.21    0.000       .002752      .009189
    edyr_fem |    28.09856    4.781815     19.60    0.000       20.1292     39.22307
   edyr_male |    15.49479    2.298353     18.48    0.000      11.58581     20.72264
       urban |    .9728984    .0022206    -12.04    0.000      .9685557     .9772605
    wrk_agri |    3.43e-08    2.18e-08    -27.01    0.000      9.86e-09     1.19e-07
   wrk_lnagr |    3.19e-08    2.03e-08    -27.09    0.000      9.14e-09     1.11e-07
   wrk_unagr |    3.60e-08    2.28e-08    -27.07    0.000      1.04e-08     1.25e-07
       phone |    1.062647    .0038142     16.93    0.000      1.055197     1.070149
      electr |    1.013374    .0046891      2.87    0.004      1.004226     1.022607
 small_house |    .8519772    .0058104    -23.49    0.000      .8406648     .8634419
 large_house |    .9245452    .0038846    -18.67    0.000      .9169629     .9321903
  qual_floor |    1.605916    .0263943     28.82    0.000      1.555008      1.65849
   bad_floor |    .9917017    .0030807     -2.68    0.007       .985682     .9977583
   tap_water |    1.008931    .0045843      1.96    0.050      .9999857     1.017956
   bad_water |    .9696368    .0017692    -16.90    0.000      .9661756     .9731105
flush_toilet |    .9566239    .0060499     -7.01    0.000      .9448395     .9685553
  bad_toilet |    .9679562    .0019529    -16.14    0.000      .9641361     .9717913
     density |    .9993697    .0000768     -8.21    0.000      .9992193     .9995202
       _cons |           .           .     27.04    0.000             .            .
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

.                 *evidence of overdispersion (1/df)deviance=137.8
.
.
.
.
.
.                 *another check of the fit of the model using poisson
.                 *(with density)
.         poisson casecount iwi-wrk_unagr phone-density,  offset(lnpop)

Iteration 0:   log likelihood =  -28091.91
Iteration 1:   log likelihood = -8746.0256
Iteration 2:   log likelihood = -4394.5115
Iteration 3:   log likelihood = -1238.7001
Iteration 4:   log likelihood = -1220.4367
Iteration 5:   log likelihood = -1220.4139
Iteration 6:   log likelihood = -1220.4139

Poisson regression                                Number of obs   =         36
                                                  LR chi2(19)     =   12367.19
                                                  Prob > chi2     =     0.0000
Log likelihood = -1220.4139                       Pseudo R2       =     0.8352

-------------+----------------------------------------------------------------
    casecount |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
         iwi |   -.3466933    .0184353    -18.81    0.000     -.3828258    -.3105609
        edyr |   -5.292584    .3075724    -17.21    0.000     -5.895414    -4.689753
    edyr_fem |    3.335718    .1701801     19.60    0.000      3.002172     3.669265
   edyr_male |    2.740504    .1483307     18.48    0.000      2.449781     3.031227
       urban |   -.0274757    .0022825    -12.04    0.000     -.0319493    -.0230021
    wrk_agri |   -17.18733    .6362579    -27.01    0.000     -18.43438    -15.94029
   wrk_lnagr |   -17.26136    .6372987    -27.09    0.000     -18.51044    -16.01228
   wrk_unagr |   -17.13876    .6331027    -27.07    0.000     -18.37962     -15.8979
       phone |    .0607626    .0035893     16.93    0.000      .0537277     .0677975
      electr |    .0132858    .0046272      2.87    0.004      .0042167     .0223549
 small_house |   -.1601955    .0068199    -23.49    0.000     -.1735623    -.1468287
 large_house |   -.0784533    .0042016    -18.67    0.000     -.0866883    -.0702183
  qual_floor |    .4736941    .0164357     28.82    0.000      .4414808     .5059075
   bad_floor |   -.0083329    .0031065     -2.68    0.007     -.0144215    -.0022442
   tap_water |    .0088912    .0045437      1.96    0.050     -.0000143     .0177966
   bad_water |   -.0308337    .0018246    -16.90    0.000     -.0344097    -.0272576
flush_toilet |    -.044345    .0063242     -7.01    0.000     -.0567403    -.0319497
  bad_toilet |   -.0325685    .0020175    -16.14    0.000     -.0365228    -.0286142
     density |   -.0006305    .0000768     -8.21    0.000     -.0007811      -.00048
       _cons |    1726.292    63.84639     27.04    0.000      1601.155     1851.429
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

.                 estat gof

         Deviance goodness-of-fit  =  2204.125
         Prob > chi2(16)          =    0.0000

         Pearson goodness-of-fit   =  2871.024
         Prob > chi2(16)          =    0.0000

.         estat gof, pearson

         Goodness-of-fit chi2  =  2871.024
         Prob > chi2(16)       =    0.0000

.         estat gof,

         Deviance goodness-of-fit  =  2204.125
         Prob > chi2(16)          =    0.0000

         Pearson goodness-of-fit   =  2871.024
         Prob > chi2(16)          =    0.0000

.                 *though R^2 is .84, reject null hyp for deviance and pearson goodness-of-fit
.         * I think null is that its the right model, so further evidence for
.         *negative binomial model
.
.
.
.
.
.
.                 ***************************************************
.                 *TRY NEGATIVE BINOMIAL
.                 ************************************************************
.
.           *first try univariate models
.
.         glm casecount iwi, offset(lnpop) fam(nb) eform

Iteration 0:   log likelihood = -235.11873
Iteration 1:   log likelihood = -233.94744
Iteration 2:   log likelihood = -233.91997
Iteration 3:   log likelihood = -233.91996

Generalized linear models                          No. of obs      =        36
Optimization     : ML                              Residual df     =        34
                                                   Scale parameter =         1
Deviance         =  53.75728255                    (1/df) Deviance =  1.581097
Pearson          =  38.80755144                    (1/df) Pearson  =  1.141399

Variance function: V(u) =  u+(1)u^2                [Neg. Binomial]
Link function    : g(u) =  ln(u)                   [Log]

                                                   AIC             =  13.10666
Log likelihood   = -233.9199573                    BIC             = -68.08236

-------------+----------------------------------------------------------------
             |                 OIM
    casecount |        IRR    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
         iwi |    1.013879    .0173971      0.80    0.422      .9803483     1.048556
       _cons |    .0004891    .0002355    -15.83    0.000      .0001904     .0012566
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

.
.     glm casecount edyr, offset(lnpop) fam(nb) eform

Iteration 0:   log likelihood = -233.58647
Iteration 1:   log likelihood = -233.33718
Iteration 2:   log likelihood = -233.33247
Iteration 3:   log likelihood = -233.33246

Generalized linear models                          No. of obs      =        36
Optimization     : ML                              Residual df     =        34
                                                   Scale parameter =         1
Deviance         =  52.58229769                    (1/df) Deviance =  1.546538
Pearson          =  39.10100563                    (1/df) Pearson  =   1.15003

Variance function: V(u) =  u+(1)u^2                [Neg. Binomial]
Link function    : g(u) =  ln(u)                   [Log]

                                                   AIC             =  13.07403
Log likelihood   = -233.3324649                    BIC             = -69.25735

-------------+----------------------------------------------------------------
             |                 OIM
    casecount |        IRR    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
        edyr |     1.15184    .1252683      1.30    0.194      .9307219     1.425492
       _cons |    .0004118    .0001781    -18.03    0.000      .0001764     .0009611
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

.
.         glm casecount edyr_fem, offset(lnpop) fam(nb) eform

Iteration 0:   log likelihood = -233.07922
Iteration 1:   log likelihood = -233.03265
Iteration 2:   log likelihood = -233.03242
Iteration 3:   log likelihood = -233.03242

Generalized linear models                          No. of obs      =        36
Optimization     : ML                              Residual df     =        34
                                                   Scale parameter =         1
Deviance         =  51.98221778                    (1/df) Deviance =  1.528889
Pearson          =  38.00680842                    (1/df) Pearson  =  1.117847

Variance function: V(u) =  u+(1)u^2                [Neg. Binomial]
Link function    : g(u) =  ln(u)                   [Log]

                                                   AIC             =  13.05736
Log likelihood   = -233.0324249                    BIC             = -69.85743

-------------+----------------------------------------------------------------
             |                 OIM
    casecount |        IRR    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
    edyr_fem |    1.203137    .1540075      1.44    0.149      .9361753     1.546227
       _cons |    .0004385    .0001542    -21.98    0.000      .0002201     .0008738
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

.
.         glm casecount edyr_male, offset(lnpop) fam(nb) eform

Iteration 0:   log likelihood = -233.75344
Iteration 1:   log likelihood = -233.44086
Iteration 2:   log likelihood = -233.43643
Iteration 3:   log likelihood = -233.43643

Generalized linear models                          No. of obs      =        36
Optimization     : ML                              Residual df     =        34
                                                   Scale parameter =         1
Deviance         =  52.79022977                    (1/df) Deviance =  1.552654
Pearson          =  39.14027588                    (1/df) Pearson  =  1.151185

Variance function: V(u) =  u+(1)u^2                [Neg. Binomial]
Link function    : g(u) =  ln(u)                   [Log]

                                                   AIC             =   13.0798
Log likelihood   = -233.4364309                    BIC             = -69.04941

-------------+----------------------------------------------------------------
             |                 OIM
    casecount |        IRR    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
   edyr_male |    1.129029    .1097471      1.25    0.212      .9331776     1.365986
       _cons |     .000377    .0001946    -15.28    0.000      .0001371     .0010366
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

.
.         glm casecount urban, offset(lnpop) fam(nb) eform

Iteration 0:   log likelihood = -233.75897
Iteration 1:   log likelihood = -233.67501
Iteration 2:   log likelihood = -233.67477
Iteration 3:   log likelihood = -233.67477

Generalized linear models                          No. of obs      =        36
Optimization     : ML                              Residual df     =        34
                                                   Scale parameter =         1
Deviance         =  53.26690164                    (1/df) Deviance =  1.566674
Pearson          =  39.71178603                    (1/df) Pearson  =  1.167994

Variance function: V(u) =  u+(1)u^2                [Neg. Binomial]
Link function    : g(u) =  ln(u)                   [Log]

                                                   AIC             =  13.09304
Log likelihood   = -233.6747668                    BIC             = -68.57274

-------------+----------------------------------------------------------------
             |                 OIM
    casecount |        IRR    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       urban |    1.007187    .0069399      1.04    0.299      .9936761     1.020881
       _cons |    .0005684    .0001472    -28.86    0.000      .0003422     .0009443
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

.
.         glm casecount wrk_agri, offset(lnpop) fam(nb) eform

Iteration 0:   log likelihood = -234.15197
Iteration 1:   log likelihood = -234.08718
Iteration 2:   log likelihood = -234.08703
Iteration 3:   log likelihood = -234.08703

Generalized linear models                          No. of obs      =        36
Optimization     : ML                              Residual df     =        34
                                                   Scale parameter =         1
Deviance         =  54.09143253                    (1/df) Deviance =  1.590924
Pearson          =  38.72670889                    (1/df) Pearson  =  1.139021

Variance function: V(u) =  u+(1)u^2                [Neg. Binomial]
Link function    : g(u) =  ln(u)                   [Log]

                                                   AIC             =  13.11595
Log likelihood   = -234.0870323                    BIC             = -67.74821

-------------+----------------------------------------------------------------
             |                 OIM
    casecount |        IRR    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
    wrk_agri |    .9952174    .0079757     -0.60    0.550      .9797075     1.010973
       _cons |    .0009258    .0004466    -14.48    0.000      .0003597     .0023829
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

.
.         glm casecount wrk_lnagr, offset(lnpop) fam(nb) eform

Iteration 0:   log likelihood = -234.23955
Iteration 1:   log likelihood = -234.20741
Iteration 2:   log likelihood = -234.20738
Iteration 3:   log likelihood = -234.20738

Generalized linear models                          No. of obs      =        36
Optimization     : ML                              Residual df     =        34
                                                   Scale parameter =         1
Deviance         =  54.33213113                    (1/df) Deviance =  1.598004
Pearson          =  38.78412106                    (1/df) Pearson  =  1.140709

Variance function: V(u) =  u+(1)u^2                [Neg. Binomial]
Link function    : g(u) =  ln(u)                   [Log]

                                                   AIC             =  13.12263
Log likelihood   = -234.2073816                    BIC             = -67.50751

-------------+----------------------------------------------------------------
             |                 OIM
    casecount |        IRR    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
   wrk_lnagr |    1.003333    .0093195      0.36    0.720      .9852325     1.021766
       _cons |    .0006285    .0002352    -19.70    0.000      .0003018     .0013087
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

.
.         glm casecount wrk_unagr, offset(lnpop) fam(nb) eform

Iteration 0:   log likelihood = -232.98367
Iteration 1:   log likelihood = -232.96261
Iteration 2:   log likelihood =  -232.9626

Generalized linear models                          No. of obs      =        36
Optimization     : ML                              Residual df     =        34
                                                   Scale parameter =         1
Deviance         =  51.84256952                    (1/df) Deviance =  1.524781
Pearson          =  38.87504785                    (1/df) Pearson  =  1.143384

Variance function: V(u) =  u+(1)u^2                [Neg. Binomial]
Link function    : g(u) =  ln(u)                   [Log]

                                                   AIC             =  13.05348
Log likelihood   = -232.9626008                    BIC             = -69.99707

-------------+----------------------------------------------------------------
             |                 OIM
    casecount |        IRR    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
   wrk_unagr |    1.073375    .0499931      1.52    0.128      .9797299     1.175972
       _cons |    .0004031    .0001557    -20.23    0.000      .0001891     .0008595
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

.
.         glm casecount tv, offset(lnpop) fam(nb) eform

Iteration 0:   log likelihood = -234.57368
Iteration 1:   log likelihood = -233.95367
Iteration 2:   log likelihood = -233.94563
Iteration 3:   log likelihood = -233.94562

Generalized linear models                          No. of obs      =        36
Optimization     : ML                              Residual df     =        34
                                                   Scale parameter =         1
Deviance         =  53.80861408                    (1/df) Deviance =  1.582606
Pearson          =   39.3721356                    (1/df) Pearson  =  1.158004

Variance function: V(u) =  u+(1)u^2                [Neg. Binomial]
Link function    : g(u) =  ln(u)                   [Log]

                                                   AIC             =  13.10809
Log likelihood   = -233.9456231                    BIC             = -68.03103

-------------+----------------------------------------------------------------
             |                 OIM
    casecount |        IRR    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
          tv |    1.008408    .0109876      0.77    0.442      .9871014     1.030175
       _cons |    .0006376    .0001342    -34.96    0.000      .0004221     .0009631
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

.
.         glm casecount density, offset(lnpop) fam(nb) eform

Iteration 0:   log likelihood = -233.95286
Iteration 1:   log likelihood = -233.78228
Iteration 2:   log likelihood = -233.78139
Iteration 3:   log likelihood = -233.78139

Generalized linear models                          No. of obs      =        36
Optimization     : ML                              Residual df     =        34
                                                   Scale parameter =         1
Deviance         =  53.48015356                    (1/df) Deviance =  1.572946
Pearson          =  39.24892679                    (1/df) Pearson  =   1.15438

Variance function: V(u) =  u+(1)u^2                [Neg. Binomial]
Link function    : g(u) =  ln(u)                   [Log]

                                                   AIC             =  13.09897
Log likelihood   = -233.7813928                    BIC             = -68.35949

-------------+----------------------------------------------------------------
             |                 OIM
    casecount |        IRR    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
     density |    1.000223    .0002484      0.90    0.370      .9997358      1.00071
       _cons |    .0006629     .000118    -41.13    0.000      .0004677     .0009395
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

.
.         glm casecount phone, offset(lnpop) fam(nb) eform

Iteration 0:   log likelihood = -235.27578
Iteration 1:   log likelihood = -233.42896
Iteration 2:   log likelihood = -233.38145
Iteration 3:   log likelihood = -233.38142
Iteration 4:   log likelihood = -233.38142

Generalized linear models                          No. of obs      =        36
Optimization     : ML                              Residual df     =        34
                                                   Scale parameter =         1
Deviance         =  52.68019888                    (1/df) Deviance =  1.549418
Pearson          =   35.6272832                    (1/df) Pearson  =  1.047861

Variance function: V(u) =  u+(1)u^2                [Neg. Binomial]
Link function    : g(u) =  ln(u)                   [Log]

                                                   AIC             =  13.07675
Log likelihood   = -233.3814155                    BIC             = -69.15945

-------------+----------------------------------------------------------------
             |                 OIM
    casecount |        IRR    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       phone |    1.014194    .0110347      1.30    0.195      .9927957     1.036054
       _cons |    .0003096    .0001992    -12.56    0.000      .0000877      .001093
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

.
.         glm casecount electr, offset(lnpop) fam(nb) eform

Iteration 0:   log likelihood = -234.54528
Iteration 1:   log likelihood = -234.05152
Iteration 2:   log likelihood = -234.04517
Iteration 3:   log likelihood = -234.04517

Generalized linear models                          No. of obs      =        36
Optimization     : ML                              Residual df     =        34
                                                   Scale parameter =         1
Deviance         =  54.00770573                    (1/df) Deviance =  1.588462
Pearson          =  39.20111053                    (1/df) Pearson  =  1.152974

Variance function: V(u) =  u+(1)u^2                [Neg. Binomial]
Link function    : g(u) =  ln(u)                   [Log]

                                                   AIC             =  13.11362
Log likelihood   = -234.0451689                    BIC             = -67.83194

-------------+----------------------------------------------------------------
             |                 OIM
    casecount |        IRR    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
      electr |    1.006697    .0104744      0.64    0.521      .9863752     1.027437
       _cons |    .0006614    .0001289    -37.55    0.000      .0004514     .0009692
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

.
.         glm casecount small_house, offset(lnpop) fam(nb) eform

Iteration 0:   log likelihood = -234.76018
Iteration 1:   log likelihood = -234.19784
Iteration 2:   log likelihood = -234.18762
Iteration 3:   log likelihood = -234.18762

Generalized linear models                          No. of obs      =        36
Optimization     : ML                              Residual df     =        34
                                                   Scale parameter =         1
Deviance         =  54.29260201                    (1/df) Deviance =  1.596841
Pearson          =  39.17875628                    (1/df) Pearson  =  1.152316

Variance function: V(u) =  u+(1)u^2                [Neg. Binomial]
Link function    : g(u) =  ln(u)                   [Log]

                                                   AIC             =  13.12153
Log likelihood   =  -234.187617                    BIC             = -67.54704

-------------+----------------------------------------------------------------
             |                 OIM
    casecount |        IRR    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
 small_house |    1.008964     .022071      0.41    0.683      .9666204     1.053163
       _cons |    .0006165    .0002335    -19.52    0.000      .0002935     .0012951
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

.
.         glm casecount large_house, offset(lnpop) fam(nb) eform

Iteration 0:   log likelihood = -234.37284
Iteration 1:   log likelihood = -233.93407
Iteration 2:   log likelihood = -233.93037
Iteration 3:   log likelihood = -233.93037

Generalized linear models                          No. of obs      =        36
Optimization     : ML                              Residual df     =        34
                                                   Scale parameter =         1
Deviance         =   53.7781004                    (1/df) Deviance =  1.581709
Pearson          =  38.57396174                    (1/df) Pearson  =  1.134528

Variance function: V(u) =  u+(1)u^2                [Neg. Binomial]
Link function    : g(u) =  ln(u)                   [Log]

                                                   AIC             =  13.10724
Log likelihood   = -233.9303662                    BIC             = -68.06154

-------------+----------------------------------------------------------------
             |                 OIM
    casecount |        IRR    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
 large_house |    .9887581    .0136379     -0.82    0.412      .9623863     1.015853
       _cons |     .001352    .0011017     -8.11    0.000      .0002738     .0066769
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

.
.         glm casecount qual_floor, offset(lnpop) fam(nb) eform

Iteration 0:   log likelihood = -233.81007
Iteration 1:   log likelihood = -233.55295
Iteration 2:   log likelihood = -233.55147
Iteration 3:   log likelihood = -233.55147

Generalized linear models                          No. of obs      =        36
Optimization     : ML                              Residual df     =        34
                                                   Scale parameter =         1
Deviance         =  53.02030393                    (1/df) Deviance =  1.559421
Pearson          =  39.54753743                    (1/df) Pearson  =  1.163163

Variance function: V(u) =  u+(1)u^2                [Neg. Binomial]
Link function    : g(u) =  ln(u)                   [Log]

                                                   AIC             =  13.08619
Log likelihood   =  -233.551468                    BIC             = -68.81934

-------------+----------------------------------------------------------------
             |                 OIM
    casecount |        IRR    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
  qual_floor |    1.030669    .0281258      1.11    0.268      .9769915     1.087295
       _cons |    .0006118    .0001245    -36.36    0.000      .0004106     .0009117
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

.
.         glm casecount bad_floor, offset(lnpop) fam(nb) eform

Iteration 0:   log likelihood = -235.11667
Iteration 1:   log likelihood = -233.37406
Iteration 2:   log likelihood =  -233.3287
Iteration 3:   log likelihood = -233.32864
Iteration 4:   log likelihood = -233.32864

Generalized linear models                          No. of obs      =        36
Optimization     : ML                              Residual df     =        34
                                                   Scale parameter =         1
Deviance         =   52.5746577                    (1/df) Deviance =  1.546313
Pearson          =  38.26397932                    (1/df) Pearson  =  1.125411

Variance function: V(u) =  u+(1)u^2                [Neg. Binomial]
Link function    : g(u) =  ln(u)                   [Log]

                                                   AIC             =  13.07381
Log likelihood   = -233.3286449                    BIC             = -69.26499

-------------+----------------------------------------------------------------
             |                 OIM
    casecount |        IRR    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
   bad_floor |     .988833    .0084834     -1.31    0.191      .9723448     1.005601
       _cons |    .0013668    .0007472    -12.06    0.000      .0004681     .0039909
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

.
.         glm casecount tap_water, offset(lnpop) fam(nb) eform

Iteration 0:   log likelihood = -234.50605
Iteration 1:   log likelihood = -234.25125
Iteration 2:   log likelihood = -234.24974
Iteration 3:   log likelihood = -234.24974

Generalized linear models                          No. of obs      =        36
Optimization     : ML                              Residual df     =        34
                                                   Scale parameter =         1
Deviance         =  54.41685758                    (1/df) Deviance =  1.600496
Pearson          =  38.92474605                    (1/df) Pearson  =  1.144845

Variance function: V(u) =  u+(1)u^2                [Neg. Binomial]
Link function    : g(u) =  ln(u)                   [Log]

                                                   AIC             =  13.12499
Log likelihood   = -234.2497448                    BIC             = -67.42279

-------------+----------------------------------------------------------------
             |                 OIM
    casecount |        IRR    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
   tap_water |    .9970895    .0132202     -0.22    0.826      .9715122      1.02334
       _cons |    .0007205    .0001306    -39.92    0.000       .000505     .0010278
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

.
.         glm casecount bad_water, offset(lnpop) fam(nb) eform

Iteration 0:   log likelihood = -234.68064
Iteration 1:   log likelihood = -234.25474
Iteration 2:   log likelihood = -234.25211
Iteration 3:   log likelihood = -234.25211

Generalized linear models                          No. of obs      =        36
Optimization     : ML                              Residual df     =        34
                                                   Scale parameter =         1
Deviance         =  54.42159171                    (1/df) Deviance =  1.600635
Pearson          =  39.35797755                    (1/df) Pearson  =  1.157588

Variance function: V(u) =  u+(1)u^2                [Neg. Binomial]
Link function    : g(u) =  ln(u)                   [Log]

                                                   AIC             =  13.12512
Log likelihood   = -234.2521119                    BIC             = -67.41805

-------------+----------------------------------------------------------------
             |                 OIM
    casecount |        IRR    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
   bad_water |    .9982944    .0083995     -0.20    0.839      .9819667     1.014894
       _cons |    .0007571    .0002735    -19.89    0.000      .0003729      .001537
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

.
.         glm casecount flush_toilet, offset(lnpop) fam(nb) eform

Iteration 0:   log likelihood = -234.50524
Iteration 1:   log likelihood = -233.93552
Iteration 2:   log likelihood = -233.92966
Iteration 3:   log likelihood = -233.92966

Generalized linear models                          No. of obs      =        36
Optimization     : ML                              Residual df     =        34
                                                   Scale parameter =         1
Deviance         =  53.77668953                    (1/df) Deviance =  1.581667
Pearson          =  39.69458605                    (1/df) Pearson  =  1.167488

Variance function: V(u) =  u+(1)u^2                [Neg. Binomial]
Link function    : g(u) =  ln(u)                   [Log]

                                                   AIC             =   13.1072
Log likelihood   = -233.9296608                    BIC             = -68.06295

-------------+----------------------------------------------------------------
             |                 OIM
    casecount |        IRR    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
flush_toilet |    1.011245    .0143287      0.79    0.430      .9835475     1.039722
       _cons |    .0006475    .0001276    -37.26    0.000        .00044     .0009528
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

.
.         glm casecount bad_toilet, offset(lnpop) fam(nb) eform

Iteration 0:   log likelihood = -232.45998
Iteration 1:   log likelihood = -231.17489
Iteration 2:   log likelihood = -231.15008
Iteration 3:   log likelihood = -231.15007

Generalized linear models                          No. of obs      =        36
Optimization     : ML                              Residual df     =        34
                                                   Scale parameter =         1
Deviance         =  48.21750898                    (1/df) Deviance =  1.418162
Pearson          =  36.18813142                    (1/df) Pearson  =  1.064357

Variance function: V(u) =  u+(1)u^2                [Neg. Binomial]
Link function    : g(u) =  ln(u)                   [Log]

                                                   AIC             =  12.95278
Log likelihood   = -231.1500705                    BIC             = -73.62213

-------------+----------------------------------------------------------------
             |                 OIM
    casecount |        IRR    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
  bad_toilet |     .973657    .0109521     -2.37    0.018      .9524262      .995361
       _cons |    .0033511    .0023797     -8.02    0.000      .0008331     .0134791
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

.
.         *only bad_toilet shows significant
.
.
.
.
.
.
.                 *tried negative binomial with all variables found significant in poisson runs above
.
.                  nbreg casecount iwi-wrk_unagr phone-density, offset(lnpop)

Fitting Poisson model:

Iteration 0:   log likelihood =  -28091.91
Iteration 1:   log likelihood = -8746.0256
Iteration 2:   log likelihood = -4394.5115
Iteration 3:   log likelihood = -1238.7001
Iteration 4:   log likelihood = -1220.4367
Iteration 5:   log likelihood = -1220.4139
Iteration 6:   log likelihood = -1220.4139

Fitting constant-only model:

Iteration 0:   log likelihood = -234.32979
Iteration 1:   log likelihood = -233.46703
Iteration 2:   log likelihood = -233.46636
Iteration 3:   log likelihood = -233.46636

Fitting full model:

Iteration 0:   log likelihood = -232.20763
Iteration 1:   log likelihood = -223.09368
Iteration 2:   log likelihood = -220.78868
Iteration 3:   log likelihood = -220.64793
Iteration 4:   log likelihood = -220.64751
Iteration 5:   log likelihood = -220.64751

Negative binomial regression                      Number of obs   =         36
                                                  LR chi2(19)     =      25.64
Dispersion     = mean                             Prob > chi2     =     0.1406
Log likelihood = -220.64751                       Pseudo R2       =     0.0549

-------------+----------------------------------------------------------------
    casecount |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
         iwi |   -.4710929    .2574986     -1.83    0.067     -.9757808     .0335951
        edyr |    2.119375    3.902538      0.54    0.587     -5.529459     9.768209
    edyr_fem |   -.8695486    1.997368     -0.44    0.663     -4.784317      3.04522
   edyr_male |   -.6124347    1.871475     -0.33    0.743     -4.280458     3.055589
       urban |   -.0703929    .0340338     -2.07    0.039     -.1370979    -.0036879
    wrk_agri |   -4.979431    7.452592     -0.67    0.504     -19.58624     9.627381
   wrk_lnagr |   -5.046463    7.448741     -0.68    0.498     -19.64573     9.552802
   wrk_unagr |   -5.117121    7.416112     -0.69    0.490     -19.65243     9.418192
       phone |    .0646616    .0576019      1.12    0.262      -.048236     .1775591
      electr |    .0487135    .0724835      0.67    0.502     -.0933515     .1907786
 small_house |    .0317443    .0817817      0.39    0.698     -.1285449     .1920335
 large_house |    .0495801    .0554973      0.89    0.372     -.0591926     .1583529
  qual_floor |    .1039166    .2241277      0.46    0.643     -.3353657     .5431988
   bad_floor |    -.044485       .0393     -1.13    0.258     -.1215116     .0325416
   tap_water |   -.0535758    .0626711     -0.85    0.393     -.1764088     .0692573
   bad_water |    -.039745    .0277554     -1.43    0.152     -.0941445     .0146545
flush_toilet |    .1585486    .0986482      1.61    0.108     -.0347982     .3518954
  bad_toilet |   -.0666599    .0274015     -2.43    0.015     -.1203659     -.012954
     density |     .002046     .001306      1.57    0.117     -.0005137     .0046058
       _cons |     504.533    746.4404      0.68    0.499     -958.4633     1967.529
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------
    /lnalpha |   -.3269479    .2226004                   -.7632366     .1093408
-------------+----------------------------------------------------------------
        alpha |   .7211213    .1605219                    .4661552     1.115543
-------------+----------------------------------------------------------------
Likelihood-ratio test of alpha=0:  chibar2(01) = 1999.53 Prob>=chibar2 = 0.000

.                  *only urban and bad toilet show significant, iwi boarderline at .067 all others not
.
.
.         *since these results conflicted with about results from poisson I
.         *decided to run the stepwise variable selection techniques on a
.         *negative binomial model
.
.
.
.
.    * backward stepwise
.     * no "forward" at the end means go backward
.         sw nbreg casecount iwi-density, offset(lnpop) pr(0.051) pe(0.0499)
                      begin with full model
p = 0.9425 >= 0.0510  removing tv
p = 0.7435 >= 0.0510  removing edyr_male
p = 0.7513 >= 0.0510  removing edyr_fem
p = 0.7512 >= 0.0510  removing qual_floor
p = 0.5324 >= 0.0510  removing wrk_agri
p = 0.4105 >= 0.0510  removing small_house
p = 0.4626 >= 0.0510  removing large_house
p = 0.5350 >= 0.0510  removing phone
p = 0.5217 >= 0.0510  removing electr
p = 0.3802 >= 0.0510  removing bad_water
p = 0.2902 >= 0.0510  removing tap_water
p = 0.1521 >= 0.0510  removing wrk_unagr
p = 0.2415 >= 0.0510  removing flush_toilet
p = 0.2634 >= 0.0510  removing density
p = 0.1610 >= 0.0510  removing bad_floor
p = 0.3334 >= 0.0510  removing iwi

Negative binomial regression                      Number of obs   =         36
                                                  LR chi2(4)      =      13.69
Dispersion     = mean                             Prob > chi2     =     0.0083
Log likelihood = -226.61982                       Pseudo R2       =     0.0293

-------------+----------------------------------------------------------------
    casecount |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       urban |   -.0473465    .0172846     -2.74    0.006     -.0812237    -.0134693
        edyr |    .8202669    .2872383      2.86    0.004      .2572901     1.383244
   wrk_lnagr |    -.039522     .017866     -2.21    0.027     -.0745387    -.0045053
  bad_toilet |   -.0507212    .0149021     -3.40    0.001     -.0799288    -.0215137
       _cons |   -4.573399    1.186842     -3.85    0.000     -6.899566    -2.247232
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------
    /lnalpha |    -.048662    .2146521                   -.4693724     .3720483
-------------+----------------------------------------------------------------
        alpha |    .952503    .2044568                    .6253946     1.450703
-------------+----------------------------------------------------------------
Likelihood-ratio test of alpha=0:  chibar2(01) = 6994.33 Prob>=chibar2 = 0.000

.    *urban, edyr, bad_toilet, wrk_lnagr show significant
.
.      * forward
.         sw nbreg casecount iwi-density, offset(lnpop) pr(0.051) pe(0.0499) forward
                      begin with empty model
p = 0.0271 <  0.0499  adding   bad_toilet
p = 0.0111 <  0.0499  adding   tap_water

Negative binomial regression                      Number of obs   =         36
                                                  LR chi2(2)      =       9.41
Dispersion     = mean                             Prob > chi2     =     0.0090
Log likelihood = -228.75983                       Pseudo R2       =     0.0202

-------------+----------------------------------------------------------------
    casecount |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
  bad_toilet |   -.0424248     .013516     -3.14    0.002     -.0689157     -.015934
   tap_water |   -.0380413    .0149883     -2.54    0.011     -.0674178    -.0086648
       _cons |    -4.59737    .9026293     -5.09    0.000     -6.366491    -2.828249
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------
    /lnalpha |    .0491131    .2115693                   -.3655551     .4637812
-------------+----------------------------------------------------------------
        alpha |   1.050339    .2222195                    .6938114     1.590075
-------------+----------------------------------------------------------------
Likelihood-ratio test of alpha=0:  chibar2(01) = 7056.43 Prob>=chibar2 = 0.000

.    *bad_toilet and tap_water significant
.
.    sw nbreg casecount (density) iwi-bad_toilet, offset(lnpop) pr(0.051) pe(0.0499) lockterm1
                      begin with full model
p = 0.9425 >= 0.0510  removing tv
p = 0.7435 >= 0.0510  removing edyr_male
p = 0.7513 >= 0.0510  removing edyr_fem
p = 0.7512 >= 0.0510  removing qual_floor
p = 0.5324 >= 0.0510  removing wrk_agri
p = 0.4105 >= 0.0510  removing small_house
p = 0.4626 >= 0.0510  removing large_house
p = 0.5350 >= 0.0510  removing phone
p = 0.5217 >= 0.0510  removing electr
p = 0.3802 >= 0.0510  removing bad_water
p = 0.2902 >= 0.0510  removing tap_water
p = 0.1521 >= 0.0510  removing wrk_unagr
p = 0.2415 >= 0.0510  removing flush_toilet
p = 0.0801 >= 0.0510  removing bad_floor
p = 0.2967 >= 0.0510  removing iwi

Negative binomial regression                      Number of obs   =         36
                                                  LR chi2(5)      =      13.71
Dispersion     = mean                             Prob > chi2     =     0.0175
Log likelihood = -226.60905                       Pseudo R2       =     0.0294

-------------+----------------------------------------------------------------
    casecount |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
     density |    .0000549    .0003752      0.15    0.884     -.0006804     .0007902
       urban |    -.048209    .0182457     -2.64    0.008     -.0839699    -.0124482
        edyr |    .8284819    .2923417      2.83    0.005      .2555028     1.401461
  bad_toilet |   -.0500036    .0156523     -3.19    0.001     -.0806816    -.0193256
   wrk_lnagr |   -.0404801    .0190276     -2.13    0.033     -.0777736    -.0031867
       _cons |   -4.602094    1.199394     -3.84    0.000     -6.952862    -2.251326
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------
    /lnalpha |   -.0491525    .2146661                   -.4698903     .3715853
-------------+----------------------------------------------------------------
        alpha |   .9520359    .2043698                    .6250708     1.450032
-------------+----------------------------------------------------------------
Likelihood-ratio test of alpha=0:  chibar2(01) = 6993.33 Prob>=chibar2 = 0.000

.    *tried backwords locking density , stil not significant
.    *urban, edyr, bad_toilet and wrk_lnagr are though
.
.
.    *try forward with locking density
.    sw nbreg casecount (density) iwi-bad_toilet, offset(lnpop) pr(0.051) pe(0.0499) forward lockterm1
                      begin with term 1 model
p = 0.0209 <  0.0499  adding   bad_toilet
p = 0.0218 <  0.0499  adding   electr

Negative binomial regression                      Number of obs   =         36
                                                  LR chi2(3)      =      10.14
Dispersion     = mean                             Prob > chi2     =     0.0174
Log likelihood = -228.39628                       Pseudo R2       =     0.0217

-------------+----------------------------------------------------------------
    casecount |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
     density |    .0006724    .0005471      1.23    0.219     -.0003999     .0017447
  bad_toilet |    -.049959    .0154926     -3.22    0.001      -.080324     -.019594
      electr |   -.0607522    .0264924     -2.29    0.022     -.1126764    -.0088281
       _cons |   -3.926738    1.085763     -3.62    0.000     -6.054794    -1.798682
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------
    /lnalpha |    .0326756    .2120753                   -.3829843     .4483354
-------------+----------------------------------------------------------------
        alpha |   1.033215    .2191194                    .6818236     1.565704
-------------+----------------------------------------------------------------
Likelihood-ratio test of alpha=0:  chibar2(01) = 6792.52 Prob>=chibar2 = 0.000

.    *forced density in and still isnt significant
.    *bad_toilet and electr are significant
.
.
.
.
.   *testing all found signfinicant above
.   *urban, edyr, bad_toilet, wrk_lnagr tap_water
.   nbreg casecount urban edyr bad_toilet wrk_lnagr tap_water electr, offset(lnpop)

Fitting Poisson model:

Iteration 0:   log likelihood = -11550.395
Iteration 1:   log likelihood = -4239.7738
Iteration 2:   log likelihood = -2658.1984
Iteration 3:   log likelihood = -2643.4234
Iteration 4:   log likelihood = -2643.3849
Iteration 5:   log likelihood = -2643.3849

Fitting constant-only model:

Iteration 0:   log likelihood = -234.32979
Iteration 1:   log likelihood = -233.46703
Iteration 2:   log likelihood = -233.46636
Iteration 3:   log likelihood = -233.46636

Fitting full model:

Iteration 0:   log likelihood = -227.73339
Iteration 1:   log likelihood =  -227.1296
Iteration 2:   log likelihood = -225.53398
Iteration 3:   log likelihood = -225.52822
Iteration 4:   log likelihood = -225.52822

Negative binomial regression                      Number of obs   =         36
                                                  LR chi2(6)      =      15.88
Dispersion     = mean                             Prob > chi2     =     0.0144
Log likelihood = -225.52822                       Pseudo R2       =     0.0340

-------------+----------------------------------------------------------------
    casecount |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       urban |   -.0456893    .0190059     -2.40    0.016     -.0829402    -.0084385
        edyr |    .7945787    .3052334      2.60    0.009      .1963322     1.392825
  bad_toilet |   -.0498618    .0167767     -2.97    0.003     -.0827436      -.01698
   wrk_lnagr |    -.040661    .0209622     -1.94    0.052     -.0817461      .000424
   tap_water |   -.0462569    .0337357     -1.37    0.170     -.1123778     .0198639
      electr |    .0279996    .0367311      0.76    0.446     -.0439921     .0999912
       _cons |   -4.591573    1.263872     -3.63    0.000     -7.068716     -2.11443
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------
    /lnalpha |   -.0992341    .2162535                   -.5230831      .324615
-------------+----------------------------------------------------------------
        alpha |   .9055307    .1958242                    .5926904     1.383498
-------------+----------------------------------------------------------------
Likelihood-ratio test of alpha=0:  chibar2(01) = 4835.71 Prob>=chibar2 = 0.000

.    *tap water and electr not significant, all other are sig
.
.   *urban, edyr, bad_toilet, wrk_lnagr
.   nbreg casecount urban edyr bad_toilet wrk_lnagr, offset(lnpop)

Fitting Poisson model:

Iteration 0:   log likelihood = -4000.5639
Iteration 1:   log likelihood =  -3724.053
Iteration 2:   log likelihood = -3723.7857
Iteration 3:   log likelihood = -3723.7857

Fitting constant-only model:

Iteration 0:   log likelihood = -234.32979
Iteration 1:   log likelihood = -233.46703
Iteration 2:   log likelihood = -233.46636
Iteration 3:   log likelihood = -233.46636

Fitting full model:

Iteration 0:   log likelihood = -228.77878
Iteration 1:   log likelihood = -226.66235
Iteration 2:   log likelihood = -226.61986
Iteration 3:   log likelihood = -226.61982
Iteration 4:   log likelihood = -226.61982

Negative binomial regression                      Number of obs   =         36
                                                  LR chi2(4)      =      13.69
Dispersion     = mean                             Prob > chi2     =     0.0083
Log likelihood = -226.61982                       Pseudo R2       =     0.0293

-------------+----------------------------------------------------------------
    casecount |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       urban |   -.0473465    .0172846     -2.74    0.006     -.0812237    -.0134693
        edyr |    .8202669    .2872383      2.86    0.004      .2572901     1.383244
  bad_toilet |   -.0507212    .0149021     -3.40    0.001     -.0799288    -.0215137
   wrk_lnagr |    -.039522     .017866     -2.21    0.027     -.0745387    -.0045053
       _cons |   -4.573399    1.186842     -3.85    0.000     -6.899566    -2.247232
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------
    /lnalpha |    -.048662    .2146521                   -.4693724     .3720483
-------------+----------------------------------------------------------------
        alpha |    .952503    .2044568                    .6253946     1.450703
-------------+----------------------------------------------------------------
Likelihood-ratio test of alpha=0:  chibar2(01) = 6994.33 Prob>=chibar2 = 0.000

.    *all significant with good sign except urban has a negative sign (-.047)
.
.
.   *force in density
.   nbreg casecount urban edyr bad_toilet wrk_lnagr density, offset(lnpop)

Fitting Poisson model:

Iteration 0:   log likelihood = -5110.9031
Iteration 1:   log likelihood = -3734.9746
Iteration 2:   log likelihood = -3723.2804
Iteration 3:   log likelihood = -3723.2727
Iteration 4:   log likelihood = -3723.2727

Fitting constant-only model:

Iteration 0:   log likelihood = -234.32979
Iteration 1:   log likelihood = -233.46703
Iteration 2:   log likelihood = -233.46636
Iteration 3:   log likelihood = -233.46636

Fitting full model:

Iteration 0:   log likelihood = -228.76293
Iteration 1:   log likelihood = -226.65268
Iteration 2:   log likelihood = -226.60909
Iteration 3:   log likelihood = -226.60905
Iteration 4:   log likelihood = -226.60905

Negative binomial regression                      Number of obs   =         36
                                                  LR chi2(5)      =      13.71
Dispersion     = mean                             Prob > chi2     =     0.0175
Log likelihood = -226.60905                       Pseudo R2       =     0.0294

-------------+----------------------------------------------------------------
    casecount |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       urban |    -.048209    .0182457     -2.64    0.008     -.0839699    -.0124482
        edyr |     .828482    .2923417      2.83    0.005      .2555028     1.401461
  bad_toilet |   -.0500036    .0156523     -3.19    0.001     -.0806816    -.0193256
   wrk_lnagr |   -.0404801    .0190276     -2.13    0.033     -.0777736    -.0031867
     density |    .0000549    .0003752      0.15    0.884     -.0006804     .0007902
       _cons |   -4.602094    1.199394     -3.84    0.000     -6.952863    -2.251326
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------
    /lnalpha |   -.0491523    .2146661                   -.4698901     .3715855
-------------+----------------------------------------------------------------
        alpha |   .9520361    .2043699                    .6250709     1.450032
-------------+----------------------------------------------------------------
Likelihood-ratio test of alpha=0:  chibar2(01) = 6993.33 Prob>=chibar2 = 0.000

.   *all significant, density not even close at .884
.
.
.   **************************************************
.    *based on above and below I try interactions with
.    *urban, edyr, bad_toilet, wrklnagr
. **********************************************************
.
. *TESTING INTERACTIONS*
.
.
. gen urban_edyr = urban*edyr

. gen urban_badtoilet = urban*bad_toilet

. gen urban_wrklnagr = urban*wrk_lnagr

.
.
. gen edyr_badtoilet = edyr*bad_toilet

. gen edyr_wrklnagr = edyr*wrk_lnagr

.
.
. gen badtoilet_wrklnagr = bad_toilet*wrk_lnagr

.
.
.
.
. nbreg casecount urban_edyr urban edyr bad_toilet wrk_lnagr, offset(lnpop)

Fitting Poisson model:

Iteration 0:   log likelihood = -5111.2781
Iteration 1:   log likelihood = -3735.8369
Iteration 2:   log likelihood = -3723.7681
Iteration 3:   log likelihood = -3723.7619
Iteration 4:   log likelihood = -3723.7619

Fitting constant-only model:

Iteration 0:   log likelihood = -234.32979
Iteration 1:   log likelihood = -233.46703
Iteration 2:   log likelihood = -233.46636
Iteration 3:   log likelihood = -233.46636

Fitting full model:

Iteration 0:   log likelihood = -228.77693
Iteration 1:   log likelihood = -226.65929
Iteration 2:   log likelihood = -226.61689
Iteration 3:   log likelihood = -226.61685
Iteration 4:   log likelihood = -226.61685

Negative binomial regression                      Number of obs   =         36
                                                  LR chi2(5)      =      13.70
Dispersion     = mean                             Prob > chi2     =     0.0176
Log likelihood = -226.61685                       Pseudo R2       =     0.0293

-------------+----------------------------------------------------------------
    casecount |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
  urban_edyr |    .0003319    .0043118      0.08    0.939     -.0081191     .0087829
       urban |   -.0491978    .0295949     -1.66    0.096     -.1072027      .008807
        edyr |    .8124492    .3045632      2.67    0.008      .2155162     1.409382
  bad_toilet |   -.0505205    .0151015     -3.35    0.001      -.080119    -.0209221
   wrk_lnagr |   -.0399731    .0188143     -2.12    0.034     -.0768484    -.0030979
       _cons |   -4.534071    1.291269     -3.51    0.000     -7.064911     -2.00323
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------
    /lnalpha |   -.0488005    .2146567                     -.46952     .3719189
-------------+----------------------------------------------------------------
        alpha |   .9523711    .2044328                    .6253024     1.450515
-------------+----------------------------------------------------------------
Likelihood-ratio test of alpha=0:  chibar2(01) = 6994.29 Prob>=chibar2 = 0.000

. *urvan_edyr not sig
.
. nbreg casecount urban_badtoilet urban edyr bad_toilet wrk_lnagr, offset(lnpop)

Fitting Poisson model:

Iteration 0:   log likelihood = -4881.3229
Iteration 1:   log likelihood = -3591.0542
Iteration 2:   log likelihood = -3581.5901
Iteration 3:   log likelihood =  -3581.584
Iteration 4:   log likelihood =  -3581.584

Fitting constant-only model:

Iteration 0:   log likelihood = -234.32979
Iteration 1:   log likelihood = -233.46703
Iteration 2:   log likelihood = -233.46636
Iteration 3:   log likelihood = -233.46636

Fitting full model:

Iteration 0:   log likelihood = -228.80483
Iteration 1:   log likelihood = -226.66804
Iteration 2:   log likelihood = -226.60909
Iteration 3:   log likelihood = -226.60894
Iteration 4:   log likelihood = -226.60894

Negative binomial regression                      Number of obs   =         36
                                                  LR chi2(5)      =      13.71
Dispersion     = mean                             Prob > chi2     =     0.0175
Log likelihood = -226.60894                       Pseudo R2       =     0.0294

----------------+----------------------------------------------------------------
       casecount |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
----------------+----------------------------------------------------------------
urban_badtoilet |   -.0000597    .0004055     -0.15    0.883     -.0008544      .000735
          urban |   -.0443583    .0266975     -1.66    0.097     -.0966844     .0079677
           edyr |    .8242808    .2884105      2.86    0.004      .2590067     1.389555
     bad_toilet |   -.0485583    .0209007     -2.32    0.020      -.089523    -.0075936
      wrk_lnagr |   -.0409994    .0205088     -2.00    0.046     -.0811958    -.0008029
          _cons |   -4.666637     1.34118     -3.48    0.001     -7.295301    -2.037972
           lnpop |          1   (offset)
----------------+----------------------------------------------------------------
       /lnalpha |   -.0491544    .2146654                   -.4698908     .3715819
----------------+----------------------------------------------------------------
           alpha |   .9520341    .2043687                    .6250705     1.450027
----------------+----------------------------------------------------------------
Likelihood-ratio test of alpha=0:  chibar2(01) = 6709.95 Prob>=chibar2 = 0.000

. *urban_badtoilet not signif
.
. nbreg casecount urban_wrklnagr urban edyr bad_toilet wrk_lnagr, offset(lnpop)

Fitting Poisson model:

Iteration 0:   log likelihood = -6444.5975
Iteration 1:   log likelihood = -3739.6674
Iteration 2:   log likelihood = -3715.0416
Iteration 3:   log likelihood = -3715.0199
Iteration 4:   log likelihood = -3715.0199

Fitting constant-only model:

Iteration 0:   log likelihood = -234.32979
Iteration 1:   log likelihood = -233.46703
Iteration 2:   log likelihood = -233.46636
Iteration 3:   log likelihood = -233.46636

Fitting full model:

Iteration 0:   log likelihood = -228.76508
Iteration 1:   log likelihood = -226.62847
Iteration 2:   log likelihood = -226.58725
Iteration 3:   log likelihood = -226.58721
Iteration 4:   log likelihood = -226.58721

Negative binomial regression                      Number of obs   =         36
                                                  LR chi2(5)      =      13.76
Dispersion     = mean                             Prob > chi2     =     0.0172
Log likelihood = -226.58721                       Pseudo R2       =     0.0295

---------------+----------------------------------------------------------------
      casecount |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
---------------+----------------------------------------------------------------
urban_wrklnagr |     .000113    .0004434      0.25    0.799     -.0007561     .0009821
         urban |   -.0529513    .0278907     -1.90    0.058     -.1076161     .0017136
          edyr |    .8187949    .2872914      2.85    0.004      .2557141     1.381876
    bad_toilet |   -.0491243    .0160443     -3.06    0.002     -.0805706    -.0176781
     wrk_lnagr |   -.0432478    .0230858     -1.87    0.061     -.0884951     .0019995
         _cons |   -4.516426    1.200358     -3.76    0.000     -6.869084    -2.163768
          lnpop |          1   (offset)
---------------+----------------------------------------------------------------
      /lnalpha |   -.0502221    .2147131                    -.471052     .3706078
---------------+----------------------------------------------------------------
          alpha |   .9510182     .204196                    .6243451     1.448615
---------------+----------------------------------------------------------------
Likelihood-ratio test of alpha=0:  chibar2(01) = 6976.87 Prob>=chibar2 = 0.000

. *urban_wrklnagr not signif
.
. nbreg casecount edyr_badtoilet urban edyr bad_toilet wrk_lnagr, offset(lnpop)

Fitting Poisson model:

Iteration 0:   log likelihood = -5713.1372
Iteration 1:   log likelihood = -3723.9892
Iteration 2:   log likelihood = -3707.3125
Iteration 3:   log likelihood = -3707.3011
Iteration 4:   log likelihood = -3707.3011

Fitting constant-only model:

Iteration 0:   log likelihood = -234.32979
Iteration 1:   log likelihood = -233.46703
Iteration 2:   log likelihood = -233.46636
Iteration 3:   log likelihood = -233.46636

Fitting full model:

Iteration 0:   log likelihood = -228.87256
Iteration 1:   log likelihood = -226.55166
Iteration 2:   log likelihood = -226.51692
Iteration 3:   log likelihood = -226.51689
Iteration 4:   log likelihood = -226.51689

Negative binomial regression                      Number of obs   =         36
                                                  LR chi2(5)      =      13.90
Dispersion     = mean                             Prob > chi2     =     0.0163
Log likelihood = -226.51689                       Pseudo R2       =     0.0298

---------------+----------------------------------------------------------------
      casecount |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
---------------+----------------------------------------------------------------
edyr_badtoilet |   -.0030243    .0066615     -0.45    0.650     -.0160805      .010032
         urban |   -.0513721    .0191815     -2.68    0.007     -.0889672     -.013777
          edyr |    1.034894    .5501214      1.88    0.060     -.0433238     2.113112
    bad_toilet |   -.0388011     .030189     -1.29    0.199     -.0979704     .0203682
     wrk_lnagr |    -.043053     .019511     -2.21    0.027     -.0812939    -.0048121
         _cons |   -5.216268    1.833381     -2.85    0.004     -8.809628    -1.622908
          lnpop |          1   (offset)
---------------+----------------------------------------------------------------
      /lnalpha |   -.0533926    .2147973                   -.4743876     .3676024
---------------+----------------------------------------------------------------
          alpha |   .9480078    .2036295                     .622266     1.444268
---------------+----------------------------------------------------------------
Likelihood-ratio test of alpha=0:  chibar2(01) = 6961.57 Prob>=chibar2 = 0.000

. *edyr_badtoilet not significant
.
. nbreg casecount edyr_wrklnagr urban edyr bad_toilet wrk_lnagr, offset(lnpop)

Fitting Poisson model:

Iteration 0:   log likelihood = -6107.9601
Iteration 1:   log likelihood =  -3706.366
Iteration 2:   log likelihood = -3694.5399
Iteration 3:   log likelihood = -3694.5335
Iteration 4:   log likelihood = -3694.5335

Fitting constant-only model:

Iteration 0:   log likelihood = -234.32979
Iteration 1:   log likelihood = -233.46703
Iteration 2:   log likelihood = -233.46636
Iteration 3:   log likelihood = -233.46636

Fitting full model:

Iteration 0:   log likelihood = -228.68309
Iteration 1:   log likelihood = -226.56394
Iteration 2:   log likelihood = -226.51875
Iteration 3:   log likelihood =  -226.5187
Iteration 4:   log likelihood =  -226.5187

Negative binomial regression                      Number of obs   =         36
                                                  LR chi2(5)      =      13.90
Dispersion     = mean                             Prob > chi2     =     0.0163
Log likelihood = -226.5187                        Pseudo R2       =     0.0298

--------------+----------------------------------------------------------------
     casecount |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
--------------+----------------------------------------------------------------
edyr_wrklnagr |    .0030857    .0069138      0.45    0.655      -.010465     .0166365
        urban |   -.0501681    .0182544     -2.75    0.006     -.0859461      -.01439
         edyr |    .7082182    .3821173      1.85    0.064      -.040718     1.457154
   bad_toilet |   -.0492101    .0150923     -3.26    0.001     -.0787906    -.0196297
    wrk_lnagr |    -.052105    .0334131     -1.56    0.119     -.1175935     .0133835
        _cons |   -4.191559    1.455431     -2.88    0.004     -7.044152    -1.338966
         lnpop |          1   (offset)
--------------+----------------------------------------------------------------
     /lnalpha |   -.0533365    .2148014                   -.4743396     .3676666
--------------+----------------------------------------------------------------
         alpha |   .9480609    .2036448                    .6222959      1.44436
--------------+----------------------------------------------------------------
Likelihood-ratio test of alpha=0:  chibar2(01) = 6936.03 Prob>=chibar2 = 0.000

. *edyr_wrklnagr not sig
.
. nbreg casecount badtoilet_wrklnagr urban edyr bad_toilet wrk_lnagr, offset(lnpop)

Fitting Poisson model:

Iteration 0:   log likelihood =  -5957.668
Iteration 1:   log likelihood = -3736.8014
Iteration 2:   log likelihood = -3711.3639
Iteration 3:   log likelihood =  -3711.338
Iteration 4:   log likelihood =  -3711.338

Fitting constant-only model:

Iteration 0:   log likelihood = -234.32979
Iteration 1:   log likelihood = -233.46703
Iteration 2:   log likelihood = -233.46636
Iteration 3:   log likelihood = -233.46636

Fitting full model:

Iteration 0:   log likelihood = -228.80285
Iteration 1:   log likelihood = -226.65309
Iteration 2:   log likelihood = -226.61393
Iteration 3:   log likelihood =  -226.6139
Iteration 4:   log likelihood =  -226.6139

Negative binomial regression                      Number of obs   =         36
                                                  LR chi2(5)      =      13.70
Dispersion     = mean                             Prob > chi2     =     0.0176
Log likelihood = -226.6139                        Pseudo R2       =     0.0294

-------------------+----------------------------------------------------------------
          casecount |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------------+----------------------------------------------------------------
badtoilet_wrklnagr |   -.0000751    .0006905     -0.11    0.913     -.0014285     .0012782
             urban |   -.0486391    .0209312     -2.32    0.020     -.0896635    -.0076147
              edyr |    .8264487    .2927979      2.82    0.005      .2525753     1.400322
        bad_toilet |   -.0478499    .0302823     -1.58    0.114     -.1072022     .0115024
         wrk_lnagr |   -.0351528    .0439294     -0.80    0.424     -.1212528     .0509471
             _cons |   -4.736709    1.908427     -2.48    0.013     -8.477158    -.9962608
              lnpop |          1   (offset)
-------------------+----------------------------------------------------------------
          /lnalpha |   -.0489787    .2146715                   -.4697272     .3717698
-------------------+----------------------------------------------------------------
              alpha |   .9522014    .2044105                    .6251728     1.450299
-------------------+----------------------------------------------------------------
Likelihood-ratio test of alpha=0:  chibar2(01) = 6969.45 Prob>=chibar2 = 0.000

. *badtoilet_wrklnagr not signif
.
.
. ********************************************************
. *no interactions significant
. ********************************************************
.
.
.
.
.    **************************************************
.    *based on above will use
.    *urban edyr bad_toilet wrk_lnagr
.    *and no interaction terms
. **********************************************************
.
.
. nbreg casecount urban edyr bad_toilet wrk_lnagr, offset(lnpop)

Fitting Poisson model:

Iteration 0:   log likelihood = -4000.5639
Iteration 1:   log likelihood =  -3724.053
Iteration 2:   log likelihood = -3723.7857
Iteration 3:   log likelihood = -3723.7857

Fitting constant-only model:

Iteration 0:   log likelihood = -234.32979
Iteration 1:   log likelihood = -233.46703
Iteration 2:   log likelihood = -233.46636
Iteration 3:   log likelihood = -233.46636

Fitting full model:

Iteration 0:   log likelihood = -228.77878
Iteration 1:   log likelihood = -226.66235
Iteration 2:   log likelihood = -226.61986
Iteration 3:   log likelihood = -226.61982
Iteration 4:   log likelihood = -226.61982

Negative binomial regression                      Number of obs   =         36
                                                  LR chi2(4)      =      13.69
Dispersion     = mean                             Prob > chi2     =     0.0083
Log likelihood = -226.61982                       Pseudo R2       =     0.0293

-------------+----------------------------------------------------------------
    casecount |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       urban |   -.0473465    .0172846     -2.74    0.006     -.0812237    -.0134693
        edyr |    .8202669    .2872383      2.86    0.004      .2572901     1.383244
  bad_toilet |   -.0507212    .0149021     -3.40    0.001     -.0799288    -.0215137
   wrk_lnagr |    -.039522     .017866     -2.21    0.027     -.0745387    -.0045053
       _cons |   -4.573399    1.186842     -3.85    0.000     -6.899566    -2.247232
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------
    /lnalpha |    -.048662    .2146521                   -.4693724     .3720483
-------------+----------------------------------------------------------------
        alpha |    .952503    .2044568                    .6253946     1.450703
-------------+----------------------------------------------------------------
Likelihood-ratio test of alpha=0:  chibar2(01) = 6994.33 Prob>=chibar2 = 0.000

.   *produces alpha= .952503 so put it in the next fam part
.   *not positive about the link but think i need it
. glm casecount urban edyr bad_toilet wrk_lnagr, fam(nb .952503) link(log) offset(lnpop)

Iteration 0:   log likelihood = -228.74021
Iteration 1:   log likelihood =  -226.8511
Iteration 2:   log likelihood = -226.62013
Iteration 3:   log likelihood = -226.61982
Iteration 4:   log likelihood = -226.61982

Generalized linear models                          No. of obs      =        36
Optimization     : ML                              Residual df     =        31
                                                   Scale parameter =         1
Deviance         =  41.10184674                    (1/df) Deviance =  1.325866
Pearson          =   26.1652337                    (1/df) Pearson  =  .8440398

Variance function: V(u) =  u+(.9525)u^2            [Neg. Binomial]
Link function    : g(u) =  ln(u)                   [Log]

                                                   AIC             =  12.86777
Log likelihood   = -226.6198197                    BIC             = -69.98724

-------------+----------------------------------------------------------------
             |                 OIM
    casecount |      Coef.    Std. Err.       z    P>|z|      [95% Con f. Interval]
-------------+----------------------------------------------------------------
       urban |   -.0473465    .0172846     -2.74    0.006     -.0812237    -.0134694
        edyr |    .8202667    .2872376      2.86    0.004      .2572914     1.383242
  bad_toilet |   -.0507212    .0149021     -3.40    0.001     -.0799288    -.0215137
   wrk_lnagr |    -.039522    .0178659     -2.21    0.027     -.0745385    -.0045056
       _cons |   -4.573398    1.186841     -3.85    0.000     -6.899563    -2.247234
        lnpop |          1   (offset)
-------------+----------------------------------------------------------------

. *all significant
. *(1/df) deviance = 1.33 (slight overdispersion since greater than 1.25)
.
.
.
end of do-file

. log close
      name:  <unnamed>
       log:  \\Client\C$\cem601_lab\Ebola_VariableSelection_August_26.smcl
  log type:  smcl
 closed on:  26 Aug 2015, 15:05:03
-------------