friosavila / stpackages

Repository for all my Stata packages
MIT License
11 stars 9 forks source link

plot not working #9

Closed kikiwong333 closed 2 weeks ago

kikiwong333 commented 2 months ago

1713663650353

kikiwong333 commented 2 months ago

hello The results are inconsistent when I use commond csdid and csdid2. What is the specific reason for this? Which result should I trust? Thank you so much! And run the following code: csdid2 lnwwe $firmlist $industriallist $citylist $policy ,i(groupid) t(year) g(gvar) method(drimp) cluster( double_cluster) notyet csdid2 event, estat window(-4,5) estore(cs) Next I run code : event_plot cs, /// stub_lag( Tp#) stub_lead( Tm#) plottype(scatter) ciplottype(rcap) /// together perturb(-0.325(0.13)0.455) noautolegend /// graph_opt(title(" industrial wastewater estimator", size(medlarge)) /// xtitle("Periods since the event") ytitle("Average causal effect") xlabel(-4(1)5) ylabel(-0.2(1)0.2) /// legend(order(1 "TWFE" 2 "" 3 "Sun and Abraham (2021)" 4 "" 5 "Callaway and Sant’Anna 2021" 6 "" ) rows(3) region(style(none))) /// xline(0, lcolor(gs8) lpattern(dash)) yline(0, lcolor(gs8)) graphregion(color(white)) bgcolor(white) ylabel(, angle(horizontal)) /// ) lag_opt1(msymbol(+) color(cranberry)) lag_ci_opt1(color(cranberry))

The error: No estimates found for the model "cs1". Make sure you have specified stub_lag and stub_lead correctly.
1713670113415

What should I do? Thank you so much! Qi

friosavila commented 2 months ago

I need more information First. Please make sure you have latest iteration of the packages Second how many controls do you have. Do you check for collinearity with the gvar? Can you tabulate year gvar? Thank you

On Sat, Apr 20, 2024 at 11:29 PM kikiwong333 @.***> wrote:

hello The results are inconsistent when I use commond csdid and csdid2. What is the specific reason for this? Which result should I trust? Thank you so much! And run the following code: csdid2 lnwwe $firmlist $industriallist $citylist $policy ,i(groupid) t(year) g(gvar) method(drimp) cluster( double_cluster) notyet csdid2 event, estat window(-4,5) estore(cs) Next I run code : event_plot cs, /// stub_lag( Tp#) stub_lead( Tm#) plottype(scatter) ciplottype(rcap) /// together perturb(-0.325(0.13)0.455) noautolegend /// graph_opt(title(" industrial wastewater estimator", size(medlarge)) /// xtitle("Periods since the event") ytitle("Average causal effect") xlabel(-4(1)5) ylabel(-0.2(1)0.2) /// legend(order(1 "TWFE" 2 "" 3 "Sun and Abraham (2021)" 4 "" 5 "Callaway and Sant’Anna 2021" 6 "" ) rows(3) region(style(none))) /// xline(0, lcolor(gs8) lpattern(dash)) yline(0, lcolor(gs8)) graphregion(color(white)) bgcolor(white) ylabel(, angle(horizontal)) /// ) lag_opt1(msymbol(+) color(cranberry)) lag_ci_opt1(color(cranberry))

The error: No estimates found for the model "cs1". Make sure you have specified stub_lag and stub_lead correctly. 1713670113415.png (view on web) https://github.com/friosavila/stpackages/assets/109087563/8fb7ef11-f182-488b-b3c1-95c2c21d7fcb

What should I do? Thank you so much! Qi

— Reply to this email directly, view it on GitHub https://github.com/friosavila/stpackages/issues/9#issuecomment-2067876555, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASZKKFWKJM57L25CXSJZCVTY6MXAJAVCNFSM6AAAAABGQ6GSYSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRXHA3TMNJVGU . You are receiving this because you are subscribed to this thread.Message ID: @.***>

kikiwong333 commented 2 months ago

Thank you I solved it. but I have another question: Why are the results of csdid and csdid2 different? What is the reason? The first picture from csdid 1713738822669 The second picture from csdid2 1713738901194(1) And I found that picture 2(csdid2) does not have "tm1" but tm8. The picture 2 has "tm1" but no "tm8"

Thank you so much Qi

friosavila commented 2 months ago

Csdid2 uses long differences for pre Atts Csdid uses short differences for pre-atts

On Sun, Apr 21, 2024 at 6:40 PM kikiwong333 @.***> wrote:

Thank you I solved it. but I have another question: Why are the results of csdid and csdid2 different? What is the reason? The first picture from csdid 1713738822669.png (view on web) https://github.com/friosavila/stpackages/assets/109087563/dbd2c5b5-c47a-408c-a4b4-912275324a4c The second picture from csdid2 1713738901194.1.png (view on web) https://github.com/friosavila/stpackages/assets/109087563/eb089299-218f-48a1-abb8-89dfb5bdd711 And I found that picture 2(csdid2) does not have "tm1" but tm8. The picture 2 has "tm1" but no "tm8"

Thank you so much Qi

— Reply to this email directly, view it on GitHub https://github.com/friosavila/stpackages/issues/9#issuecomment-2068231560, or unsubscribe https://github.com/notifications/unsubscribe-auth/ASZKKFUFLE7Z4GCN6JA3IULY6Q54ZAVCNFSM6AAAAABGQ6GSYSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANRYGIZTCNJWGA . You are receiving this because you commented.Message ID: @.***>