Dear all,
A few days ago I posted the following message:
"I currently have one dataset with IPO data for a specific sample of firms and sample period. Among these data I have the lockup expiration dates and I want to calculate cumulative abnormal returns for a time frame 3 days before and 3 days after. I have obtained the returns from CRSP and currently have them in another dataset. Nevertheless I have thousands of returns for each firm covering the whole sample period while I only need the returns from t=-3 to t=+3. So I want to ask how I can merge the two datasets keeping only the returns I am interested in (the ones around the lockup expiration dates)."
I used a code that a statalist member suggested:
use "IPO data", clear
expand 7
generate int return_date = lockup_expiration_date // name of date variable in "returns from CRSP" dataset
bysort firm_id: replace return_date = return_date + (_n - 4)
merge 1:1 firm_id return_date using "returns from CRSP", assert(match using) keep(match)
The code works but I have a problem with missing values due to the fact that CRSP offers data for stock returns only for trading dates (not weekends or holidays during which stock exchanges are not open). I know that I have somehow to make a conversion to a business calendar and I have read manuals but it seems rather complicated considering that I have somehow to incorporate this new requirement into the above-mentioned code. So eg Stata should not include weekends in my event window for each firm but move to the previous or next working day.
Could someone possible provide the code I need combined with the above-mentioned code? I am a new Stata user so I really need help with the steps and the code.
Thank you all in advance,
Natalia Tsorapi
A few days ago I posted the following message:
"I currently have one dataset with IPO data for a specific sample of firms and sample period. Among these data I have the lockup expiration dates and I want to calculate cumulative abnormal returns for a time frame 3 days before and 3 days after. I have obtained the returns from CRSP and currently have them in another dataset. Nevertheless I have thousands of returns for each firm covering the whole sample period while I only need the returns from t=-3 to t=+3. So I want to ask how I can merge the two datasets keeping only the returns I am interested in (the ones around the lockup expiration dates)."
I used a code that a statalist member suggested:
use "IPO data", clear
expand 7
generate int return_date = lockup_expiration_date // name of date variable in "returns from CRSP" dataset
bysort firm_id: replace return_date = return_date + (_n - 4)
merge 1:1 firm_id return_date using "returns from CRSP", assert(match using) keep(match)
The code works but I have a problem with missing values due to the fact that CRSP offers data for stock returns only for trading dates (not weekends or holidays during which stock exchanges are not open). I know that I have somehow to make a conversion to a business calendar and I have read manuals but it seems rather complicated considering that I have somehow to incorporate this new requirement into the above-mentioned code. So eg Stata should not include weekends in my event window for each firm but move to the previous or next working day.
Could someone possible provide the code I need combined with the above-mentioned code? I am a new Stata user so I really need help with the steps and the code.
Thank you all in advance,
Natalia Tsorapi
Comment