capture clear capture log close set more off cd c:\DATA\LotteryNeighbors\Anonymized log using 1_DStats, replace set memory 20m use FinalAnon.dta *Simple Descriptive Statistics for Nov 2009 version of paper. ************************** *To restrict to postcodes with at least Q addresses: *keep if NperPstk>=16 & NperPstk~=. ***************************** *TABLE 0: Participation Probits capture erase Table0.txt capture erase Table0.doc gen incin10ks=inc_then/10000 *A: Baseline tab win_code, sum(buyer) *No Covariates: reg buyer win_code outreg2 using Table0.doc areg buyer win_code, absorb(codegroup) outreg2 using Table0.doc *Common Covariates: reg buyer win_code persons_then partner_now educ3_fam educ7_fam age_fam kids incin10ks outreg2 using Table0.doc areg buyer win_code persons_then partner_now educ3_fam educ7_fam age_fam kids incin10ks, absorb(codegroup) outreg2 using Table0.doc *Separate Covariates: foreach var in buyer win_code persons_then partner_now educ3_fam educ7_fam age_fam kids incin10ks { gen `var'L = `var'*(1-win_code) gen `var'W = `var'*win_code } reg buyer persons_thenL partner_nowL educ3_famL educ7_famL age_famL kidsL incin10ksL /// persons_thenW partner_nowW educ3_famW educ7_famW age_famW kidsW incin10ksW win_code outreg2 using Table0.doc test (persons_thenL=persons_thenW) (partner_nowL=partner_nowW) (educ3_famL=educ3_famW) /// (educ7_famL=educ7_famW) (age_famL=age_famW) (kidsL=kidsW) (incin10ksL=incin10ksW) (win_code=0) areg buyer persons_thenL partner_nowL educ3_famL educ7_famL age_famL kidsL incin10ksL /// persons_thenW partner_nowW educ3_famW educ7_famW age_famW kidsW incin10ksW win_code, absorb(codegroup) outreg2 using Table0.doc test (persons_thenL=persons_thenW) (partner_nowL=partner_nowW) (educ3_famL=educ3_famW) /// (educ7_famL=educ7_famW) (age_famL=age_famW) (kidsL=kidsW) (incin10ksL=incin10ksW) (win_code=0) ************TABLES 1 thru 3 are all by "group": *************** gen group=1 if win_code==0 & buyer==1 replace group=2 if win_code==0 & buyer==0 replace group=3 if win_code==1 & buyer==1 replace group=4 if win_code==1 & buyer==0 ************************************************************************* *TABLE 1: MEANS OF PERMANENT OR PRE-LOTTERY CHARACTERISTICS: tabstat persons_then partner_now educ3_fam educ7_fam age_fam kids, by(group) nototal *single-headed hh: tabstat work_then hours_then group if partner_now==0, by(group) nototal *two-headed hh: tabstat work_h_then hours_h_then work_w_then hours_w_then if partner_now==1, by(group) nototal *Monthly expenditures: tabstat foodhome_then foodaway_then transpo_then other_then total_then, by(group) nototal *Occasional expenditures & misc: tabstat ext_reno_before int_reno_before vacation_spending_before durable_spending_before /// inc_then happy_then, by(group) nototal *Table 1, all together: *first set labor force measures equal to missing when they are not appropriate: replace work_then=. if partner_now==1 replace hours_then=. if partner_now==1 replace work_h_then=. if partner_now==0 replace hours_h_then=. if partner_now==0 replace work_w_then=. if partner_now==0 replace hours_w_then=. if partner_now==0 tabstat persons_then partner_now educ3_fam educ7_fam age_fam kids /// work_then hours_then work_h_then hours_h_then work_w_then hours_w_then /// foodhome_then foodaway_then transpo_then other_then total_then /// ext_reno_before int_reno_before vacation_spending_before durable_spending_before /// inc_then happy_then, by(group) nototal save matrix t1 = r(Stat1) \ r(Stat2) \ r(Stat3) \ r(Stat4) matrix list t1 *for sample size: tab group *SIGNIF TESTS: gen str8 grp = "buyer" if buyer==1 replace grp = "nonbuyer" if buyer==0 sort grp by grp: reg persons_then win_code by grp: reg partner_now win_code by grp: reg educ3_fam win_code by grp: reg educ7_fam win_code by grp: reg age_fam win_code by grp: reg kids win_code by grp: reg work_then win_code if partner_now==0 by grp: reg hours_then win_code if partner_now==0 by grp: reg work_h_then win_code if partner_now==1 by grp: reg hours_h_then win_code if partner_now==1 by grp: reg work_w_then win_code if partner_now==1 by grp: reg hours_w_then win_code if partner_now==1 by grp: reg foodhome_then win_code by grp: reg foodaway_then win_code by grp: reg transpo_then win_code by grp: reg other_then win_code by grp: reg total_then win_code by grp: reg ext_reno_before win_code by grp: reg int_reno_before win_code by grp: reg vacation_spending_before win_code by grp: reg durable_spending_before win_code by grp: reg inc_then win_code by grp: reg happy_then win_code *excluding the work variables (which are for mutually exclusive subsamples), *regress win_code on everything in Table 1 and look at the F-stat: by grp: reg win_code persons_then partner_now educ3_fam educ7_fam age_fam kids /// foodhome_then foodaway_then transpo_then other_then total_then /// ext_reno_before int_reno_before vacation_spending_before durable_spending_before /// inc_then happy_then *add the work variables to this using interactions: gen work_thenXnopartner = 0 replace work_thenXnopartner = work_then if partner_now==0 gen hours_thenXnopartner = 0 replace hours_thenXnopartner = hours_then if partner_now==0 gen work_h_thenXpartner = 0 replace work_h_thenXpartner = work_h_then if partner_now==1 gen hours_h_thenXpartner = 0 replace hours_h_thenXpartner = hours_h_then if partner_now==1 gen work_w_thenXpartner = 0 replace work_w_thenXpartner = work_w_then if partner_now==1 gen hours_w_thenXpartner= 0 replace hours_w_thenXpartner= hours_w_then if partner_now==1 by grp: reg win_code persons_then partner_now educ3_fam educ7_fam age_fam kids /// work_thenXnopartner hours_thenXnopartner /// work_h_thenXpartner hours_h_thenXpartner work_w_thenXpartner hours_w_thenXpartner /// foodhome_then foodaway_then transpo_then other_then total_then /// ext_reno_before int_reno_before vacation_spending_before durable_spending_before /// inc_then happy_then ***COMPARISIONS with Statistics Netherlands NATIONAL MEANS****: *(reported on the paper's website) sum persons_then cohabit *compute mean age of all persons in our data: gen sumages=0 gen sumpersons=0 local i=1 while `i' <=8 { replace v02b`i'c = . if v02b`i'c==9999 gen byte ageofperson`i' = jaaruit - v02b`i'c replace sumages=sumages + ageofperson`i' if ageofperson`i' ~=. replace sumpersons=sumpersons + 1 if ageofperson`i' ~=. local i=`i'+1 } *list ageofperson1 ageofperson2 ageofperson3 ageofperson4 sumpersons sumages in 1/50 tab sumpersons replace sumpersons=. if sumpersons==0 replace sumages=. if sumages==0 sum sumpersons persons_now persons_then gen meanage = sumages/sumpersons sum meanage [fw=sumpersons] drop ageofperson1-ageofperson8 sumages sumpersons * (the following refer to couples with both partners age 15-64) * most are probably not defined so comparably between the national data and ours... gen byte age1564=0 replace age1564 =1 if age_h >=15 & age_h<=64 & age_w >=15 & age_w<=64 sum work_h_then hours_h_then work_w_then hours_w_then if partner_now==1 & age1564==1 sum foodhome_then foodaway_then transpo_then other_then total_then if partner_now==1 & age1564==1 sum vacation_spending_before inc_then if partner_now==1 & age1564==1 drop age1564 *****TABLE 3: LOTTERY CHARACTERISTICS:******** *Lottery Awareness: tab group, sum(rememberStreetPrize) tab group, sum(know_winnersA) tab group, sum(know_winnersB) *Lottery Participation and Winnings: tab group, sum(numtix) tab group, sum(winnings) /* note: winnings is is cash only */ tab group, sum(wonbmw) *Immediate Neighbors' Winnings: *"neighbor_won": whether either of your two immediate neighbors won *"num_neighbors_won": the count of your *immediate* neighbors (0, 1, or 2) who held a winning ticket *"neighbors_winnings": the total amount won (in euro) by your two immediate neighbors * (bmw counts as 25000 euro) replace neighbors_winnings=10000*neighbors_winnings tab group, sum(neighbor_won) tab group, sum(num_neighbors_won) tab group, sum(neighbors_winnings) *Number of winning addresses within _ meters of your home, and in your postcode: tab group, sum(N_le_0) tab group, sum(N_le_25) tab group, sum(N_le_100) tab group, sum(num_winning_hh) *Total winnings within _ meters of your home, and in your postcode: * (these winnings include bmws, valued at 25000 euros) replace W_le_0 = 10000*W_le_0 replace W_le_25 = 10000*W_le_25 replace W_le_100 = 10000*W_le_100 replace amt_won=10000*amt_won tab group, sum(W_le_0) tab group, sum(W_le_25) tab group, sum(W_le_100) tab group, sum(amt_won) *Table 2, all together: tabstat rememberStreetPrize know_winnersA know_winnersB numtix winnings wonbmw /// neighbor_won num_neighbors_won neighbors_winnings /// N_le_0 N_le_25 N_le_100 num_winning_hh /// W_le_0 W_le_25 W_le_100 amt_won, by(group) nototal save matrix t2 = r(Stat1) \ r(Stat2) \ r(Stat3) \ r(Stat4) matrix list t2 *Significance Tests: by grp: reg rememberStreetPrize win_code by grp: reg know_winnersA win_code by grp: reg know_winnersB win_code by grp: reg numtix win_code by grp: reg winnings win_code by grp: reg wonbmw win_code by grp: reg neighbor_won win_code by grp: reg num_neighbors_won win_code by grp: reg neighbors_winnings win_code by grp: reg N_le_0 win_code by grp: reg N_le_25 win_code by grp: reg N_le_100 win_code by grp: reg num_winning_hh win_code by grp: reg W_le_0 win_code by grp: reg W_le_25 win_code by grp: reg W_le_100 win_code by grp: reg amt_won win_code *************************************************************** *TABLE 3: POST-LOTTERY OUTCOMES: *Monthly expenditures: tab group, sum(foodhome) tab group, sum(foodaway) tab group, sum(transpo) tab group, sum(other) tab group, sum(total) *Occasional expenditures: tab group, sum(ext_reno) tab group, sum(int_reno) tab group, sum(vacation_spending) tab group, sum(durable_spending) tab group, sum(inc_now) *Other outcomes: tab group, sum(happy_now) tab group, sum(PCLnow) tab group, sum(charity) *Table 3, all together: *Set the car variables equal to missing for bmw winners, * but save data with the bmw winners for future use: save temp, replace replace newcar=. if wonbmw==1 replace bmwnow=. if wonbmw==1 replace numcars=. if wonbmw==1 replace ageofmaincar=. if wonbmw==1 replace totalcarunits=. if wonbmw==1 tabstat foodhome foodaway transpo other total ext_reno int_reno vacation_spending durable_spending /// inc_now happy_now PCLnow charity newcar numcars ageofmaincar totalcarunits , /// by(group) nototal save matrix t3 = r(Stat1) \ r(Stat2) \ r(Stat3) \ r(Stat4) matrix list t3 use temp, clear *a few extra numbers re bmw ownership: tab group, sum(bmwnow) *for cash winners only: tab group if group==3 & wonbmw==0, sum(bmwnow) *for bmw winners only: tab group if wonbmw==1, sum(bmwnow) *count bmws for footnote: tab numcars bmwnow if wonbmw==1 *distn of car ages for letter to editor: summarize ageofmaincar if win_code==0, detail *Significance Tests: sort grp by grp: reg foodhome win_code by grp: reg foodaway win_code by grp: reg transpo win_code by grp: reg other win_code by grp: reg total win_code by grp: reg ext_reno win_code by grp: reg int_reno win_code by grp: reg vacation_spending win_code by grp: reg durable_spending win_code by grp: reg inc_now win_code by grp: reg happy_now win_code by grp: reg PCLnow win_code by grp: reg charity win_code by grp: reg newcar win_code if wonbmw==0 by grp: reg bmwnow win_code if wonbmw==0 by grp: reg numcars win_code if wonbmw==0 by grp: reg ageofmaincar win_code if wonbmw==0 by grp: reg totalcarunits win_code if wonbmw==0 by grp: reg bmwnow win_code clear svmat t1, names(col) outsheet using Table1.csv, comma replace clear svmat t2, names(col) outsheet using Table2.csv, comma replace clear svmat t3, names(col) outsheet using Table3.csv, comma replace erase temp.dta