After many frustrated days without any result to calculate the cumulative abnormal return, I need some help to know how to code the car. As you can see below, I added a picture of the situation. I want to capture the CAR t+4 : t+60. Or in other words, the starting point to calculate the car (AR) is 4 trading days (data) after the earnings announcement (anndats_act) till 60 trading days after the earnings announcement. I already merged the databases that I needed, and created a sample document based on one company with multiple earnings announcement. In this case 2015, and 2016. Otherwise, if I am testing the code, the run will take forever, if it is based on million observations
cusip8 = company code
anndats_act = earnings announcement
data = trading days
AR = Abnormal returns
For example, 24feb2015 is the earnings annoucement (anndats_act) for a certain company (cusip8). I want to capture the cumulative abnormal return (AR) from 27feb2015 (4 trading days after the earnings announcemen) till 60 trading days after earnings announcement. I want to capture the car for multiple companies that contain multiple annual earnings announcements. So, I want to create a new variable like gen car t+4 : t+60 = sum(AR) , by (cusip8 & anndats_act t+4 t+60).
I look forward to hear your suggestions how I can write the code to capture the car t+4 : t+60 for each company and unique earnings announcement.
Array
Related Posts with Programming question about the sum of each ID and specific period
GMM for time seriesHello Statalist, 1.I am using time series data. my main equation is pbt = a0+a1pbt-1+a2pdt-1+ogt+e b…
Stationarity, Markov switchingHi everyone, I was trying to model times series with markov switching regimes. Preliminarily, do I n…
Cartesian product of ColumnsDear Statalisters, I have 2 sets Set_1= {HH, HT, TT, TH} and Set_2 = {1, 2, 3, 4}. These are the in…
Out of sample estimation following xtdpdgmmStata throws a 301 error (last estimates not found) whenever I try to use estimates from a dynamic m…
Identifying missing Data & Interpolation of Panel DataHello, I've created a dataset of 30 countries over 30 years for 29 different variables. For some of…
Subscribe to:
Post Comments (Atom)
0 Response to Programming question about the sum of each ID and specific period
Post a Comment