Hello,
I'm working with survey data to examine the association between, for example, BMI and heart attack outcomes, while accounting for survey design effects (using SVY commands). I noticed in the SVY help files the following quote:
"Warning: Using if or in restrictions will often not produce correct variance estimates for subpopulations. To compute estimates for subpopulations, use the subpop() option."
Questions:
1. I have a set of inclusion/exclusion criteria that I would like to apply to the cohort. Is it OK for me to drop the excluded records from the data set before running my regressions? Or do I have to use the subpop command?
2. Also, for interaction terms, is it valid to use the "##" operator (and the lincom function) with the SVY prefix?
3. Finally, if I want stratified estimates, then I should be using the subpop option (to include the entire sample in the variance calculations), correct?
Thanks
ALL CODE TOGETHER:
I'm working with survey data to examine the association between, for example, BMI and heart attack outcomes, while accounting for survey design effects (using SVY commands). I noticed in the SVY help files the following quote:
"Warning: Using if or in restrictions will often not produce correct variance estimates for subpopulations. To compute estimates for subpopulations, use the subpop() option."
Questions:
1. I have a set of inclusion/exclusion criteria that I would like to apply to the cohort. Is it OK for me to drop the excluded records from the data set before running my regressions? Or do I have to use the subpop command?
Code:
use "http://www.stata-press.com/data/r13/nhanes2.dta", clear svydescribe generate included=1 if region==3 replace included=0 if region!=3 /*Do I use the subpop command to apply my exclusion criteria?*/ svy, subpop(included): logistic heartatk c.bmi i.race i.diabetes c.age /*Or do I just drop the excluded records, since I'm not interested in analyzing these as a sub-population, but rather as a final study cohort with exclusion criteria applied?*/ svy: logistic heartatk c.bmi i.race i.diabetes c.age if included==1
Code:
svy: logistic heartatk c.bmi##i.female i.race i.diabetes c.age if included==1 /*odds ratios for effect of BMI on heart attack, for men*/ lincom _b[c.bmi]+_b[c.bmi#0.female], or /*odds ratios for effect of BMI on heart attack, for women*/ lincom _b[c.bmi]+_b[c.bmi#1.female], or
Code:
generate male=1 if female==0 replace male=0 if female==1 /**********effect of BMI on heart attack, for MEN**********/ /*use subpop?*/ svy, subpop(male): logistic heartatk c.bmi i.race i.diabetes c.age /*but don't use "if" restrictions?*/ svy: logistic heartatk c.bmi i.race i.diabetes c.age if female==0 /**********effect of BMI on heart attack, for WOMEN**********/ /*use subpop?*/ svy, subpop(female): logistic heartatk c.bmi i.race i.diabetes c.age /*but don't use "if" restrictions?*/ svy: logistic heartatk c.bmi i.race i.diabetes c.age if female==1
ALL CODE TOGETHER:
Code:
use "http://www.stata-press.com/data/r13/nhanes2.dta", clear svydescribe /*QUESTION 1*/ generate included=1 if region==3 replace included=0 if region!=3 /*Do I use the subpop command to apply my exclusion criteria?*/ svy, subpop(included): logistic heartatk c.bmi i.race i.diabetes c.age /*Or do I just drop the excluded records, since I'm not interested in analyzing these as a sub-population, but rather as a final study cohort with exclusion criteria applied?*/ svy: logistic heartatk c.bmi i.race i.diabetes c.age if included==1 /*QUESTION 2*/ svy: logistic heartatk c.bmi##i.female i.race i.diabetes c.age if included==1 /*odds ratios for effect of BMI on heart attack, for men*/ lincom _b[c.bmi]+_b[c.bmi#0.female], or /*odds ratios for effect of BMI on heart attack, for women*/ lincom _b[c.bmi]+_b[c.bmi#1.female], or /*QUESTION 3*/ generate male=1 if female==0 replace male=0 if female==1 /**********effect of BMI on heart attack, for MEN**********/ /*use subpop?*/ svy, subpop(male): logistic heartatk c.bmi i.race i.diabetes c.age /*but don't use "if" restrictions?*/ svy: logistic heartatk c.bmi i.race i.diabetes c.age if female==0 /**********effect of BMI on heart attack, for WOMEN**********/ /*use subpop?*/ svy, subpop(female): logistic heartatk c.bmi i.race i.diabetes c.age /*but don't use "if" restrictions?*/ svy: logistic heartatk c.bmi i.race i.diabetes c.age if female==1
Comment