Hello,
I am using Stata 16.1 and I have the following data:
gvkey fyear pifo
007435 2015 2424
007435 2016 2687
007435 2017 3399
007435 2018 3513
007435 2019 2704
007435 2020 2991
001078 2017 1923
001078 2018 3303
001078 2019 3188
001078 2020 3380
016101 2015 .
016101 2016 .
An event occurred in 2017.
I want to make a dummy variable which gives 1 for firms that have a value for PIFO (so not zero or .) and at least one value before the event (can be in 2015 or 2016) and at least one value after the event (can be 2018, 2019 or 2020).
The dummy should give 0 for firms with zero or . for PIFO and for firms without at least one value before and one value after the event date.
Any suggestion is appreciated.
Kind regards,
Sacha
Related Posts with Pre and post event
How do you create a new variable with dummy variablesI have a variable labeled nrrea which are the reasons why someone is working in field outside of the…
aggregating values from several variables with IF AND conditionsHello Statalisters, I have a dataset containing geographic segment sales that I have standardized i…
My R value is a period?Hello, I am deeply sorry if this has been answered somewhere and I just not have found the right ke…
Use Margins for Interaction terms when model does not support factor notationHi Statalist My question is about how we can get Margins commands to work correctly when the estima…
reghdfe and constant term reportingHi there, I use the code below, but no constant term shown in the results. Can someone help me with…
Subscribe to:
Post Comments (Atom)
0 Response to Pre and post event
Post a Comment