replication.dta
Greetings!
I have 2 questions:
1. I intend to replicate the table below:

Codes I ran:
gen Mentee = 1 if treat == 4
replace Mentee = 0 if treat == 2 | treat == 3
gen Class = 1 if treat == 3
replace Class = 0 if treat == 2 | treat == 4
global Controls I_emp_b lage_b sec0_b sec1_b sec2_b sec3_b sec4_b secondaryedu_b
reg tprofits Mentee Class tprofits_b $Controls, cluster(id) robust
test Mentee=Class
return list
estadd scalar pval=r(p)
estadd local Controls "Yes"
est sto tab2_col1
reg tprofits Mentee Class tprofits_b $Controls if months_since_treat == 1, cluster(id) robust
test Mentee=Class
return list
estadd scalar pval=r(p)
estadd local Controls "Yes"
est sto tab2_col2
.
.
.
esttab tab2_col* using table2.rtf, replace label b(3) se(3) stats(pval N r2 Controls, fmt(3 0 3 0) labels("p-value, H0: M = C" "Observations" "R2" "Controls")) keep (Mentee Class _cons) nomtitle onecell
(and got the table below)

Although the beta co-efficients and standard errors are almost similar, the intercepts and column 1 estimates are not. Can anyone please tell me why?
2. To replicate the figure below:

I used the following commands:
preserve
collapse (mean) tprofits, by (months_since_treat Mentor Class)
twoway (connected tprofits months_since_treat if Mentor==1) (connected tprofits months_since_treat if Class==1) (connected tprofits months_since_treat if Mentor==0 & Class==0),xlabel(-2 0 2 4 6 8 10 12 14 16 18)
restore
(and got the following figure)

However, we see that the connected green and red lines are missing for periods -2 to 1. Is it because I did not include the thick grey bar that highlights when the intervention took place?
Thanks in advance for your time!
Greetings!
I have 2 questions:
1. I intend to replicate the table below:
Codes I ran:
gen Mentee = 1 if treat == 4
replace Mentee = 0 if treat == 2 | treat == 3
gen Class = 1 if treat == 3
replace Class = 0 if treat == 2 | treat == 4
global Controls I_emp_b lage_b sec0_b sec1_b sec2_b sec3_b sec4_b secondaryedu_b
reg tprofits Mentee Class tprofits_b $Controls, cluster(id) robust
test Mentee=Class
return list
estadd scalar pval=r(p)
estadd local Controls "Yes"
est sto tab2_col1
reg tprofits Mentee Class tprofits_b $Controls if months_since_treat == 1, cluster(id) robust
test Mentee=Class
return list
estadd scalar pval=r(p)
estadd local Controls "Yes"
est sto tab2_col2
.
.
.
esttab tab2_col* using table2.rtf, replace label b(3) se(3) stats(pval N r2 Controls, fmt(3 0 3 0) labels("p-value, H0: M = C" "Observations" "R2" "Controls")) keep (Mentee Class _cons) nomtitle onecell
(and got the table below)
Although the beta co-efficients and standard errors are almost similar, the intercepts and column 1 estimates are not. Can anyone please tell me why?
2. To replicate the figure below:
I used the following commands:
preserve
collapse (mean) tprofits, by (months_since_treat Mentor Class)
twoway (connected tprofits months_since_treat if Mentor==1) (connected tprofits months_since_treat if Class==1) (connected tprofits months_since_treat if Mentor==0 & Class==0),xlabel(-2 0 2 4 6 8 10 12 14 16 18)
restore
(and got the following figure)
However, we see that the connected green and red lines are missing for periods -2 to 1. Is it because I did not include the thick grey bar that highlights when the intervention took place?
Thanks in advance for your time!
Comment