Daniel-Pailanir / sdid

Synthetic Difference in Differences for Stata
GNU General Public License v3.0
74 stars 37 forks source link

Changing regularization parameter seems to have no effect #59

Closed noahspencer123 closed 1 year ago

noahspencer123 commented 1 year ago

Hi Daniel, Thanks for your work on this!

I just downloaded the latest -sdid- .ado file today and wanted to try playing around with the regularization parameter. However, I found that doing so had seemed to have no effect on the unit weights. Is this a bug or is it just that changing the regularization parameter often has no effect?

Please see an example below of the issue below:

* Download -sdid- from main page into local folder and access from there
sysdir set PLUS "/my_folder/sdid-main"

* Install example data
webuse set www.damianclarke.net/stata/
webuse prop99_example.dta, clear

* Run example with no changes to regularization parameter
sdid packspercapita state year treated, vce(placebo) seed(123)
mat li e(omega)

* Run example with very large regularization parameter
sdid packspercapita state year treated, vce(placebo) seed(123) zeta_omega(1000)
mat li e(omega)

* Run example with regularization parameter = 0
sdid dv state year treatment, method(sdid) vce(placebo) graph mattitles zeta_omega(0)
mat li e(omega)

*** Notice that the zeta_omega specifications have no effect on unit weights or estimated treatment effects
Daniel-Pailanir commented 1 year ago

Hi @noahspencer123, thanks for trying this out so quickly. I solved this, basically I needed to add an extra condition, but now it should be fine.

noahspencer123 commented 1 year ago

Thanks @Daniel-Pailanir!