drop _all capture log close set more 1 capture log using NHANES_linear.log, replace ******************************************************* * Data Analysis - Sample Stata Program * * NHANES_linear.do * * Evaluation of Predictors for Systolic BP * * Bivariate & Multivariate Results for DepVar=Bpxsy1 * * For CSP Summer Seminar in 2004 * ******************************************************* use NHANES_transformed * For DepVars = bpxsy1 * Key IndVars = age, gender, race/ethnicity & educ * look only at adults drop if age<18 quietly { * Make a global macro command for full casemix model global demog "age female i.race" global social "i.educ3 i.income" global health "i.healthst bmi" global all "$demog $social $health" } * * For Table 3: Results for DepVar = bpxsy1(contiuous DepVar) * pwcorr bpxsy1 age reg bpxsy1 age,beta **generate a dichotomous variable for race=black gen black=race recode black 1 3 4=0 2=1 ttest bpxsy1, by(black) sampsi 125 120, sd(22) r(0.046) p(.8) sampsi 125 227.5, sd(22) r(0.046) p(.8) tab educ3,sum(bpxsy1) oneway bpxsy1 educ3, scheffe * * Get Standardized Beta Coefficients * * Controlling for demographics qui xi: reg bpxsy1 $demog, beta reformat qui xi: reg bpxsy1 $demog i.educ3, beta reformat * Controlling for sociodemographics qui xi: reg bpxsy1 $demog $social, beta reformat * Controlling for full casemix model qui xi: reg bpxsy1 $all, beta reformat * Full regression model with 95% CIs qui xi: reg bpxsy1 $all reformat log close