2: Age & FPL criteria

a: age criteria

use "C:\Users\Matt\Documents\EPI536\EPI536-Assignments\NHANES0708_merged.dta"

bysort age_instudy: su ridageyr
ta age_instudy
-> age_instudy = No

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
    ridageyr |      7,527    40.95682     24.9619          0         80

-------------------------------------------------------------------------------
-> age_instudy = Yes

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
    ridageyr |      2,622    10.03127    3.957492          4         17



  Meets Age |
  Inclusion |
   Criteria |      Freq.     Percent        Cum.
------------+-----------------------------------
         No |      7,527       74.16       74.16
        Yes |      2,622       25.84      100.00
------------+-----------------------------------
      Total |     10,149      100.00

Repeating the above analysis with the dataset provided in class:

use "C:\Users\Matt\Documents\EPI536\EPI536-Assignments\NHANES0708_newvars.dta"

bysort age_instudy: su ridageyr
ta age_instudy
-> age_instudy = 0

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
    ridageyr |      7,527    40.95682     24.9619          0         80

-------------------------------------------------------------------------------
-> age_instudy = 1

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
    ridageyr |      2,622    10.03127    3.957492          4         17



  RECODE of |
   ridageyr |
    (Age at |
  Screening |
Adjudicated |
  - Recode) |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |      7,527       74.16       74.16
          1 |      2,622       25.84      100.00
------------+-----------------------------------
      Total |     10,149      100.00

b: FPL criteria

use "C:\Users\Matt\Documents\EPI536\EPI536-Assignments\NHANES0708_merged.dta"

bysort fpl_instudy: su indfmpir
ta fpl_instudy
-> fpl_instudy = No

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
    indfmpir |      4,262    3.746244    1.090281       2.01          5

-------------------------------------------------------------------------------
-> fpl_instudy = Yes

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
    indfmpir |      4,993    1.036519    .5050164          0          2

-------------------------------------------------------------------------------
-> fpl_instudy = .

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
    indfmpir |          0

      Meets |
     Income |
  Inclusion |
   Criteria |      Freq.     Percent        Cum.
------------+-----------------------------------
         No |      4,262       46.05       46.05
        Yes |      4,993       53.95      100.00
------------+-----------------------------------
      Total |      9,255      100.00

Repeating the above analysis with the dataset provided in class:

use "C:\Users\Matt\Documents\EPI536\EPI536-Assignments\NHANES0708_newvars.dta"

bysort fpl_instudy: su indfmpir
ta fpl_instudy
-> fpl_instudy = 0

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
    indfmpir |      4,262    3.746244    1.090281       2.01          5

-------------------------------------------------------------------------------
-> fpl_instudy = 1

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
    indfmpir |      4,993    1.036519    .5050164          0          2



  RECODE of |
   indfmpir |
  (Ratio of |
     family |
  income to |
   poverty) |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |      5,156       50.80       50.80
          1 |      4,993       49.20      100.00
------------+-----------------------------------
      Total |     10,149      100.00

3: tabulation of both study inclusion criteria

use "C:\Users\Matt\Documents\EPI536\EPI536-Assignments\NHANES0708_merged.dta"

gen subpop1=0
    replace subpop1=1 if age_instudy==1 & fpl_instudy==1
ta subpop1

label define subpop1 0 "No" 1 "Yes"
label values subpop1 subpop1
label variable subpop1 "Meets Inclusion Criteria"
ta subpop1

save,replace
variable subpop1 already defined
r(110);

end of do-file
r(110);

Repeating the above analysis with the dataset provided in class:

use "C:\Users\Matt\Documents\EPI536\EPI536-Assignments\NHANES0708_newvars.dta"

gen subpop1=0
    replace subpop1=1 if age_instudy==1 & fpl_instudy==1
ta subpop1

label define subpop1 0 "No" 1 "Yes"
label values subpop1 subpop1
label variable subpop1 "Meets Inclusion Criteria"
ta subpop1

save,replace
variable subpop1 already defined
r(110);

end of do-file
r(110);

4: complete data on exposure variables and outcome variables

for missing outcome (dependant) variables

use "C:\Users\Matt\Documents\EPI536\EPI536-Assignments\NHANES0708_merged.dta"

gen miss_dv=missing(bmxbmi, bmxwaist)
ta subpop1 miss_dv

label define miss_dv 0 "No" 1 "Yes"
label values miss_dv miss_dv
label variable miss_dv "Missing Dependent Variables"
ta subpop1 miss_dv
ta miss_dv

save,replace
variable miss_dv already defined
r(110);

end of do-file
r(110);

Repeating the above analysis with the dataset provided in class:

use "C:\Users\Matt\Documents\EPI536\EPI536-Assignments\NHANES0708_newvars.dta"

gen miss_dv=missing(bmxbmi, bmxwaist)
ta subpop1 miss_dv

label define miss_dv 0 "No" 1 "Yes"
label values miss_dv miss_dv
label variable miss_dv "Missing Dependent Variables"
ta subpop1 miss_dv

save,replace
variable miss_dv already defined
r(110);

end of do-file
r(110);

For missing exposure (independant) variables

The data file from E4 does not have the variables necessary (food_stamp, WIC, school_meal, foodinsec).

Repeating the above analysis with the dataset provided in class:

use "C:\Users\Matt\Documents\EPI536\EPI536-Assignments\NHANES0708_newvars.dta"

gen miss_iv=missing(food_stamp, WIC, school_meal, foodinsec)
ta food_stamp miss_iv,m
ta WIC miss_iv,m
ta school_meal miss_iv,m
ta foodinsec miss_iv,m

label define miss_iv 0 "No" 1 "Yes"
label values miss_iv miss_iv
label variable miss_iv "Missing Independent Variables"
ta subpop1 miss_iv

save,replace
variable miss_iv already defined
r(110);

end of do-file
r(110);

5: creating a variable to indicate complete data and meets inclusion criteria

Continuing on using only the dataset provided in class:

use "C:\Users\Matt\Documents\EPI536\EPI536-Assignments\NHANES0708_newvars.dta"

gen subpop2=0
    replace subpop2=1 if subpop1==1 & miss_iv==0 & miss_dv==0
ta subpop2

label define subpop2 0 "No" 1 "Yes"
label values subpop2 subpop2
label variable subpop2 "Meets Inclusion Criteria & No Missing values"
ta subpop2

save,replace
variable subpop2 already defined
r(110);

end of do-file
r(110);

6 Calculating number remaining at each step

<= 200% FPL

use "C:\Users\Matt\Documents\EPI536\EPI536-Assignments\NHANES0708_newvars.dta"
ta fpl_instudy age_instudy
 RECODE of |
  indfmpir |
 (Ratio of |  RECODE of ridageyr
    family |   (Age at Screening
 income to | Adjudicated - Recode)
  poverty) |         0          1 |     Total
-----------+----------------------+----------
         0 |     3,965      1,191 |     5,156 
         1 |     3,562      1,431 |     4,993 
-----------+----------------------+----------
     Total |     7,527      2,622 |    10,149 

missing primary outcome (BMI)

use "C:\Users\Matt\Documents\EPI536\EPI536-Assignments\NHANES0708_newvars.dta"

gen miss_bmi=missing(bmxbmi)
ta subpop1 miss_bmi
     Meets |
 Inclusion |       miss_bmi
  Criteria |         0          1 |     Total
-----------+----------------------+----------
        No |     7,473      1,245 |     8,718 
       Yes |     1,388         43 |     1,431 
-----------+----------------------+----------
     Total |     8,861      1,288 |    10,149 

missing secondary outcome (waist circumfrence, WC)

use "C:\Users\Matt\Documents\EPI536\EPI536-Assignments\NHANES0708_newvars.dta"

gen miss_bmi=missing(bmxbmi)
gen miss_waist=missing(bmxwaist)
ta subpop1 miss_waist if miss_bmi==0
     Meets |
 Inclusion |      miss_waist
  Criteria |         0          1 |     Total
-----------+----------------------+----------
        No |     7,164        309 |     7,473 
       Yes |     1,358         30 |     1,388 
-----------+----------------------+----------
     Total |     8,522        339 |     8,861 

missing primary exposure (Food stamps; WIC; free/reduced school meals)

use "C:\Users\Matt\Documents\EPI536\EPI536-Assignments\NHANES0708_newvars.dta"

ta miss_iv miss_dv if subpop1==1
   Missing |   Missing Dependent
 Dependent |       Variables
 Variables |        No        Yes |     Total
-----------+----------------------+----------
        No |     1,321         67 |     1,388 
       Yes |        37          6 |        43 
-----------+----------------------+----------
     Total |     1,358         73 |     1,431 

Missing Effect Modifier (food security)

use "C:\Users\Matt\Documents\EPI536\EPI536-Assignments\NHANES0708_newvars.dta"

ta fsdch if subpop2==1
 Child food |
   security |
   category |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |        867       65.63       65.63
          2 |        162       12.26       77.90
          3 |        251       19.00       96.90
          4 |         41        3.10      100.00
------------+-----------------------------------
      Total |      1,321      100.00

missing Gender or Age

use "C:\Users\Matt\Documents\EPI536\EPI536-Assignments\NHANES0708_newvars.dta"

ta ridageyr if subpop2==1
ta riagendr if subpop2==1
     Age at |
  Screening |
Adjudicated |
   - Recode |      Freq.     Percent        Cum.
------------+-----------------------------------
          4 |        124        9.39        9.39
          5 |        111        8.40       17.79
          6 |        107        8.10       25.89
          7 |        104        7.87       33.76
          8 |        121        9.16       42.92
          9 |        112        8.48       51.40
         10 |        108        8.18       59.58
         11 |        105        7.95       67.52
         12 |         84        6.36       73.88
         13 |         69        5.22       79.11
         14 |         84        6.36       85.47
         15 |         71        5.37       90.84
         16 |         70        5.30       96.14
         17 |         51        3.86      100.00
------------+-----------------------------------
      Total |      1,321      100.00

     Gender |      Freq.     Percent        Cum.
------------+-----------------------------------
          1 |        677       51.25       51.25
          2 |        644       48.75      100.00
------------+-----------------------------------
      Total |      1,321      100.00

missing health insurance

use "C:\Users\Matt\Documents\EPI536\EPI536-Assignments\NHANES0708_newvars.dta"

ta hinsur if subpop2==1
     hinsur |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |        243       18.40       18.40
          1 |        835       63.21       81.60
          2 |        243       18.40      100.00
------------+-----------------------------------
      Total |      1,321      100.00

Missing primary respondent gender, age, or education

use "C:\Users\Matt\Documents\EPI536\EPI536-Assignments\NHANES0708_newvars.dta"

ta pr_ed3 if subpop2==1
        pr_ed3 |      Freq.     Percent        Cum.
---------------+-----------------------------------
>=Some college |        396       29.98       29.98
        HS/GED |        360       27.25       57.23
           <HS |        565       42.77      100.00
---------------+-----------------------------------
         Total |      1,321      100.00