---------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  c:\nhis\dd100ppriv1118newkf.log
  log type:  text
 opened on:  19 May 2021, 13:27:13

. set more off

. display "dd100ppriv1118newkf.do run on $S_DATE at $S_TIME"
dd100ppriv1118newkf.do run on 19 May 2021 at 13:27:13

. clear

. set mem 500m
set memory ignored.
    Memory no longer needs to be set in modern Statas; memory adjustments are performed on the fly automatically.

. 
. 
. use d:\onedrive070120\NHISDATA1118F.dta, clear

. replace strat_p=strat_p+1000
(257,652 real changes made)

. replace strat_p=strat_p+1000 if year>2015
(85,187 real changes made)

. 
. svyset [pweight=wtfa_sa], strata(strat_p) psu(psu_p)

      pweight: wtfa_sa
          VCE: linearized
  Single unit: missing
     Strata 1: strat_p
         SU 1: psu_p
        FPC 1: <zero>

. gen post=0

. replace post=1 if year>2014
(146,629 real changes made)

. replace post=. if year==2014
(45,597 real changes made, 45,597 to missing)

. 
. gen stdypop100400b=stdypop100400

. replace stdypop100400b=1 if fpl200unk==1
(25,580 real changes made)

. replace stdypop100400b=0 if year==2014
(12,676 real changes made)

. replace stdypop100400b=0 if age>64
(11,966 real changes made)

. 
. 
. gen stdypop100400bnwhi=stdypop100400b

. replace stdypop100400bnwhi=0 if workhi==1
(31,862 real changes made)

. 
. gen stdypop100pnwhi=stdypop100p

. replace stdypop100pnwhi=0 if workhi==1
(73,736 real changes made)

. replace stdypop100pnwhi=0 if year==2014
(6,923 real changes made)

. replace stdypop100pnwhi=0 if age>64
(0 real changes made)

. 
. gen kids=0

. replace kids=1 if fm_kids==1
(42,298 real changes made)

. replace kids=2 if fm_kids==2
(36,524 real changes made)

. replace kids=3 if fm_kids>2
(22,479 real changes made)

. 
. gen somehs=0

. replace somehs=1 if educ > 8 & educ < 13
(22,849 real changes made)

. replace lesshs=0 if educ > 8 & educ < 13
(22,849 real changes made)

. replace lesshs=1 if educ > 96
(61,851 real changes made)

. 
. *Insurance Variables
. *order notcov medpriv mcaid priv igap
. 
. *Notcov=No insurance coverage
. *medpriv=Medicaid or private insurance
. *mcaid=medicaid coverage
. *priv=private coverage
. *igap=had insuarnce gap in last 12 months
. 
. 
. ** newest 100-400FPL but with FPL >= 200% but specifics unknown
. svy, subpop(stdypop100400b): regress priv i.aa i.post i.aa#i.post a1826 a2735 a50p /*
>  */flimit female married wasmarried i.kids employed workhi /*
> */  hs  somecol assoc ba grad  fpl300 fpl400 fpl400p fpl200unk  
(running regress on estimation sample)

Survey: Linear regression

Number of strata   =       352              Number of obs     =        257,652
Number of PSUs     =     1,259              Population size   =  1,927,134,824
                                            Subpop. no. obs   =         61,687
                                            Subpop. size      =    514,844,711
                                            Design df         =            907
                                            F(  23,    885)   =         759.60
                                            Prob > F          =         0.0000
                                            R-squared         =         0.2788

------------------------------------------------------------------------------
             |             Linearized
        priv |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        1.aa |  -.0598969   .0085865    -6.98   0.000    -.0767487   -.0430452
      1.post |   .0164937   .0048649     3.39   0.001     .0069459    .0260414
             |
     aa#post |
        1 1  |   .0232127   .0119805     1.94   0.053       -.0003    .0467254
             |
       a1826 |   .0775222   .0076865    10.09   0.000     .0624367    .0926077
       a2735 |  -.0404397    .005515    -7.33   0.000    -.0512634    -.029616
        a50p |   .0599538   .0058251    10.29   0.000     .0485216     .071386
      flimit |  -.0348783   .0050323    -6.93   0.000    -.0447546   -.0250021
      female |   .0397614   .0045175     8.80   0.000     .0308954    .0486273
     married |    .113354   .0057557    19.69   0.000     .1020581      .12465
  wasmarried |  -.0032971   .0070544    -0.47   0.640    -.0171418    .0105477
             |
        kids |
          1  |  -.0142929   .0064865    -2.20   0.028    -.0270231   -.0015626
          2  |   .0201845   .0070505     2.86   0.004     .0063472    .0340217
          3  |   .0469297   .0079566     5.90   0.000     .0313142    .0625452
             |
    employed |  -.0333512   .0074602    -4.47   0.000    -.0479925   -.0187099
      workhi |   .3428516   .0050965    67.27   0.000     .3328493    .3528539
          hs |   .0917536   .0088118    10.41   0.000     .0744598    .1090475
     somecol |   .1499888   .0089013    16.85   0.000     .1325192    .1674584
       assoc |   .1334525   .0097734    13.65   0.000     .1142714    .1526336
          ba |   .2070187   .0095232    21.74   0.000     .1883286    .2257088
        grad |   .2005705    .010508    19.09   0.000     .1799478    .2211933
      fpl300 |   .1703491   .0059953    28.41   0.000     .1585829    .1821153
      fpl400 |   .2527886   .0064482    39.20   0.000     .2401335    .2654438
     fpl400p |          0  (omitted)
   fpl200unk |   .2401425   .0076949    31.21   0.000     .2250406    .2552444
       _cons |   .1576276   .0109269    14.43   0.000     .1361827    .1790724
------------------------------------------------------------------------------

. margins aa#post, subpop(stdypop100400b) post

Predictive margins                              Number of obs     =    220,955
                                                Subpop. no. obs   =     61,687
Model VCE    : Linearized

Expression   : Linear prediction, predict()

------------------------------------------------------------------------------
             |            Delta-method
             |     Margin   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
     aa#post |
        0 0  |   .6794875    .003489   194.75   0.000       .67264     .686335
        0 1  |   .6959812   .0034316   202.82   0.000     .6892464    .7027159
        1 0  |   .6195906   .0079887    77.56   0.000     .6039121     .635269
        1 1  |   .6592969   .0083732    78.74   0.000     .6428638    .6757301
------------------------------------------------------------------------------

. nlcom (_b[1.aa#1.post]/_b[0bn.aa#1.post])- /*
> */ (_b[1.aa#0bn.post]/_b[0bn.aa#0bn.post])

       _nl_1:  (_b[1.aa#1.post]/_b[0bn.aa#1.post])- (_b[1.aa#0bn.post]/_b[0bn.aa#0bn.post])

------------------------------------------------------------------------------
             |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       _nl_1 |   .0354415   .0172323     2.06   0.040     .0016667    .0692163
------------------------------------------------------------------------------

. 
. 
. 
. **As above but only on subpop that does not have HI available from work         
. 
. svy, subpop(stdypop100400bnwhi): regress priv i.aa i.post i.aa#i.post a1826 a2735 a50p /*
>  */flimit female married wasmarried i.kids employed workhi /*
> */   hs  somecol assoc ba grad  fpl300 fpl400 fpl200unk         
(running regress on estimation sample)

Survey: Linear regression

Number of strata   =       352              Number of obs     =        257,652
Number of PSUs     =     1,259              Population size   =  1,927,134,824
                                            Subpop. no. obs   =         29,825
                                            Subpop. size      =    263,723,840
                                            Design df         =            907
                                            F(  22,    886)   =         271.78
                                            Prob > F          =         0.0000
                                            R-squared         =         0.2017

------------------------------------------------------------------------------
             |             Linearized
        priv |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        1.aa |  -.0877603   .0129227    -6.79   0.000    -.1131222   -.0623983
      1.post |   .0376438   .0074295     5.07   0.000     .0230629    .0522248
             |
     aa#post |
        1 1  |   .0442085   .0189772     2.33   0.020     .0069642    .0814528
             |
       a1826 |   .1850045   .0114883    16.10   0.000     .1624577    .2075512
       a2735 |  -.0580493   .0096301    -6.03   0.000    -.0769491   -.0391494
        a50p |   .0951138   .0095727     9.94   0.000     .0763267    .1139009
      flimit |  -.0416043   .0078855    -5.28   0.000    -.0570803   -.0261284
      female |   .0520379   .0073243     7.10   0.000     .0376634    .0664124
     married |     .19458   .0089968    21.63   0.000      .176923    .2122369
  wasmarried |  -.0185478   .0110465    -1.68   0.093    -.0402275     .003132
             |
        kids |
          1  |  -.0235045   .0100082    -2.35   0.019    -.0431464   -.0038626
          2  |   .0271858   .0113246     2.40   0.017     .0049603    .0494113
          3  |   .0527678   .0132151     3.99   0.000      .026832    .0787035
             |
    employed |  -.0300777   .0075892    -3.96   0.000    -.0449721   -.0151833
      workhi |          0  (omitted)
          hs |   .1044058   .0113317     9.21   0.000     .0821665    .1266451
     somecol |   .1879403   .0117873    15.94   0.000     .1648067    .2110739
       assoc |   .1568224   .0137214    11.43   0.000      .129893    .1837518
          ba |   .2873603   .0131239    21.90   0.000     .2616035    .3131171
        grad |   .3149019   .0163841    19.22   0.000     .2827469     .347057
      fpl300 |   .1742255   .0085262    20.43   0.000      .157492    .1909589
      fpl400 |    .301792   .0097861    30.84   0.000     .2825859     .320998
   fpl200unk |   .2912363   .0114285    25.48   0.000     .2688069    .3136656
       _cons |   .0147895   .0144551     1.02   0.307    -.0135799    .0431588
------------------------------------------------------------------------------

. margins aa#post, subpop(stdypop100400bnwhi) post

Predictive margins                              Number of obs     =    220,955
                                                Subpop. no. obs   =     29,825
Model VCE    : Linearized

Expression   : Linear prediction, predict()

------------------------------------------------------------------------------
             |            Delta-method
             |     Margin   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
     aa#post |
        0 0  |   .4835284    .005413    89.33   0.000      .472905    .4941517
        0 1  |   .5211722   .0052767    98.77   0.000     .5108162    .5315282
        1 0  |   .3957681     .01184    33.43   0.000     .3725312     .419005
        1 1  |   .4776204   .0136521    34.99   0.000     .4508271    .5044137
------------------------------------------------------------------------------

. nlcom (_b[1.aa#1.post]/_b[0bn.aa#1.post])

       _nl_1:  _b[1.aa#1.post]/_b[0bn.aa#1.post]

------------------------------------------------------------------------------
             |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       _nl_1 |    .916435   .0274934    33.33   0.000      .862549     .970321
------------------------------------------------------------------------------

. nlcom (_b[1.aa#0bn.post]/_b[0bn.aa#0bn.post])

       _nl_1:  _b[1.aa#0bn.post]/_b[0bn.aa#0bn.post]

------------------------------------------------------------------------------
             |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       _nl_1 |   .8185003   .0259778    31.51   0.000     .7675848    .8694157
------------------------------------------------------------------------------

. nlcom (_b[1.aa#1.post]/_b[0bn.aa#1.post])- /*
> */ (_b[1.aa#0bn.post]/_b[0bn.aa#0bn.post])

       _nl_1:  (_b[1.aa#1.post]/_b[0bn.aa#1.post])- (_b[1.aa#0bn.post]/_b[0bn.aa#0bn.post])

------------------------------------------------------------------------------
             |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       _nl_1 |   .0979347   .0369249     2.65   0.008     .0255632    .1703062
------------------------------------------------------------------------------

. 
. 
.         
. **All income above 100%FPL but only on subpop that does not have HI available from work         
. 
. svy, subpop(stdypop100pnwhi): regress priv i.aa i.post i.aa#i.post a1826 a2735 a50p /*
>  */flimit female married wasmarried i.kids employed workhi /*
> */  hs  somecol assoc ba grad  fpl300 fpl400 fpl400p fpl200unk  
(running regress on estimation sample)

Survey: Linear regression

Number of strata   =       352              Number of obs     =        257,652
Number of PSUs     =     1,259              Population size   =  1,927,134,824
                                            Subpop. no. obs   =         41,841
                                            Subpop. size      =    383,888,745
                                            Design df         =            907
                                            F(  23,    885)   =         562.21
                                            Prob > F          =         0.0000
                                            R-squared         =         0.2606

------------------------------------------------------------------------------
             |             Linearized
        priv |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        1.aa |  -.0966885   .0112788    -8.57   0.000    -.1188241   -.0745529
      1.post |   .0318923   .0057541     5.54   0.000     .0205995    .0431851
             |
     aa#post |
        1 1  |    .048003   .0166067     2.89   0.004      .015411     .080595
             |
       a1826 |   .1967945     .00958    20.54   0.000      .177993    .2155961
       a2735 |  -.0547999   .0079701    -6.88   0.000    -.0704419   -.0391579
        a50p |   .0822863    .007467    11.02   0.000     .0676318    .0969408
      flimit |  -.0348271   .0059526    -5.85   0.000    -.0465095   -.0231446
      female |   .0411898   .0057092     7.21   0.000     .0299852    .0523945
     married |   .1942759   .0078283    24.82   0.000     .1789121    .2096397
  wasmarried |  -.0097865   .0104925    -0.93   0.351    -.0303789    .0108059
             |
        kids |
          1  |  -.0060808   .0080525    -0.76   0.450    -.0218846     .009723
          2  |   .0371399   .0091315     4.07   0.000     .0192187    .0550612
          3  |   .0600328   .0109523     5.48   0.000     .0385379    .0815276
             |
    employed |  -.0239202   .0059496    -4.02   0.000    -.0355968   -.0122435
      workhi |          0  (omitted)
          hs |   .0853707   .0104474     8.17   0.000     .0648668    .1058746
     somecol |    .154191   .0108522    14.21   0.000     .1328927    .1754893
       assoc |   .1349859   .0117902    11.45   0.000     .1118466    .1581253
          ba |   .2278221   .0112269    20.29   0.000     .2057883    .2498558
        grad |   .2321969   .0125513    18.50   0.000      .207564    .2568299
      fpl300 |   .1791191   .0084792    21.12   0.000     .1624779    .1957603
      fpl400 |   .3112095   .0096266    32.33   0.000     .2923164    .3301025
     fpl400p |   .4212257   .0078402    53.73   0.000     .4058386    .4366128
   fpl200unk |   .3391175   .0117041    28.97   0.000     .3161473    .3620877
       _cons |   .0355796   .0130122     2.73   0.006      .010042    .0611172
------------------------------------------------------------------------------

. margins aa#post, subpop(stdypop100pnwhi) post

Predictive margins                              Number of obs     =    220,955
                                                Subpop. no. obs   =     41,841
Model VCE    : Linearized

Expression   : Linear prediction, predict()

------------------------------------------------------------------------------
             |            Delta-method
             |     Margin   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
     aa#post |
        0 0  |   .5961906   .0043717   136.37   0.000     .5876107    .6047705
        0 1  |   .6280829   .0040241   156.08   0.000     .6201853    .6359806
        1 0  |   .4995021   .0105555    47.32   0.000     .4787859    .5202182
        1 1  |   .5793974   .0122243    47.40   0.000     .5554062    .6033886
------------------------------------------------------------------------------

. nlcom (_b[1.aa#1.post]/_b[0bn.aa#1.post])- /*
> */ (_b[1.aa#0bn.post]/_b[0bn.aa#0bn.post])

       _nl_1:  (_b[1.aa#1.post]/_b[0bn.aa#1.post])- (_b[1.aa#0bn.post]/_b[0bn.aa#0bn.post])

------------------------------------------------------------------------------
             |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       _nl_1 |   .0846627   .0266934     3.17   0.002     .0323447    .1369807
------------------------------------------------------------------------------

. 
. 
. log close
      name:  <unnamed>
       log:  c:\nhis\dd100ppriv1118newkf.log
  log type:  text
 closed on:  19 May 2021, 13:27:31
---------------------------------------------------------------------------------------------------------------------
