Created
April 15, 2018 22:44
-
-
Save umran/e456c6576427cc7038e1a810e096feaa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clear all | |
cd "~/irukandjilabs/econ490" | |
use "data/Women_complete_3states.dta" | |
gen children_ever_born = v201 | |
gen done = 0 | |
replace done = 1 if v605 == 5 | v605 == 6 | v605 == 7 | |
recode done 0 = . if v605 == . | |
gen tfr = children_ever_born if done == 1 | |
gen education_attainment = v149 | |
gen education_years = v133 | |
recode education_years 97 = . | |
gen knows_modern_contra = 0 | |
recode knows_modern_contra 0 = 1 if v301 == 3 | |
recode knows_modern_contra 0 = . if v301 == . | |
gen aware_std = 0 | |
recode aware_std 0 = 1 if v750 == 1 | |
recode aware_std 0 = . if v750 == 8 | |
recode aware_std 0 = . if v750 == . | |
gen knows_condoms_reduce_aids_risk = 0 | |
recode knows_condoms_reduce_aids_risk 0 = 1 if v754cp == 1 | |
recode knows_condoms_reduce_aids_risk 0 = . if v754cp == 8 | |
recode knows_condoms_reduce_aids_risk 0 = . if v754cp == . | |
gen always_aware_of_ovulatory = 0 | |
recode always_aware_of_ovulatory 0 = 1 if v217 == 5 | |
gen midcycle_aware_of_ovulatory = 0 | |
recode midcycle_aware_of_ovulatory 0 = 1 if v217 == 3 | v217 == 5 | |
recode midcycle_aware_of_ovulatory 0 = . if v217 == . | |
gen hug_aids = 0 | |
recode hug_aids 0 = 1 if s907 == 0 | |
recode hug_aids 0 = . if s907 == . | |
gen age = v012 | |
gen urban = 0 | |
recode urban 0 = 1 if v025 == 1 | |
recode urban 0 = . if v025 == . | |
gen ideal_no_children = v613 | |
recode ideal_no_children 96 = . | |
recode ideal_no_children 98 = . | |
gen could_get_condom = v769 | |
recode could_get_condom 8 = . | |
gen wealth = v190 | |
label variable wealth "wealth" | |
label define wealth 1 "poorest" 2 "poorer" 3 "middle" 4 "richer" 5 "richest" | |
label values wealth wealth | |
gen dead_children = v206 + v207 | |
*NEW CODE | |
gen currently_preg = v213 | |
gen birth_past_year = 0 | |
recode birth_past_year 0 = 1 if v209 == 1 | v209 == 2 | |
recode birth_past_year 0 = . if v209 == . | |
gen child_preg_recent = birth_past_year | |
recode child_preg_recent 0 = 1 if v213 == 1 | |
recode child_preg_recent . = 1 if v213 == 1 | |
recode child_preg_recent 0 = . if v213 == . | |
*this above is a test to make sure that ppl going to these lhs were not pregnant/recent child women. | |
*s356 = met in past 3 months with anm/lhv | |
gen met_anm_lhv = s356 | |
gen education_collapsed = 0 | |
recode education_collapsed 0 = 1 if education_attainment == 1 | education_attainment == 2 | |
recode education_collapsed 0 = 2 if education_attainment == 3 | education_attainment == 4 | |
recode education_collapsed 0 = 3 if education_attainment == 5 | |
recode education_collapsed 0 = . if education_attainment == . | |
label define education_collapsed_labels 0 "none" 1 "primary" 2 "secondary" 3 "higher" | |
label values education_collapsed education_collapsed_labels | |
*v836=number of total partners of respondent | |
gen more_than_one = 0 | |
recode more_than_one 0 = 1 if v836 == 2 | v836 == 3 | |
recode more_than_one 0 = . if v836 == . | |
gen use_modern_method = 0 | |
recode use_modern_method 0 = 1 if v302 == 3 | |
recode use_modern_method 0 = . if v302 == . | |
*NEW CODE MARCH 24TH | |
* gen reason = 9 | |
* recode reason 9=0 if s356==0 | |
* recode reason 9=1 if s362b==1 | |
* recode reason 9=2 if s362g==1 | |
* recode reason 9=3 if s362h==1 | |
* recode reason 9=4 if s362a==1 | |
* recode reason 9=5 if s362c==1 | |
* recode reason 9=6 if s362i==1 | |
* recode reason 9=7 if s362p==1 | |
* recode reason 9=8 | |
* rename reason reason_to_meet_nurse | |
* label variable reason_to_meet_nurse "reason to meet nurse" | |
* label define reasona 0 "did not go" 1 "immunization" 2 "disease prevention" 3 "medical treatment for self" 4 "family planning" 5 "antenatal care" 6 "treatment for sick child" 7 "nutrition/health education" 8 "other" | |
* label values reason_to_meet_nurse reasona | |
* tab reason_to_meet_nurse | |
gen family_planning = s362a | |
* aids knowledge aggregation | |
gen aggre1 = 0 | |
recode aggre1 0 = 1 if v754bp == 1 | |
recode aggre1 0 = . if v754bp == . | |
gen aggre2 = 0 | |
recode aggre2 0 = 1 if v754cp == 1 | |
recode aggre2 0 = . if v754cp == . | |
gen aggre3 = 0 | |
recode aggre3 0 = 1 if v754dp == 1 | |
recode aggre3 0 = . if v754dp == . | |
gen aggre4 = 0 | |
recode aggre4 0 = 1 if v754jp == 0 | |
recode aggre4 0 = . if v754jp == . | |
gen aggre5 = 0 | |
recode aggre5 0 = 1 if v754wp == 0 | |
recode aggre5 0 = . if v754wp == . | |
gen aggre6 = 0 | |
recode aggre6 0 = 1 if s907 == 0 | |
recode aggre6 0 = . if s907 == . | |
gen agg_aids_aware = aggre1 + aggre2 + aggre3 + aggre4 + aggre5 + aggre6 | |
gen recent_sex = 9 | |
recode recent_sex 9 = 0 if v536 == 3 | v536 == 0 | |
recode recent_sex 9 = 1 if v536 == 1 | |
recode recent_sex 9 = . if v536 == 2 | |
recode recent_sex 9 = . if v536 == . | |
gen religion_collapsed = 3 | |
recode religion_collapsed 3 = 0 if v130 == 1 | |
recode religion_collapsed 3 = 1 if v130 == 2 | |
recode religion_collapsed 3 = 2 if v130 == 3 | |
recode religion_collapsed 3 = . if v130 == . | |
label define religion_collapsed_labels 0 "hindu" 1 "muslim" 2 "christian" 3 "other" | |
label values religion_collapsed religion_collapsed_labels | |
* set state as the panel level | |
xtset v024 | |
*finds that religion does effect the awareness of aids, thus is a potential confounding factor. | |
*dep var: | |
* tfr | |
*indep.var: | |
* i.reason_to_meet_nurse | |
* agg_aids_aware | |
* knows_modern_contra | |
* midcycle_aware_of_ovulatory | |
*controls | |
* i.education_attainment | |
* education_years | |
* i.wealth | |
* age | |
* urban | |
* -ideal_no_children | |
* dead_children | |
* i.religion_collapsed | |
* -recent_sex | |
* use_modern_method | |
* -birth_past_year | |
* -currently_preg | |
*set of regressions for family planning | |
xtreg tfr family_planning | |
est sto tfr_FP_1 | |
xtreg tfr family_planning i.education_collapsed | |
est sto tfr_FP_2 | |
xtreg tfr family_planning i.education_collapsed i.wealth | |
est sto tfr_FP_3 | |
xtreg tfr family_planning i.education_collapsed i.wealth age urban dead_children i.religion_collapsed | |
est sto tfr_FP_4 | |
xtreg tfr family_planning i.education_collapsed i.wealth age urban dead_children i.religion_collapsed use_modern_method | |
est sto tfr_FP_5 | |
esttab tfr_FP_1 tfr_FP_2 tfr_FP_3 tfr_FP_4 tfr_FP_5 using ~/irukandjilabs/econ490/results_final/tfr_fp.txt, se aic obslast scalar(F) bic r2 | |
* set of regressions for aids aware | |
xtreg tfr agg_aids_aware | |
est sto tfr_Aids_1 | |
xtreg tfr agg_aids_aware i.education_collapsed | |
est sto tfr_Aids_2 | |
xtreg tfr agg_aids_aware i.education_collapsed i.wealth | |
est sto tfr_Aids_3 | |
xtreg tfr agg_aids_aware i.education_collapsed i.wealth age urban dead_children i.religion_collapsed | |
est sto tfr_Aids_4 | |
xtreg tfr agg_aids_aware i.education_collapsed i.wealth age urban dead_children i.religion_collapsed use_modern_method | |
est sto tfr_Aids_5 | |
esttab tfr_Aids_1 tfr_Aids_2 tfr_Aids_3 tfr_Aids_4 tfr_Aids_5 using ~/irukandjilabs/econ490/results_final/tfr_aids.txt, se aic obslast scalar(F) bic r2 | |
* set of regressions for know modern contra method | |
xtreg tfr knows_modern_contra | |
est sto tfr_modern_1 | |
xtreg tfr knows_modern_contra i.education_collapsed | |
est sto tfr_modern_2 | |
xtreg tfr knows_modern_contra i.education_collapsed i.wealth | |
est sto tfr_modern_3 | |
xtreg tfr knows_modern_contra i.education_collapsed i.wealth age urban dead_children i.religion_collapsed | |
est sto tfr_modern_4 | |
xtreg tfr knows_modern_contra i.education_collapsed i.wealth age urban dead_children i.religion_collapsed use_modern_method | |
est sto tfr_modern_5 | |
esttab tfr_modern_1 tfr_modern_2 tfr_modern_3 tfr_modern_4 tfr_modern_5 using ~/irukandjilabs/econ490/results_final/tfr_modern.txt, se aic obslast scalar(F) bic r2 | |
* set of regressions for ovulatory cycle aware | |
xtreg tfr midcycle_aware_of_ovulatory | |
est sto tfr_ovu_1 | |
xtreg tfr midcycle_aware_of_ovulatory i.education_collapsed | |
est sto tfr_ovu_2 | |
xtreg tfr midcycle_aware_of_ovulatory i.education_collapsed i.wealth | |
est sto tfr_ovu_3 | |
xtreg tfr midcycle_aware_of_ovulatory i.education_collapsed i.wealth age urban dead_children i.religion_collapsed | |
est sto tfr_ovu_4 | |
xtreg tfr midcycle_aware_of_ovulatory i.education_collapsed i.wealth age urban dead_children i.religion_collapsed use_modern_method | |
est sto tfr_ovu_5 | |
esttab tfr_ovu_1 tfr_ovu_2 tfr_ovu_3 tfr_ovu_4 tfr_ovu_5 using ~/irukandjilabs/econ490/results_final/tfr_ovu.txt, se aic obslast scalar(F) bic r2 | |
*** Repeat The Same Regressions Using Ideal Number of Children as the Outcome *** | |
*set of regressions for family planning | |
xtreg ideal_no_children family_planning | |
est sto ideal_FP_1 | |
xtreg ideal_no_children family_planning i.education_collapsed | |
est sto ideal_FP_2 | |
xtreg ideal_no_children family_planning i.education_collapsed i.wealth | |
est sto ideal_FP_3 | |
xtreg ideal_no_children family_planning i.education_collapsed i.wealth age urban dead_children i.religion_collapsed | |
est sto ideal_FP_4 | |
xtreg ideal_no_children family_planning i.education_collapsed i.wealth age urban dead_children i.religion_collapsed use_modern_method | |
est sto ideal_FP_5 | |
esttab ideal_FP_1 ideal_FP_2 ideal_FP_3 ideal_FP_4 ideal_FP_5 using ~/irukandjilabs/econ490/results_final/ideal_fp.txt, se aic obslast scalar(F) bic r2 | |
* set of regressions for aids aware | |
xtreg ideal_no_children agg_aids_aware | |
est sto ideal_Aids_1 | |
xtreg ideal_no_children agg_aids_aware i.education_collapsed | |
est sto ideal_Aids_2 | |
xtreg ideal_no_children agg_aids_aware i.education_collapsed i.wealth | |
est sto ideal_Aids_3 | |
xtreg ideal_no_children agg_aids_aware i.education_collapsed i.wealth age urban dead_children i.religion_collapsed | |
est sto ideal_Aids_4 | |
xtreg ideal_no_children agg_aids_aware i.education_collapsed i.wealth age urban dead_children i.religion_collapsed use_modern_method | |
est sto ideal_Aids_5 | |
esttab ideal_Aids_1 ideal_Aids_2 ideal_Aids_3 ideal_Aids_4 ideal_Aids_5 using ~/irukandjilabs/econ490/results_final/ideal_aids.txt, se aic obslast scalar(F) bic r2 | |
* set of regressions for know modern contra method | |
xtreg ideal_no_children knows_modern_contra | |
est sto ideal_modern_1 | |
xtreg ideal_no_children knows_modern_contra i.education_collapsed | |
est sto ideal_modern_2 | |
xtreg ideal_no_children knows_modern_contra i.education_collapsed i.wealth | |
est sto ideal_modern_3 | |
xtreg ideal_no_children knows_modern_contra i.education_collapsed i.wealth age urban dead_children i.religion_collapsed | |
est sto ideal_modern_4 | |
xtreg ideal_no_children knows_modern_contra i.education_collapsed i.wealth age urban dead_children i.religion_collapsed use_modern_method | |
est sto ideal_modern_5 | |
esttab ideal_modern_1 ideal_modern_2 ideal_modern_3 ideal_modern_4 ideal_modern_5 using ~/irukandjilabs/econ490/results_final/ideal_modern.txt, se aic obslast scalar(F) bic r2 | |
* set of regressions for ovulatory cycle aware | |
xtreg ideal_no_children midcycle_aware_of_ovulatory | |
est sto ideal_ovu_1 | |
xtreg ideal_no_children midcycle_aware_of_ovulatory i.education_collapsed | |
est sto ideal_ovu_2 | |
xtreg ideal_no_children midcycle_aware_of_ovulatory i.education_collapsed i.wealth | |
est sto ideal_ovu_3 | |
xtreg ideal_no_children midcycle_aware_of_ovulatory i.education_collapsed i.wealth age urban dead_children i.religion_collapsed | |
est sto ideal_ovu_4 | |
xtreg ideal_no_children midcycle_aware_of_ovulatory i.education_collapsed i.wealth age urban dead_children i.religion_collapsed use_modern_method | |
est sto ideal_ovu_5 | |
esttab ideal_ovu_1 ideal_ovu_2 ideal_ovu_3 ideal_ovu_4 ideal_ovu_5 using ~/irukandjilabs/econ490/results_final/ideal_ovu.txt, se aic obslast scalar(F) bic r2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment