* This file replicates PK. * routine to run all the regression types reported in PK for a given dependent variable--unweighted and weighted OLS/Tobit/Probit, LIML with and without FE * option estcmd = reg/tobit/probit indicates dependent variable type cap program drop estimate program define estimate syntax varlist(ts) [if/], estcmd(string) [samplename(string) noNAIVE femaleonly *] local sexhead = cond("`femaleonly'"=="", "sexhead", "") if "`if'"=="" local if 1 tokenize `varlist' local depvar `1' macro shift local extra_covsy `*' quietly { // credit eq sample definitions exclude small # of HH with no one of right gender. may differ from P&K cmp setup cap drop ind? gen byte indf = pksamplef * /*!afadultd * */ cond(lfproglv<=C_0, $cmp_left, $cmp_cont) if `if' gen byte indm = pksamplem * /*!amadultd * */ cond(lmproglv<=C_0, $cmp_left, $cmp_cont) if `if' if "`estcmd'"=="tobit" gen byte indy = cond(`depvar'<=Y_0,$cmp_left,$cmp_cont) if `if' else gen byte indy = cond("`estcmd'"=="reg",$cmp_cont,$cmp_probit) if `if' } local covsm scohead afedhigh amedhigh afadultd `sexhead' agehead llandbef edhead hdbrolndd hdsislndd hdparlndd spbrolndd spsislndd spparlndd _Iwave* local covsf scohead afedhigh amedhigh amadultd sexhead agehead llandbef edhead hdbrolndd hdsislndd hdparlndd spbrolndd spsislndd spparlndd _Iwave* local villagechars primcoed hpruralh hpfampln hpmidwif pzrice pzwflour pzmoil pzhegg pzmilk pzpotato wagef nowagef wagem bamtr local covsy `extra_covsy' scohead afedhigh amedhigh afadultd amadultd sexhead agehead llandbef edhead hdbrolndd hdsislndd hdparlndd spbrolndd spsislndd spparlndd _Iwave* crcensored local xvars lfbraclv lmbraclv lfbrdblv lmbrdblv lfgramlv lmgramlv `covsy' if "`estcmd'" == "tobit" local ll ll local run `depvar'-`estcmd' `samplename' di _n as res "`run'" `estcmd' `depvar' `xvars' `villagechars' if (`if') & (!nontar | "`naive'"!="") `=cond("`depvar'"=="lfnlasset" | "`depvar'"=="lfasset","& !afadultd","")', `ll' local run `depvar'-weighted-`estcmd' `samplename' di _n as res "`run'" `estcmd' `depvar' `xvars' `villagechars' if (`if') & (!nontar | "`naive'"!="") `=cond("`depvar'"=="lfnlasset" | "`depvar'"=="lfasset","& !afadultd","")' [pw=weight], `ll' local run `depvar'-weighted-`estcmd'-FE `samplename' di _n as res "`run'" `estcmd' `depvar' `xvars' _Ivill* if `if' [pw=weight], cluster(nh) `ll' local run `depvar'-WESML-LIML `samplename' di _n as res "`run'" cmp (`depvar' = `xvars' `villagechars') (lfproglv = `covsf' `villagechars') (lmproglv = `covsm' `villagechars') if `if' [pw=weight], ind(indy indf indm) cluster(nh) `options' qui local run `depvar'-WESML-LIML-FE `samplename' di _n as res "`run'" cmp (`depvar' = `xvars' _Ivill*) (lfproglv = `covsf' _Ivill*) (lmproglv = `covsm' _Ivill*) if `if' [pw=weight], ind(indy indf indm) cluster(nh) `options' qui end cmp setup * odbc load, exec("select * from [Roodman & Morduch HH]") dsn(PK) clear use "Roodman & Morduch HH.dta", clear keep if wave<4 sort nh wave // order of observations matters for exact reproduction of RM results when using GHK algorithm replace pzwflour=0 if pzwflour==. // needed to match sample sizes. These prices are actually stored as 0 in original data. replace pzmilk=0 if pzmilk==. xi i.wave i.village gen double fasset = fnlasset + flandvalb gen byte ineligible = !eligible scalar C_0 = ln(1000) // rather than ln(1), which seems worse but matches PK better quietly { foreach var in proglv fproglv mproglv fbraclv mbraclv fbrdblv mbrdblv fgramlv mgramlv { gen double l`var' = ln(`var') recode l`var' (. = `=C_0') } replace landaf = .1 if landaf==0 // according to Pitt e-mail, 1/4/08 replace landbef = .1 if landbef==0 gen double llandaf = ln(landaf) gen double llandbef = ln(landbef) gen double lpcnsexp = ln(pcnsexp) gen byte crcensored = progid<4 & proglv==0 gen byte nontar = progid==5 } * average landholdings of mistargeted borrowers (reported in text): sum landbef if wave==1 & pksample & progid<4 & q & !r * Table 1: weighted means and sd's of RHS vars in first wave. sd's are displayed as "Root MSE". foreach var in hdparlndd hdbrolndd hdsislndd spparlndd spbrolndd spsislndd landbef edhead sexhead agehead afedhigh amedhigh afedhighns amedhighns amadultd afadultd /// scohead fbraclv mbraclv fbrdblv mbrdblv fgramlv mgramlv ineligible primcoed hpruralh hpfampln hpmidwif pzrice pzwflour pzmoil pzhegg pzmilk pzpotato wagef nowagef wagem bamtr { cap reg `var' if pksample & wave==1 [aw=weight] if !_rc reg } * Table 2: means and sd's of dep vars. sd's are displayed as "Root MSE". forvalues varn = 1/9 { if `varn'==6 { preserve * odbc load, exec("select * from [Roodman & Morduch ind] where wave in (1,2,3)") dsn(PK) clear use "Roodman & Morduch ind.dta", clear keep if wave<4 * (For Table 1) reg age if wave==1 & pksample [aw=weight] reg ed if wave==1 & pksample & age>=5 [aw=weight] reg edns if wave==1 & pksample & age>=5 [aw=weight] // education of non-students. students=0 needed to match PK } local var : word `varn' of fproglv mproglv pcnsexp fasset fnlasset fwork mwork fedec517 medec517 local varsample : word `varn' of "pksamplef & wave==1" "pksamplem & wave==1" /// 1 "!afadultd & wave==1" "!afadultd & wave==1" /// "sex==0 & age>=16 & age<60" "sex==1 & age>=16 & age<60" /// "wave==1 & sex==0 & age>=5 & age<18" "wave==1 & sex==1 & age>=5 & age<18" * more proper but doesn't match * local varsample : word `varn' of "pksamplef & !afadult & wave==1" "pksamplem & !amadult & wave==1" /// 1 "!afadultd & wave==1" "!afadultd & wave==1" "sex==0 & age>=16 & age<60" /// "sex==1 & age>=16 & age<60" "wave==1 & sex==0" /// "wave==1 & sex==0 & age>=5 & age<18" "wave==1 & sex==1 & age>=5 & age<18" forvalues samplen = 1/5 { local sample : word `samplen' of progid<4 "progid>=4 & progvill" progvill !progvill 1 local samplename : word `samplen' of part non-part prog-vill non-prog-vill all cap reg `var' if pksample & `varsample' & `sample' [aw=weight] if !_rc reg } } restore * PK evidently left some missings as missing in relatives' landholding variables in computing means & sd's recode hdbrolndd hdsislndd hdparlndd spbrolndd spsislndd spparlndd (. = 0) * Table 4: 2SLS consumption local covsy scohead afedhigh amedhigh afadultd amadultd sexhead agehead llandbef edhead hdbrolndd hdsislndd hdparlndd spbrolndd spsislndd spparlndd _Iwave* crcensored local covsm scohead afedhigh amedhigh afadultd sexhead agehead llandbef edhead hdbrolndd hdsislndd hdparlndd spbrolndd spsislndd spparlndd _Iwave* local covsf scohead afedhigh amedhigh amadultd sexhead agehead llandbef edhead hdbrolndd hdsislndd hdparlndd spbrolndd spsislndd spparlndd _Iwave* foreach var of varlist `covsf' _Ivill* { gen double zf`var' = `var' * pksamplef } foreach var of varlist `covsm' _Ivill* { gen double zm`var' = `var' * pksamplem } unab zvars: z* unab zdummies: z*I* local znodummies : list zvars - zdummies unab zvill : z*vill* unab zwave : z*wave* tsset nh wave mata mata set matafavor speed forvalues wave=0/3 { di as res _n "2SLS `=cond(`wave', "round `wave'","all rounds")', village dummy interactions excluded" xtabond2 lpcnsexp lfbraclv lmbraclv lfbrdblv lmbrdblv lfgramlv lmgramlv `covsy' _Ivill* [pw=weight] if pksample & inlist(`wave', 0, wave), iv(`covsy' _Ivill* pksamplef pksamplem, eq(lev)) robust small h(1) /// iv(`znodummies', eq(lev)) iv(`zvill', eq(lev)) iv(z*wave*, eq(lev)) art(0) mat t = e(diffsargan) mat t = t["Difference in Sargan p",2...] di as res _n "2SLS `=cond(`wave', "round `wave'","all rounds")', village dummy interactions included" xtabond2 lpcnsexp lfbraclv lmbraclv lfbrdblv lmbrdblv lfgramlv lmgramlv `covsy' _Ivill* `zdummies' [pw=weight] if pksample & inlist(`wave', 0, wave), iv(`covsy' _Ivill* z* pksamplef pksamplem, eq(lev)) robust small h(1) art(0) local bnames : colnames e(b) if `wave'==0 { local t : list zwave & bnames test `t' local zwaveFp = r(p) } local t : list zvill & bnames test `t' local zvillFp = r(p) } * main regressions * Table 3 estimate lpcnsexp if pksample & !nontar, nonaive samplename(target sample) estcmd(reg) tech(dfp nr) estimate lpcnsexp if pksample, nonaive samplename(full sample) estcmd(reg) tech(dfp nr) * Table 5 scalar Y_0 = ln(10) // female non-land asset censoring level? (2 is lowest observed value, in wave 2, 10 lowest in wave 1.) gen double lfnlasset = ln(fnlasset) gen double lfasset = ln(fasset) recode lfnlasset lfasset (. = `=Y_0') replace lfnlasset = Y_0 if lfnlasset=16 & age<60 & sex==0, estcmd(tobit) lf estimate lmwork age age2 ed if pksample & !amadultd & age>=16 & age<60 & sex==1, estcmd(tobit) lf estimate fedec517 age age2 if pksample & wave==1 & sex==0 & age>=5 & age<18, femaleonly estcmd(probit) tech(dfp nr) estimate medec517 age age2 if pksample & wave==1 & sex==1 & age>=5 & age<18, femaleonly estcmd(probit) tech(dfp nr)