I need the regression output by three columns Full Sample , Rural and Urban for each dependent variable (separate variable)
I am using the following code but not getting the required output, please
foreach mortality in neonatal infant child {
/* All observations */
ivreg2 `mortality'_mortality ${child_vars} ${mother_vars} ${household_vars} (PM2_5 = night_inversions)
estadd local ysumm_label "Mean `mortality' mortality (per 1000 births)"
estadd matrix ysumm = r(mean)
esttab using abc.csv, append cells(b(star fmt(3)) se(par fmt(3))) stats(ysumm widstat N) ///
collabels(none) title("Impact of Air Pollution on `mortality' Mortality") ///
modelwidth(12) label nodepvars nomtitles ///
keep(PM2_5)
/* Rural areas only */
ivreg2 `mortality'_mortality ${child_vars} ${mother_vars} ${household_vars} (PM2_5 = night_inversions) if rural == 1
estadd local ysumm_label "Mean `mortality' mortality (per 1000 births)"
estadd matrix ysumm = r(mean)
esttab using abc.csv, append cells(b(star fmt(3)) se(par fmt(3))) stats(ysumm widstat N) ///
collabels(none) title("Impact of Air Pollution on `mortality' Mortality (Rural Areas Only)") ///
modelwidth(12) label nodepvars nomtitles ///
keep(PM2_5)
/* Urban areas only */
ivreg2 `mortality'_mortality ${child_vars} ${mother_vars} ${household_vars} (PM2_5 = night_inversions) if rural == 0
estadd local ysumm_label "Mean `mortality' mortality (per 1000 births)"
estadd matrix ysumm = r(mean)
esttab using abc.csv, append cells(b(star fmt(3)) se(par fmt(3))) stats(ysumm widstat N) ///
collabels(none) title("Impact of Air Pollution on `mortality' Mortality (Urban Areas Only)") ///
modelwidth(12) label nodepvars nomtitles ///
keep(PM2_5)
}
I am trying to provide the data using dataex command and getting the following error message please
. dataex age neonatal_mortality infant_mortality child_mortality male_child birth_order birth_weight birth_weight_record twi
> n child_age pregnancy_duration mother_age mother_education mother_height father_education wealth_index rural male_head hea
> d_age piped_water clean_fuel open_defecation frac_OD_village electricity religion caste household_size total_children PM2_
> 5 night_inversions child_month child_year
input statement exceeds linesize limit. Try specifying fewer variables
r(1000);
0 Response to Regresion output code help
Post a Comment