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
Stata doesn't read local macroHi, I am trying to use macros to avoid repeating long lists of variables. The problem is that Stata …
Using hyphens in varlists for duplicatesI'm using Stata 14.2 and was trying to use the duplicates command, when I experienced some strange b…
Duplicating time observations in panel data in stataHello Stata community, I am looking to duplicate the time observations in a panel data 17 times, wh…
Exporting Variables to ExcelHi! I have created a few variables that I'd like to export to an excel file. I have variables rf1 th…
Dummy variable wit large number of unique valuesI have a panel dataset containing data on quality standard in international trade. I am trying to bu…
Subscribe to:
Post Comments (Atom)
0 Response to Diff-in-Diff
Post a Comment