Hi,
I am conducting an event study and it is my first time that I post on Statalist.
Panel data:
-1713 firms having different event date and daily stock returns (2015-2021)
-4 Market indexes returns (2015-2021)
Estimation window [-120 -21]
Event window [-20 20]
I am getting no observation error when running the below command in order to calcolate the beta and therefore the expected return for each stock I have.
I already confirm that my ret and IndexReturn are numeric variables.
Any tips, advice or critics may help to avoid this error.
I am conducting an event study and it is my first time that I post on Statalist.
Panel data:
-1713 firms having different event date and daily stock returns (2015-2021)
-4 Market indexes returns (2015-2021)
Estimation window [-120 -21]
Event window [-20 20]
I am getting no observation error when running the below command in order to calcolate the beta and therefore the expected return for each stock I have.
I already confirm that my ret and IndexReturn are numeric variables.
Code:
cap drop est_ret gen est_ret=. levelsof sedol, local(sedols) foreach ii of local sedols { cap drop temp reg ret IndexReturn if Days>=-120 & Days< -20 & sedol=="`ii'" predict temp if sedol=="`ii'" & Days >= -20 & Days <=20 replace est_ret=temp if sedol=="`ii'" & Days >= -20 & Days <=20 }
Comment