#delimit; clear; set mem 80M; set matsize 300; capture log close; cd "C:\Documents and Settings\cdumas\Mes documents\Madagascar\Impact evaluation\Stata"; log using Log\mobsoc_M1, replace; set more off; /*********************************************************************************/ /**** Social mobility in Madagascar **********************************************/ /**** Christelle **********************************************/ /**** Nov, 17th - 2009 ***********************************************************/ /*********************************************************************************/ /*************************************************************************************************************************/ /************************ 1. FILE CREATION *******************************************************************************/ /*************************************************************************************************************************/ use Data\Menage\Demo_2; sort id_menage codeid; merge id_menage codeid using Data\Menage\educ_2; tab _merge; drop _merge; sort id_menage codeid; merge id_menage codeid using Data\Menage\parent; tab _merge; drop _merge; sort id_menage; keep id_menage codeid ecol scol agec edupere edumere sexe CODECORNELL m3aq43 edu annedu prim_p coll_p lyc_p prim_m coll_m lyc_m; /*************************************************************************************************************************/ /************************ 2. DESCRIPTIVE STATISTICS **********************************************************************/ /*************************************************************************************************************************/ desc; tab ecol if agec>=7 & agec<=21; /* has been to school? */ tab scol if agec>=7 & agec<=21; /* still enrolled, */ gen ascol=scol; replace ascol=0 if ecol==0; tab ascol if agec>=7 & agec<=21; table agec if agec>=7 & agec<=21, c(freq mean ecol mean ascol); /* has been to school and presently enrolled */ tab m3aq43 if agec>=15 & agec<=25; /* age of entry */ tab edu if agec>=19 & agec<=25; /* education level */ tab annedu if agec>=19 & agec<=25; /* number of years of education */ tab annedu if ascol==0 & agec<=25; hist annedu if agec>=19 & agec<=25; tab edupere if agec>=11 & agec<=21; /* education level of the parents */ tab edumere if agec>=11 & agec<=21; corr edupere edumere if agec>=11 & agec<=21; pwcorr edupere edumere if agec>=11 & agec<=21, star(.05); /*************************************************************************************************************************/ /************************ 3. INTERGENERATIONAL MOBILITY ******************************************************************/ /*************************************************************************************************************************/ tab edupere ecol if agec>=11 & agec<=21; tab edupere ecol if agec>=11 & agec<=21, row col ; tab edumere ecol if agec>=11 & agec<=21, row col ; tab edupere edu if agec>=19 & agec<=25, row ; tab edumere edu if agec>=19 & agec<=25, row; /*************************************************************************************************************************/ /************************ 4. REGRESSIONS *********************************************************************************/ /*************************************************************************************************************************/ reg annedu edupere edumere sexe agec if agec>=19 & agec<=25; xi: reg annedu edupere edumere sexe agec i.CODECORNELL if agec>=19 & agec<=25; test edupere=edumere; /*************************************************************************************************************************/ /************************ 5.INSTRUMENTATIONS *****************************************************************************/ /*************************************************************************************************************************/ global infrapm "prim_p coll_p lyc_p prim_m coll_m lyc_m"; ivreg annedu (edupere edumere = $infrapm) sexe agec if agec>=19 & agec<=25; xi: ivreg annedu (edupere edumere = $infrapm) sexe agec i.CODECORNELL if agec>=19 & agec<=25, first; est store twosls; test edupere=edumere; xi: reg annedu edupere edumere sexe agec i.CODECORNELL if agec>=19 & agec<=25 & prim_p!=. & coll_p!=. & lyc_p!=. & prim_m!=. & coll_m!=. & lyc_m!=.; est store ols; hausman twosls ols; /***************************************************************************************************************************/ /************************* 6. WEAK INSTRUMENTS ? ***************************************************************************/ /***************************************************************************************************************************/ xi: reg edupere $infrapm sexe agec i.CODECORNELL if agec>=19 & agec<=25; test $infrapm; xi: reg edumere $infrapm sexe agec i.CODECORNELL if agec>=19 & agec<=25; test $infrapm; log close;