cd "Q:\My Drive\HEAL_LAB\STATA Training\data_sets" **import the data ** import excel using birth_data.xlsx, first sh("data") clear ** this estimates the first model ** reg birthweight gestation ** create a scatter plot for the first model ** scatter birthweight gestation, mcolor(gray) mfcolor(red) ** create a scatter plot with best fit line ** twoway (scatter birthweight gestation, msymbol(plus) mcolor(emerald)) (lfit birthweight gestation, lcolor(forestgreen)) ** create table ** sum birthweight if boy==0 sum birthweight if boy==1 ttest birthweight, by(boy) *** estiamte the model with months *** *option 1 - create dummy variables for each month * tab birth_month, gen(month) reg birthweight month2-month12 *option 2 - use fixed effects * reg birthweight i.birth_month * option "i will lose in a stata death match" * gen feb=0 replace feb=1 if birth_month==2 gen mar=0 replace mar=1 if birth_month==3 //I'm not going to finish this because i don't hate myself// *** estimate the 5 models into one table *** *first, need to create a dummy variable for smoking* gen smoke=0 replace smoke=1 if cigar>0 * model 1* reg birthweight smoke outreg2 using application_table.xls, se bracket replace *model 2 * reg birthweigh smoke gestation outreg2 using application_table.xls, se bracket append *model 3 * reg birthweigh smoke gestation weight_gain outreg2 using application_table.xls, se bracket append *model 4 * *need to create dummy for married * gen married=0 replace married=1 if mother_married=="yes" reg birthweigh smoke gestation weight_gain married outreg2 using application_table.xls, se bracket append *model 5 * reg birthweigh smoke gestation weight_gain married i.birth_month outreg2 using application_table.xls, se bracket append