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
Query of Day ElapsedDear all, I meet an issue when generting days elapsed from IBES data. Based on the literature, the d…
Which regression model to use for zero-inflated distribution?Hello, I have a question regarding which type of regression model is right to use for a zero-inflat…
conformability error in variance() and quadvariance() Is there a limit on the number of columns of the matrix we can pass to either variance() or quadva…
cmclogit & cmxtmixlogit: which model to use?Dear Statalists, I'm building a multinomial logit model to analyze ride-hailing behaviors. Each res…
Time dummies in IV regression and interpretation of post-estimationDear All, I am running on Stata 14.0 an ivregress 2sls estimation as in the following code. Code: …
Subscribe to:
Post Comments (Atom)
0 Response to Pre and post event
Post a Comment