I am trying to do a diff-in-diff analysis on the effect of endorsement on a product. This is what my data set looks like:
dates times price YeezyShoe date_of_purchase Yandhi_Release Ye_Release Kanye_Chicago
April 2, 2019 3:55PM 128 0 21641 0 0 0
At the moment, I have these commands in order to create treatment date ranges:
gen date_of_purchase = date(dates, "MDY")
gen byte Yandhi_Release=inrange(date_of_purchase,td(29sep20 18),td(3october2018))
gen byte Ye_Release=inrange(date_of_purchase,td(01june2018) ,td(05june2018))
gen byte Kanye_Chicago=inrange(date_of_purchase,td(15august 2018), td(19august2018))
If the shoe is endorsed, YeezyShoe=1, and if the shoe is the control shoe, it is YeezyShoe=0.
This is what my current diff-in-diff regression looks like; however, I am having a hard time isolating this effect and formulating a regression.
gen treatXafter = Yandhi_Release * YeezyShoe
reg __ YeezyShoe Yandhi_Release treatXafter
Related Posts with Diff-in-Diff
How to read the result by running did_multiplegt code in STATA?One way of treating the heterogeneous impact of staggered laws is to use did_multiplegt method devel…
Is there any package for stacked Difference-in-Differences?I am wondering if there is any package for stacked difference-in-difference in STATA which is useful…
destring before appendHi all, So I am trying to append 3 excel sheets into one Stata file but I would need to destring on…
Calculate average within-unit correlation of variable across timeI have a panel dataset at the firm-year level. I would first like to calculate, within each firm, th…
Storing a command as a macroHello Statalist, I am writing a long .do file that uses the same command at many different points: …
Subscribe to:
Post Comments (Atom)
0 Response to Diff-in-Diff
Post a Comment