*******************************
*******************************
***** LOGISTIC REGRESSION *****
*******************************
*******************************
* To run code you hilight the code you wish to run and hit Control+d
* NOTE: This do file should not be distributed without the written
* permission of Raeda Anderson, Ph.D
*************************
*************************
****** DATA SET UP ******
*************************
*************************
* pull in data
use http://www.stata-press.com/data/r15/lbw.dta
* look at study variables
codebook low smoke age race ht ui ftv
* generate black variable
gen black = .
replace black =1 if race == 2
replace black =0 if race == 1
replace black =0 if race == 3
*generate white variable
gen white = .
replace white =1 if race == 1
replace white =0 if race == 2
replace white =0 if race == 3
*******************************
*******************************
***** LOGISTIC REGRESSION *****
*******************************
*******************************
***** Predicting Low Birth Weight *****
*******************
*** ODDS RATIOS ***
*******************
* Model 1
logistic low smoke
* Model 2
logistic low smoke ht
* Model 3
logistic low smoke ht black
* Model 4
logistic low smoke ht black white
********************************
*** CORRELATION COEFFICIENTS ***
********************************
* Model 1
logistic low smoke, coef
* Model 2
logistic low smoke age, coef
* Model 3
logistic low smoke age black, coef
* Model 4
logistic low smoke age black white, coef
***** Predicting Smoking During Pregnancy *****
*******************
*** ODDS RATIOS ***
*******************
* Model 1
logistic smoke ht
* Model 2
logistic smoke ht age
* Model 3
logistic smoke ht age ptl