mcaceresb / stata-honestdid

Robust inference in difference-in-differences and event study designs (Stata version of the R package of the same name)
70 stars 18 forks source link

repeated cross-section data #3

Closed wenddymacro closed 1 year ago

wenddymacro commented 1 year ago

Is it possible to using honestdid for repeated cross-section data

jonathandroth commented 1 year ago

Yes, anything that produces a vector of event study coefficients and their variance covariance matrix.

On Fri, Oct 28, 2022, 11:46 AM wenddymacro @.***> wrote:

Is it possible to using honestdid for repeated cross-section data

— Reply to this email directly, view it on GitHub https://github.com/mcaceresb/stata-honestdid/issues/3, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE6EXFCQ7FUHB4VU7NZKHB3WFPYLXANCNFSM6AAAAAARRGGPXI . You are receiving this because you are subscribed to this thread.Message ID: @.***>

wenddymacro commented 1 year ago

i had used it for repeated cross-section data, got below error:

image

any insights?

mcaceresb commented 1 year ago

@wenddymacro What is the output of

matrix list e(b)
matrix list e(V)
disp `:word count `:colnames e(b)''
disp `:word count `:colnames e(V)''
wenddymacro commented 1 year ago

matrix list e(b)

e(b)[1,8] _k5 _k4 _k3 _k2 k0 k1 k2 y1 .26743749 .08806009 -.58329182 .0045452 1.0686618 1.1931622 1.1564674

        k3

y1 1.1994206

. matrix list e(V)

symmetric e(V)[8,8] _k5 _k4 _k3 _k2 k0 k1 k2 k3 _k5 .59334517 _k4 .18855611 .19903881 _k3 .10169821 .07404817 .08075469 _k2 .06848537 .06192315 .04674466 .0662581 k0 .03542277 .02251705 .01481338 .01802299 .07016613 k1 .06536473 .03366286 .01064268 .01615381 .04887455 .11604949 k2 .04417405 .01803319 .01711892 .0206195 .04215964 .07944742 .13655618 k3 .0363097 .03119694 .00091337 .01303451 .05051125 .08290507 .08608167 .22085507

. disp :word count:colnames e(b)'' 8

. disp :word count:colnames e(V)'' 8

. end of do-file

mcaceresb commented 1 year ago

@wenddymacro honestdid, pre(1/4) post(6/9) tells honestdid to ignore the fifth entry, end to use 1-4 as the pre-period and 6-9 as the post-period. However, your matrices are of length 8; judging by the names, you are already excluding period -1 from your regression, so you don't need to tell honestdid to also ignore it . Try

honestdid, pre(1/4) post(5/8) mvec(0(0.05)0.25)
mcaceresb commented 1 year ago

@wenddymacro From #4 it sounds like you got this example working; if not the case let us know.

wenddymacro commented 1 year ago

yes, it works. thanks for your help