Dear all,
I'm having trouble computing the CAAR in Stata and I hope you can help me!
The problem: I need to compute the CAAR automatically, which is the cumulative of AAR, but I can't seem to get it right.
I tried:
egen caar = sum(aar)
but then I get only one value for CAAR, since every AAR is summed. How do I get Stata to compute CAAR automatically (as shown in the table below, which I calculated by hand)?
I'm having trouble computing the CAAR in Stata and I hope you can help me!
The problem: I need to compute the CAAR automatically, which is the cumulative of AAR, but I can't seem to get it right.
I tried:
egen caar = sum(aar)
but then I get only one value for CAAR, since every AAR is summed. How do I get Stata to compute CAAR automatically (as shown in the table below, which I calculated by hand)?
Company | Time | AAR | CAAR |
A | 1 | 0,1 | 0,1 |
B | 1 | 0,1 | 0,1 |
C | 1 | 0,1 | 0,1 |
A | 2 | -0,2 | -0,1 |
B | 2 | -0,2 | -0,1 |
C | 2 | -0,2 | -0,1 |
A | 3 | 0,5 | 0,4 |
B | 3 | 0,5 | 0,4 |
C | 3 | 0,5 | 0,4 |
Comment