*Stata code to fit the models in the paper *Francavilla F., Giannelli G.C. & Grilli L. (2012) *Mothers' Employment and their Children's Schooling: A Joint Multilevel Analysis for India. *World Development http://dx.doi.org/10.1016/j.worlddev.2012.05.031 *models are fitted using Stata 11 SE with the gllamm command *for questions about this code, please contact Leonardo Grilli (grilli@ds.unifi.it) *Florence, 9 July 2012 ******************************************************************************************************* /* DATASET (sorry, data cannot be distributed): we have a dataset with one row for each mother (where y=1 if the mother works), followed by one row for each of her children (where y=1 if the child attends school); the rows for the mothers are denoted by a dummy variable eq_mother==1, whereas the rows for the children are denoted by a dummy variable eq_children=1 (note: eq_children=1-eq_mother); the dummy variable urban=1 picks up the urban subsample VARIABLES: motherid: mother's identification code y: response (defined above) mage: mother’s age myedu mliterate: years of mother’s education and dummy for myedu>0 csex cage: child sex and age nover14: number of household members over 14 nchildown0_5 nchildown6_14: number of children of the mother in the sample nchildother0_5 nchildother6_14: number of children in the household (not of the mother in the sample) hhMuslim hhChristian: dummies for religion of head of household (baseline: indu and others) hhschcastrib: dummy for head of household is in scheduled caste or tribe wlthindf: household wealth index (from -1.52921 to 2.78912) acres_d100: acres of land owned by the household pprofes psales pskill: dummies for partner’s job geoarea1 geoarea2 geoarea3 geoarea4 geoarea5: dummies for geographical areas (baseline: South) note: varname2 denotes the square of varname, e.g. wlthindf2 is wlthindf^2 */ * 1) ONLY MOTHER EQUATION (urban subsample) probit y /* */ nchildown0_5 /* */ nover14 /* */ mliterate myedu mage /* */ hhMuslim hhChristian hhschcastrib /* */ wlthindf wlthindf2 acres_d100 acres_d1002 pprofes psales pskill /* */ geoarea1 geoarea2 geoarea3 geoarea4 geoarea5 /* */ if (eq_mother==1 & urban==1) * 2) ONLY CHILDREN EQUATION (urban subsample) xtprobit y /* */ cage cage2 csex /* */ nchildown0_5 nchildown0_52 nchildown6_14 nchildown6_142 /* */ childother0_5 nover14 /* */ mliterate myedu mage /* */ hhMuslim hhChristian hhschcastrib /* */ wlthindf wlthindf2 acres_d100 acres_d1002 pprofes psales pskill /* */ geoarea1 geoarea2 geoarea3 geoarea4 geoarea5 /* */ if (eq_children==1 & urban==1), i(motherid) quad(5) * 3) JOINT MODEL (CORRELATED EQUATIONS FOR MOTHERS AND CHILDREN) *set the constraint Var(u_j)=1 for the mother equation constraint define 1 [mot1_1]eq_mother=1 *define the equations for the random effects (needed for gllamm) eq um: eq_mother eq uc: eq_children *generate equation indicators with shorter names (just for convenience) gen e1 = eq_mother gen e2 = eq_children *generate the equation specific-covariates gen e1nchildown0_5 = e1*nchildown0_5 gen e2nchildown0_5 = e2*nchildown0_5 gen e2nchildown0_52 = e2*nchildown0_52 gen e2nchildown6_14 = e2*nchildown6_14 gen e2nchildown6_142 = e2*nchildown6_142 gen e1childother0_5 = e1*childother0_5 gen e2childother0_5 = e2*childother0_5 gen e1nover14 = e1*nover14 gen e2nover14 = e2*nover14 gen e1ilmliterate = e1*ilmliterate gen e2ilmliterate = e2*ilmliterate gen e1myedu = e1*myedu gen e2myedu = e2*myedu gen e1mage = e1*mage gen e2mage = e2*mage gen e1hhMuslim = e1*hhMuslim gen e2hhMuslim = e2*hhMuslim gen e1hhChristian = e1*hhChristian gen e2hhChristian = e2*hhChristian gen e1hhschcastrib = e1*hhschcastrib gen e2hhschcastrib = e2*hhschcastrib gen e1wlthindf = e1*wlthindf gen e2wlthindf = e2*wlthindf gen e1wlthindf2 = e1*wlthindf2 gen e2wlthindf2 = e2*wlthindf2 gen e1acres_d100 = e1*acres_d100 gen e2acres_d100 = e2*acres_d100 gen e1acres_d1002 = e1*acres_d1002 gen e2acres_d1002 = e2*acres_d1002 gen e1pprofes = e1*pprofes gen e2pprofes = e2*pprofes gen e1psales = e1*psales gen e2psales = e2*psales gen e1pskill = e1*pskill gen e2pskill = e2*pskill gen e1geoarea1 = e1*geoarea1 gen e2geoarea1 = e2*geoarea1 gen e1geoarea2 = e1*geoarea2 gen e2geoarea2 = e2*geoarea2 gen e1geoarea3 = e1*geoarea3 gen e2geoarea3 = e2*geoarea3 gen e1geoarea4 = e1*geoarea4 gen e2geoarea4 = e2*geoarea4 gen e1geoarea5 = e1*geoarea5 gen e2geoarea5 = e2*geoarea5 gen e2cage = e2*cage recode e2cage (. = 0) gen e2cage2 = e2*cage2 recode e2cage2 (. = 0) gen e2csex = e2*csex recode e2csex (. = 0) *fit the model using gllamm (urban sample, adaptive quadrature with 5 points) gllamm y /* */ eq_mother e1nchildown0_5 /* */ e1nover14 /* */ e1ilmliterate e1myedu e1mage /* */ e1hhMuslim e1hhChristian e1hhschcastrib /* */ e1wlthindf e1wlthindf2 e1acres_d100 e1acres_d1002 e1pprofes e1psales e1pskill /* */ e1geoarea1 e1geoarea2 e1geoarea3 e1geoarea4 e1geoarea5 /* */ eq_children /* */ e2nchildown0_5 e2nchildown0_52 e2nchildown6_14 e2nchildown6_142 e2childother0_5 e2nover14 /* */ e2ilmliterate e2myedu e2mage /* */ e2hhMuslim e2hhChristian e2hhschcastrib /* */ e2wlthindf e2wlthindf2 e2acres_d100 e2acres_d1002 e2pprofes e2psales e2pskill /* */ e2geoarea1 e2geoarea2 e2geoarea3 e2geoarea4 e2geoarea5 e2cage e2cage2 e2csex /* */ if urban==1, /* */ nocons i(motherid) family(binomial) link(probit) /* */ nrf(2) eqs(um uc) constraint(1) nip(5) adapt trace dots *******************************************************************************************************