---------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  c:\nhis\priv18ptest.log
  log type:  text
 opened on:  10 May 2021, 13:46:06

. set more off

. display "priv18ptest.do run on $S_DATE at $S_TIME"
priv18ptest.do run on 10 May 2021 at 13:46:06

. 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 pre100400b=stdypop100400

. replace pre100400b=1 if fpl200unk==1
(25,580 real changes made)

. replace pre100400b=0 if year>2013
(52,158 real changes made)

. replace pre100400b=0 if age>64
(4,788 real changes made)

. replace pre100400b=0 if workhi==1
(15,136 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)

. 
. gen trend=0

. replace trend=1 if year==2012
(43,345 real changes made)

. replace trend=2 if year==2013
(42,321 real changes made)

. 
. gen trendaa=trend*aa

. 
. 
. ** linear ptest 
. 
. svy, subpop(pre100400b): regress priv i.aa trend trendaa 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   =       300              Number of obs     =        172,465
Number of PSUs     =       600              Population size   =  1,185,879,795
                                            Subpop. no. obs   =         14,247
                                            Subpop. size      =    114,530,805
                                            Design df         =            300
                                            F(  22,    279)   =         189.72
                                            Prob > F          =         0.0000
                                            R-squared         =         0.2290

------------------------------------------------------------------------------
             |             Linearized
        priv |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        1.aa |  -.0849122   .0197389    -4.30   0.000    -.1237564   -.0460681
       trend |   .0043569   .0064943     0.67   0.503    -.0084232     .017137
     trendaa |  -.0000767   .0157296    -0.00   0.996    -.0310311    .0308776
       a1826 |   .1978925   .0156557    12.64   0.000     .1670836    .2287013
       a2735 |  -.0576645   .0131328    -4.39   0.000    -.0835086   -.0318203
        a50p |   .0863821   .0137831     6.27   0.000     .0592583    .1135059
      flimit |  -.0363715   .0108814    -3.34   0.001    -.0577851    -.014958
      female |   .0613724   .0102948     5.96   0.000     .0411131    .0816316
     married |   .1927426   .0126914    15.19   0.000     .1677673     .217718
  wasmarried |  -.0464943   .0142597    -3.26   0.001     -.074556   -.0184325
             |
        kids |
          1  |   .0151725    .013814     1.10   0.273    -.0120121    .0423572
          2  |   .0628766   .0167861     3.75   0.000     .0298431      .09591
          3  |    .081297   .0176089     4.62   0.000     .0466444    .1159496
             |
    employed |  -.0551087   .0104693    -5.26   0.000    -.0757113    -.034506
      workhi |          0  (omitted)
          hs |   .0844974   .0152762     5.53   0.000     .0544353    .1145594
     somecol |   .1700528   .0165356    10.28   0.000     .1375124    .2025933
       assoc |   .1463587   .0185371     7.90   0.000     .1098795    .1828379
          ba |    .277282    .017612    15.74   0.000     .2426232    .3119408
        grad |   .3244543   .0217509    14.92   0.000     .2816507    .3672579
      fpl300 |   .1778275    .012086    14.71   0.000     .1540435    .2016116
      fpl400 |    .329663   .0153551    21.47   0.000     .2994458    .3598803
   fpl200unk |   .3330368   .0151357    22.00   0.000     .3032512    .3628225
       _cons |   .0065886   .0207422     0.32   0.751    -.0342301    .0474073
------------------------------------------------------------------------------
Note: 52 strata omitted because they contain no subpopulation members.

. 
. 
. ** fixed ptest  
. 
. svy, subpop(pre100400b): regress priv i.aa i.year i.aa#i.year 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   =       300              Number of obs     =        172,465
Number of PSUs     =       600              Population size   =  1,185,879,795
                                            Subpop. no. obs   =         14,247
                                            Subpop. size      =    114,530,805
                                            Design df         =            300
                                            F(  24,    277)   =         172.97
                                            Prob > F          =         0.0000
                                            R-squared         =         0.2291

------------------------------------------------------------------------------
             |             Linearized
        priv |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        1.aa |  -.0943797   .0213708    -4.42   0.000    -.1364354    -.052324
             |
        year |
       2012  |   .0070332   .0120889     0.58   0.561    -.0167566    .0308229
       2013  |   .0086546   .0130021     0.67   0.506    -.0169322    .0342415
             |
     aa#year |
     1 2012  |   .0290012   .0333244     0.87   0.385    -.0365781    .0945804
     1 2013  |   .0001815   .0314224     0.01   0.995    -.0616547    .0620178
             |
       a1826 |   .1978142   .0156481    12.64   0.000     .1670204    .2286081
       a2735 |  -.0577464   .0131541    -4.39   0.000    -.0836323   -.0318605
        a50p |    .086352   .0137835     6.26   0.000     .0592273    .1134767
      flimit |  -.0364388   .0108816    -3.35   0.001    -.0578528   -.0150247
      female |   .0614963   .0103044     5.97   0.000     .0412183    .0817744
     married |   .1928484   .0126914    15.20   0.000     .1678729    .2178238
  wasmarried |  -.0464348   .0142234    -3.26   0.001    -.0744252   -.0184445
             |
        kids |
          1  |   .0152858   .0137872     1.11   0.268    -.0118461    .0424177
          2  |   .0628105   .0167184     3.76   0.000     .0299104    .0957106
          3  |   .0810822   .0176475     4.59   0.000     .0463536    .1158108
             |
    employed |  -.0550222   .0104613    -5.26   0.000    -.0756091   -.0344353
      workhi |          0  (omitted)
          hs |   .0843786   .0152842     5.52   0.000     .0543008    .1144564
     somecol |   .1701238   .0165555    10.28   0.000     .1375442    .2027034
       assoc |   .1463324   .0185228     7.90   0.000     .1098813    .1827836
          ba |   .2769562   .0176223    15.72   0.000     .2422773    .3116351
        grad |    .324236   .0217437    14.91   0.000     .2814466    .3670254
      fpl300 |   .1778138   .0120725    14.73   0.000     .1540563    .2015713
      fpl400 |   .3297984   .0153762    21.45   0.000     .2995394    .3600573
   fpl200unk |   .3328604   .0151371    21.99   0.000      .303072    .3626488
       _cons |   .0056864    .020766     0.27   0.784    -.0351791    .0465519
------------------------------------------------------------------------------
Note: 52 strata omitted because they contain no subpopulation members.

. 
. 
. 
. log close
      name:  <unnamed>
       log:  c:\nhis\priv18ptest.log
  log type:  text
 closed on:  10 May 2021, 13:46:15
---------------------------------------------------------------------------------------------------------------------
