-------------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  /Users/seanfahle/Dropbox/BequestModel/REStud/REStudPublication/SSG_Code_REStud/Stata/Code/../Output/logs/TABA2a_SAMPLE_COUNTS_
> 2.txt
  log type:  text
 opened on:  30 Jun 2022, 16:49:10

. 
. * Count single decedents with exit iws in waves 7-11 who comprise main sample
. unique hhid pn if (singleExitIW==1)
Number of unique values of hhid pn is  3543
Number of records is  28344

. // -> 3,543 unique single decedents, died waves 5-11, with exit interviews 7-11
. //    (TABA2a: Line 5 - single at the time of death)
. count if ((riwstat==1 | xIW==1) & (singleExitIW==1))
  19,679

. // -> 19,679 observations
. 
. * pause logging
. log off
      name:  <unnamed>
       log:  /Users/seanfahle/Dropbox/BequestModel/REStud/REStudPublication/SSG_Code_REStud/Stata/Code/../Output/logs/TABA2a_SAMPLE_COUNTS_
> 2.txt
  log type:  text
 paused on:  30 Jun 2022, 16:49:10
-------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  /Users/seanfahle/Dropbox/BequestModel/REStud/REStudPublication/SSG_Code_REStud/Stata/Code/../Output/logs/TABA2a_SAMPLE_COUNTS_
> 2.txt
  log type:  text
resumed on:  30 Jun 2022, 16:49:11

. 
. count if xIW==1 // # 3,543 exit IWs
  3,543

. count if (xIW==1 | riwstat==1) & (exitIW==1) // 19,679
  19,679

. // TABA2a: Line 5
. 
. drop if (badinfoHome==1)
(568 observations deleted)

. count if xIW==1 // # 3,476 exit IWs
  3,476

. count if (xIW==1 | riwstat==1) & (exitIW==1) // 19,326
  19,326

. // TABA2a: Line 6
. 
. drop if (badinfofateHome==1)
(2,568 observations deleted)

. count if xIW==1 // # 3,451 exit IWs
  3,451

. count if (xIW==1 | riwstat==1) & (exitIW==1) //  19,190
  19,190

. 
. drop if (badinfoinhrtHome==1)
(160 observations deleted)

. count if xIW==1 // # 3,434 exit IWs
  3,434

. count if (xIW==1 | riwstat==1) & (exitIW==1) // 19,092
  19,092

. 
. drop if (badweight==1)
(0 observations deleted)

. count if xIW==1 // # 3,434 exit IWs
  3,434

. count if (xIW==1 | riwstat==1) & (exitIW==1) // 19,092
  19,092

. // TABA2a: Line 7
. 
. drop if (badproxy==1)
(1,352 observations deleted)

. count if xIW==1 // # 3,265 exit IWs
  3,265

. count if (xIW==1 | riwstat==1) & (exitIW==1) // 18,168
  18,168

. // TABA2a: Line 8
. 
. drop if (badinfoxiwgap==1)
(304 observations deleted)

. count if xIW==1 // # 3,227 exit IWs
  3,227

. count if (xIW==1 | riwstat==1) & (exitIW==1) // 17,974
  17,974

. // TABA2a: Line 9
. 
. drop badinfo* badproxy badweight

. 
. ***************************************
. ** Sample counts:
. ***************************************
. 
. unique hhid pn
Number of unique values of hhid pn is  5719
Number of records is  45752

. // -> 5,719 individuals (45,752 observations = 5,719 x 8 waves (waves 4-11))
. // -> NOTE that the sample still includes some observations that we are not going
. //    to be using. Dropping these here affects the random draws used in the imputations,
. //    so we keep them for now and discard them below (to be consistent with our earlier results).
. 
. ** Decedents
. 
. unique hhid pn if (exitIW==1)
Number of unique values of hhid pn is  3227
Number of records is  25816

. // -> 3,227 individuals who died in waves 5-11 and have exit interviews in waves 7-11
. // -> This is our decedent sample.
. 
. count if (exitIW==1) & (riwstat==1 | xIW==1)
  17,974

. // -> 17,974
. //    The total number of interviews in our decedent sample
. 
. ** Parents
. 
. unique hhid pn if (exitIW==1) & (nochild==0)
Number of unique values of hhid pn is  2869
Number of records is  22952

. // -> 2,869
. 
. count if (exitIW==1) & (riwstat==1 | xIW==1) & (nochild==0)
  16,049

. // -> 16,049
. 
. ** Parents: # interview given while single (HACC validation sample)
. 
. unique hhid pn if (exitIW==1) & (nochild==0)
Number of unique values of hhid pn is  2869
Number of records is  22952

. // -> 2,869
. 
. count if (exitIW==1) & (riwstat==1 | xIW==1) & (hcpl==0) & (nochild==0)
  13,400

. // -> 13,400
. //    The total number of interviews given by parents while single (incl core + exit)
. 
. ** Childless
. 
. unique hhid pn if (exitIW==1) & (nochild==1)
Number of unique values of hhid pn is  358
Number of records is  2864

. // -> 358
. 
. count if (exitIW==1) & (riwstat==1 | xIW==1) & (nochild==1)
  1,925

. // -> 1,925
. 
. * close log
. cap log close
