******************************************* * GLOBAL POVERTY & IMPACT EVALUATION * * FALL 2009 * * Problem Set 1 * * By Erick Gong * * Data from Thornton (AER 2008) * ******************************************* ******************************************* * Preliminaries * * Clear and set memory * * Start a log file * * Download Data * * Keep Relevant Observations for analysis * ******************************************* /* Set Memory */ clear all set mem 100m set more off version 10 cap log close /* Change Directory to Working Directory */ cd "C:\Documents and Settings\ERICK\My Documents\Fall_2009\ps1" log using problem_set1, text replace /* starts a log file that keeps track of everything */ /* Get Data */ use "C:\Documents and Settings\ERICK\My Documents\Fall_2009\ps1\Thornton HIV Testing Data.dta", clear /* Relevant Observations */ gen MainSample = 1 if test2004==1 & age!=. & villnum!=. & tinc!=. & distvct!=. & hiv2004!=-1 & followup_test!=1 label var MainSample "Sample in Study" keep if MainSample==1 ******************************* * PART I: Summary Statistics * ******************************* /* Quesiton 1 */ /* Summary Statistics */ *Describe the variables des age male mar educ2004 hadsex12 eversex usecondom04 tb land2004 hiv2004 *Summary Statistics for variables sum age male mar educ2004 hadsex12 eversex usecondom04 tb land2004 hiv2004 /* Q1 Answer: Mean age = 33.4, Male = 46%, HIV Rate = 6.2% */ /* Advice: When looking at summary statistics, look at the min and max columns. if the min=0 and the max=1 then it is a binary variable. And the mean is the percentage of people who have the outcome */ /* Question 2 */ *Compare Treatment and Control Groups sum age male mar educ2004 hadsex12 eversex usecondom04 tb land2004 hiv2004 if any==0 sum age male mar educ2004 hadsex12 eversex usecondom04 tb land2004 hiv2004 if any==1 /* Q2 Answer: The treatment group is slightly older, the control group has higher education, and HIV rates look similar */ /* Question 3 */ * T-test on difference in means ttest age, by(any) ttest hiv2004, by(any) ttest mar, by(any) /*Q3 Answer: Only Age appers to be statistically different. */ ******************************* * PART II: Graphical Analysis * ******************************* /* Question 4 */ /* Hint: Use the pull down menu: Graphics>Bar Chart> Under "Statistics to plot" choose the variable for the y-axis Tab to "Categories" and under Group 1 select "Grouping variable" for your x-axis */ graph bar (mean) got, over(any) /* Question 5 */ graph bar (mean) got, over(Ti) ******************************* * PART III: Linear Regression * ******************************* /* Question 6 */ *Effect of Any Cash Incentive reg got any, robust reg got any age male mar educ2004 hadsex12 eversex usecondom04 tb land2004, robust /*Q6 Answer: Estimate of beta is .45. Is is statistically significant at the 1% level. When additional controls are added, estimate is similar and does not change very much */ /* Question 7 */ reg got Ti, robust reg got Ti age male mar educ2004 hadsex12 eversex usecondom04 tb land2004, robust /*Q7 Answer: Beta estimate is .002, and is statistically signficant at the 1% level. When additional controls are added, estimate is similar. */ /* Q8 Answer: Offering any cash incentive has a large effect on people learning HIV status since the average increase is 45%. It appears though that the actual amount does not have a big effect, going from $1 to $2 doesn't have a big effect. See Thornton (2008) paper for possible explanations of this puzzle */ ********************************** * PART IV: Heterogenous Effects * ********************************** /* Question 9 */ *Interaction Term gen anymale = any*male reg got any male anymale, robust /* Q9 Answer: Estimate of delta is .008. It is not staistically significant. The effect of cash incentives doesn't appear to have a different effect for men */ /* Question 10 */ *Interaction Term gen anyeduc2004 = any*educ2004 reg got any educ2004 anyeduc2004, robust /* Q10 Answer: Estimate of delta is .001. It is not staistically significant. The effect of cash incentives doesn't appear to vary with educaion */ ****************** * PART V: Policy * ****************** /* Question 11 */ /* Q11: Small cash incentives might have big effect on encouraging people to learn their HIV status after being tested */ /* Question 12 */ /* Q12: It doesn't appear any specific group benefits more from the program */