Hello Statalist, I hope everyone is fine.
In my event study, I have event variable (EV) contain 1100 events for a panel dataset
I set event_window 10 days before and after the announcement day (EV date)
EV is a continuous variable and it's values are positive and negative
Specifically, 700 EV = positive values and 400 = negative values
my dependent variable is Y and independent variable is X,
The Y and X values only exist on the event_window dates (which is 10 days before and after EV)
my query is: I want to split my dependent variable (Y) into Yp and Yn
Yp = if EV is positive, then consider Y and X values all firm-year observation of a panel dataset for that event_window (10 days before and after dates of EV)
Yn = similar treatment as Yp but for negative values of EV
Thanks
Related Posts with Group-wise value assignment
Splitting episodes & mergingHey Stata Community, I need to split every job episode according to calendar years (rrdat dataset; …
How to create a progress bar for loopsHi there, I have been looking online for ways to create a progress bar that shows the completion of…
how to keep variable x1,y1,z1 when rank =1 and keep x2,y2,z2 when rank=2 for different idsThose with same id numbers are categorized into ranks and I want to keep percentage1 com11 pet1 when…
How to calculate a margins plot for a DiD model when faced with colinearity issues? Code: * Example generated by -dataex-. For more info, type help dataex clear input long group int …
Delete an observation if the value of a string variable is contained in another variable.I want to delete any obervation where the value of input1 is same as that of input_toremove. I saw …
Subscribe to:
Post Comments (Atom)
0 Response to Group-wise value assignment
Post a Comment