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

. 
. unique hhid pn
Number of unique values of hhid pn is  37495
Number of records is  299960

. // -> 37,495 individuals (299,960 observations = 37,495 individuals x 8 waves (waves 4-11))
. //    (TABA2a: Line 1 - HRS Universe)
. 
. unique hhid pn if (dead56==1 | dead711==1)
Number of unique values of hhid pn is  9804
Number of records is  78432

. unique hhid pn if (dead56==1 | dead711==1) & ~(alive11==1 | inapp11==1 | noInfo==1)
Number of unique values of hhid pn is  9804
Number of records is  78432

. // -> same result in both cases:  9,804 unique individuals
. 
. drop if alive11==1
(182,344 observations deleted)

. // -> 182,344 obs (22,793 individuals) deleted
. drop if inapp11==1 // not part of survey at any point in observation period
(1,080 observations deleted)

. // -> 1,080 obs (135 individuals) deleted 
. drop if noInfo==1  // no information since already dead in wave 4
(21,264 observations deleted)

. // -> 21,264 obs (2,658 individuals) deleted 
. 
. sort hhid pn w

. 
. unique hhid pn
Number of unique values of hhid pn is  11909
Number of records is  95272

. // -> 11,909 individuals
. 
. unique hhid pn if (dead56==1 | dead711==1)
Number of unique values of hhid pn is  9804
Number of records is  78432

. // -> 9,804 individuals
. //    (TABA2a: Line 2 - died during waves 5-11)
. 
. * pause logging
. log off
      name:  <unnamed>
       log:  /Users/seanfahle/Dropbox/BequestModel/REStud/REStudPublication/SSG_Code_REStud/Stata/Code/../Output/logs/TABA2a_SAMPLE_COUNTS_
> 1.txt
  log type:  text
 paused on:  30 Jun 2022, 16:48:34
-------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  /Users/seanfahle/Dropbox/BequestModel/REStud/REStudPublication/SSG_Code_REStud/Stata/Code/../Output/logs/TABA2a_SAMPLE_COUNTS_
> 1.txt
  log type:  text
resumed on:  30 Jun 2022, 16:48:35

. 
. unique hhid pn if (exitIW==1)
Number of unique values of hhid pn is  6491
Number of records is  51928

. // -> 6,491
. //    (TABA2a: Line 3 - exit interview waves 7-11)
. 
. count if (riwstat==1 | xIW==1) & (exitIW==1)
  35,499

. count if (riwstat==1) & (exitIW==1)
  29,008

. count if (xIW==1) & (exitIW==1)
  6,491

. // -> 35,499 (core + exit)
. // -> 29,008 (core)
. // -> 6,491  (exit)
. 
. bys hhid pn: egen minstat=min(riwstat)

. // -> if minstat=4 or 7, there is no information in the respondent's core IW history
. drop if (minstat==4|minstat==7)
(10,520 observations deleted)

. // -> drop these, they contain no information
. drop minstat

. 
. sort hhid pn w

. 
. unique hhid pn
Number of unique values of hhid pn is  10594
Number of records is  84752

. // -> 10,594
. // -> (final sample created by this file, includes dropped individuals which we dont currently use)
. 
. unique hhid pn if (exitIW==1)
Number of unique values of hhid pn is  6434
Number of records is  51472

. // -> 6,434 (decedent sample)
. //    (TABA2a: Line 4 - appeared in at least 1 core interview in waves 4-8)
. 
. count if (riwstat==1 | xIW==1) & (exitIW==1)
  35,442

. count if (riwstat==1) & (exitIW==1)
  29,008

. count if (xIW==1) & (exitIW==1)
  6,434

. // -> 35,442 (core + exit)
. // -> 29,008 (core)
. // -> 6,434  (exit)
. 
. * close log
. cap log close
