Тёмный

Stata - A step by step guide on how to conduct an event study 

Steffen's Classroom
Подписаться 5 тыс.
Просмотров 14 тыс.
50% 1

Welcome to my classroom!
This video is part of my Stata series. A series where I help you learn how to use Stata. In this video, we look at how to conduct an event study. We include plenty of comments in the code, so you have a good idea of what is going on. An alternative is to use the Estudy covert in another video on this channel.
Timestamps:
Intro: 0:00
Looking at the data: 1:11
Event date setup: 2:28
Calculating returns: 7:50
Regarding the estimator for the standard deviation of the abnormal return (AR): MacKinley (1997) suggests to use the standard deviation of the residual of the market model as the estimator.
Link to example data used in this video: docs.google.com/spreadsheets/...
Note: What I show here is my take on the topic. I would be happy to receive comments!
Useful links:
►Twitch: / steffens_classroom
►Twitter: / steff5001
►Workpage: www.rug.nl/staff/s.eriksen/
►Subscribe: cutt.ly/Qfu9cmV

Опубликовано:

 

1 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 79   
@arbitachakraborty1637
@arbitachakraborty1637 4 месяца назад
Very coherent explanation. You have no idea how much of my time you helped saved!! Thanks a lot.
@capham8910
@capham8910 8 месяцев назад
Dear professor Steffen! Thanks you so much for your sharing valuable knowledge, Hope you have a great life.
@alexwang2973
@alexwang2973 Год назад
Hi Steffen, I wanna say thank you for your excellent video! Last year I learned from your instruction for the analysis of my Master's Thesis and they worked pretty well. I just submitted it and feel really grateful for your tutorial. Hope you have a nice weekend!
@SteffensClassroom
@SteffensClassroom Год назад
Thanks Alex. I really appreciate it :)
@esojic
@esojic 4 месяца назад
great video! thank you!
@bhta8128
@bhta8128 Год назад
Hi Steffen! I followed the video as closely as possible but with rangestat instead. Would you say there are drawbacks / advantages to either method? And how would you assess results if you have a very large number of events, especially if there are different types of events? Such as positive or negative events?
@SteffensClassroom
@SteffensClassroom Год назад
Hi! This is a good question, and I honestly do not have a good answer atm. I never tried it with rangestat instead :)
@elliecalderwood7803
@elliecalderwood7803 Год назад
Hi Steffen, thank you for the great video. I wanted to ask with the regression at the end testing whether the cumulative abnormal return = 0, is this a two tailed test or one-sided? Should I just refer to the p-value for whether to reject the null hypothesis, I would appreciate some help interpreting how to read the output of the regressions. Thank you
@SteffensClassroom
@SteffensClassroom Год назад
Hi Ellie, As with any standard regression (in Stata at least), the null hypothesis is a two sided one. You can just refer to the p-val. As for interpreting it, I would refer you to your econometrics text book.
@LukasDrogan
@LukasDrogan Год назад
Hi Steffen, thanks for the informative video! How do you control for normality and contemporaneous correlation? you are computing a t tests statistic right? is there a possibility in state to list the p-values for the test statistic for each company CAR also? Thanks a lot! Best regards
@SteffensClassroom
@SteffensClassroom Год назад
Hi Lukas, For the company CARs, you will have to make a loop structure. That seems to me to be the way to go about it. I am not sure how you mean 'control for normality etc'. We have our standard ols assumptions when we run our market model, and for at least the normality of the errros, I would say that we can rely on the CLT given a large sample, and claim that they asymptotically normal.
@alymaghraby6923
@alymaghraby6923 Год назад
Hey Steffen, really enjoyed your video. I am currently doing my undergraduate dissertation on the effects of M&A announcements on shareholder wealth. I have succesfully gathered results for one event window (-2,+2), but would like to repeat the process over multiple event window lengths. Can you suggest an easier way to do that without having to change/restart the code everytime I want to change the event window length?
@SteffensClassroom
@SteffensClassroom Год назад
Hi Aly, You would have to write a loop to accomplish this. The groups and loops video can help you with that.
@alymaghraby6923
@alymaghraby6923 Год назад
@@SteffensClassroom Ok Thanks for your reply, I'll have a look!
@Julia-sz1xn
@Julia-sz1xn Год назад
Thank you so much for the video! Would you mind sharing your excel data (and do-file) to be able to recreate this?
@SteffensClassroom
@SteffensClassroom Год назад
Hi Julia, I have added the example data in the description. For the do-file, you can try the code directly from the video. I hope this helps!
@laladudu2842
@laladudu2842 Год назад
Hey Steffen, really helpful vid. How do i generate abnormal returns using ff3 factors, do i have to use additional specific code? Thanks for your help!
@laladudu2842
@laladudu2842 Год назад
Saw your vid from 8 months ago, but I do not only need the caars but also CARs and ARs
@SteffensClassroom
@SteffensClassroom Год назад
Hi! For the ff3, you would simply just have to extend the market model that is run inside the loop to include hml and smb. You can obtain the data on Kenneth French's website if you miss it :)
@julie_00
@julie_00 Год назад
Hi Steffen, thank you so much for this video. I followed step by step with my data for 300 companies each with its own event date and it worked perfectly. Now that I have CAR and AR, do you have any tips on how I can create AAR and CAAR with its respective t-values across companies? My goal is to show how the average abnormal returns vary from t-5 all the way to t+5 graphically. 🙏🙏
@SteffensClassroom
@SteffensClassroom Год назад
Hi Julie I didn't look much into the further steps myself, but perhaps you can get some help here: www.statalist.org/forums/forum/general-stata-discussion/general/1347543-computing-cumulative-average-abnormal-returns-caar Lmk if it works out!
@julie_00
@julie_00 Год назад
@@SteffensClassroom I'm so thankful for your link, Steffen! The codes didn't work directly, but it gave me inspiration to modify their answers and get to AAR and CAAR. I also have double checked with a simple pivot table on excel and the numbers make sense. May I ask you if my t-test for AAR makes sense to you? bysort diff: egen AAR = mean(abnormal_return) if event_window11==1 //creates cross-sectional AAR bysort id (diff) : gen CAAR = sum(AAR) if event_window11==1 // sums AAR by company * generate SD sort id obs_id by id: egen aar_sd_est = sd(AAR) if event_window11==1 * generate t-test gen test_aar = (1/sqrt(312))*(AAR/aar_sd) //here I divide by sqrt(312) since I have 312 different companies on my dataset.
@SteffensClassroom
@SteffensClassroom Год назад
@@julie_00 Didn't run the code, but at first glance, it seems ok. Always consult the literature. In this case explain why this standard error correction.
@oanaruxandra6882
@oanaruxandra6882 Год назад
Hi Steffen, I have watched your videos on RU-vid on Stata, and they are super helpful! I am currently working on my Master’s thesis and will perform an event study to determine the impact of the sanctions in response to the invasion of Ukraine on the Russian financial market. I plan to use some indices rather than companies as I am constrained by time. I would be really grateful if you could answer one of my questions. In all the studies I found, they have a single event for each company, however, in my case, the sanctions are first of all not targeted at companies or sectors and are a series of sanctions. Is it even possible to perform this analysis? If yes, do you have any advice on how to proceed?
@SteffensClassroom
@SteffensClassroom Год назад
Hi Oana, Interesting topic! This one would require a bit of thinking, and deserves a more elaborate answer. Feel free to mail me with your question.
@ottoohman7611
@ottoohman7611 4 месяца назад
Hello Oana! I am currently also working on my Master's thesis in finance and trying to observe the effects of crises on the financial market with many events on each. Did you resolve the issue regarding the loop and how did you perform ypur regressions, or did you do each event seperatly? Have you also published your Master's thesis? In that case I would love to take a look at it :)
@maximdeborger
@maximdeborger Год назад
Hi Steffen, for our undergraduate thesis, we need to investigate the effect of a corporate acquisition announcement on stock returns through Stata. I already have a data table with stock prices from 20 days before the announcement and 20 days after the announcement, that's all I have.... Can you maybe help me what exactly I need to do for this? Thanks!
@SteffensClassroom
@SteffensClassroom Год назад
Hi Maxim Sounds like you have what you need to conduct your event study. Simply follow it step by step.
@carl88317
@carl88317 Год назад
Hi Steffen, Hope you're having a lovely weekend. Say I wanted to calculate the mean of the abnormal returns over the estimation period for each company, how would I go about this?
@SteffensClassroom
@SteffensClassroom Год назад
Hi Carl! No expect in event studies, but check some of the other comments to the video :)
@chrisjackowski591
@chrisjackowski591 10 месяцев назад
hi Steffen, the xtset command, is it mandatory to do this? Do you have any videos to explain why we need to declare panel dataset as such. Thank you.
@SteffensClassroom
@SteffensClassroom 10 месяцев назад
Hi! You have to in order to use any panel data related commands, and let Stata know how the data is supposed to be sorted. I have the video on how to tsset your data that explains this. Have fun :)
@chrisjackowski591
@chrisjackowski591 10 месяцев назад
that helps@@SteffensClassroom , thank you Steffens.
@wouterj3441
@wouterj3441 3 месяца назад
Hi Steffen Great video!! I had one question and that was how can I use this do file when in my event study when a company experiences multiple events? Because, I have multiple events dates for one company.
@SteffensClassroom
@SteffensClassroom 3 месяца назад
Hi! Check one of the other comments. I believe I gave an answer there. In any case, I am unfortunately not certain :/
@nellyjoelle
@nellyjoelle Год назад
thank you for this video. Please can you do a similar example in R software?
@SteffensClassroom
@SteffensClassroom Год назад
Hi Nelly! Thank you for the nice reply. I have not gotten that far unfortunately. However, I did upload my old lectures from a course on R I used to teach: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-H1S8LAIi1vM.html&ab_channel=Steffen%27sClassroom Here I go over a lot of basics, and also a few more advanced things.
@nellyjoelle
@nellyjoelle Год назад
@@SteffensClassroom forvalues i=1(1)4 { 2. reg return mkt_return if id== 3. 'i' & estimation_window==1 4. predict p if id== 'i' 5. predict std_err_residual, stdr 6. replace SE_residual = 7. std_err_residual if id== 'i' 8. replace normal_return = p if id 9. == 'i' 10. drop p 11. drop std_err_residual 12. } invalid syntax r(198); Please i am struggling with the loop. Can you please identify the problem and tell me?
@SteffensClassroom
@SteffensClassroom Год назад
@@nellyjoelle Hi Nelly If you want my help, then please send me a mail with your problem. You can see my mail under the channel information.
@Joe_Sole
@Joe_Sole 4 месяца назад
Thank you Steffen! For my event study, I have 13 events, with each event having lots of observations. Is this okay or does number of events matter?
@SteffensClassroom
@SteffensClassroom 4 месяца назад
It is a while ago, but I would guess you simply run it per event. :)
@Joe_Sole
@Joe_Sole 4 месяца назад
@@SteffensClassroom Thanks Steffen. I was wondering do you offer consultations? Would really benefit from a one-off call if available?
@alymaghraby6923
@alymaghraby6923 Год назад
Hello Steffen, really useful video I appreciate the help. For my project, I also want to report the Average Cumulative Abnormal Returns for my sample, how would I go about doing so? Many thanks in advance
@SteffensClassroom
@SteffensClassroom Год назад
Hi Aly I would believe that I also calculate this in the video. Otherwise,the estudy command in my other video could do it.
@alymaghraby6923
@alymaghraby6923 Год назад
@@SteffensClassroom Thanks makes sense now. Additionally, following the list compay_ID CAR command at 12:11, how would I get significance stars on the CARs?
@SteffensClassroom
@SteffensClassroom Год назад
Here I would go and check the helpfile for the list command. Alternatively, you can easily see how many stars to put given your t statistics.
@p-iz7kz
@p-iz7kz Год назад
Hi steffen, thanks for the great video! I have a question about the last t-test, where you test the CAARs for significant deviation from zero. I don't understand why this test is useful. Since we observe abnormal returns throughout the estimation window, it's no surprise that there are abnormal returns in the event window too. Why would the returns in the event window suddenly be zero? I am pretty sure I am missing a crucial point here. Could you please give me a hint as to what I am missing? Thank you very much in advance!
@SteffensClassroom
@SteffensClassroom Год назад
Morning! Thank you for your question. Yes, we do observe abnormal returns, but what we are trying to see is if they are statistically different from zero. In my example, we did not reject our null hypothesis that our abnormal return is different from 0. This is basically like any other hypothesis test you would conduct :)
@p-iz7kz
@p-iz7kz Год назад
@@SteffensClassroom Thank you very much! :)
@connieblaabjerg
@connieblaabjerg 4 месяца назад
Hi Steffen, At 09:59: here you calculate the CAR (cumulative abnormal return). At 11:58: you mention the CAR by cumulative abnormal return. But at 12:21 you call it CAAR (cumulative average abnormal return). How can that be? Further, when using robust standard errors, is there still a need to perform a manual White test to test for heteroskedasticity? We have tried that in our dataset and still it still predicts heteroskedasticity.
@SteffensClassroom
@SteffensClassroom 4 месяца назад
I might have been a tad inconsistent in the naming :) In any case, I would not say you need a white test if you run robust errors.
@connieblaabjerg
@connieblaabjerg 4 месяца назад
Thank you, very helpful video! @@SteffensClassroom Just to be sure, it is a test of CAR, not CAAR, right?
@centainnesophia3139
@centainnesophia3139 Год назад
Hi Steffen, thanks so much for this video, it has been so helpful! I have adjusted your steps to for my data, as I am doing multiple events, however I am slightly confused at the table at the end - in interpreting the test statistic. you mentioned not rejecting anything in the video, could you please explain why this is? I just wanted to make sure I fully understand. Thank you.
@SteffensClassroom
@SteffensClassroom Год назад
Morning! In my video, I did not reject any of the null hypothesis, as the p values were all above 0.05 (or 0.1). Standard for hypothesis tests :)
@centainnesophia3139
@centainnesophia3139 Год назад
Afternoon! Thanks for that - I was wondering about the table with the CAR and the test statistic, I was struggling to understand when we reject the null in this case? Is it if the test statistic in the table next to the CAR is above 0.05% we accept the null? Thank you!
@SteffensClassroom
@SteffensClassroom Год назад
@@centainnesophia3139 You reject if the p value is below 0.05 say. You don't say that you accept the null hypothesis, you simply do not reject it. You would say that it is not significantly different from 0.
@centainnesophia3139
@centainnesophia3139 Год назад
Also Steffen, would you kindly be able to suggest any descriptive statistical measures you would use to accompany the event study?
@lisanaert4123
@lisanaert4123 Год назад
Hey Steffen you've been a great help in making my thesis. But i have a question, how do i do this if my dataset has multiple events for every company? I read in a comment you would change line 38 "by eventdate: gen datenum=_n". but then i get an error about the fact that it isn't sorted. But if I sort on eventdate will i have a right solution? Because the companies and dates will all change places, or does this not matter? Because i think it does because your event window needs to be around your event day and if you sort on eventdate this will all change?
@SteffensClassroom
@SteffensClassroom Год назад
Hi Lisa I would think you need to sort on two things. Another way I think will work is that you make multiple event window variables for each company. Then you will have no overlap etc. Maybe it is just rubbish, but something I would look into. Did you try and run it after you sorted it?
@lisanaert4123
@lisanaert4123 Год назад
@@SteffensClassroom Yeah the problem is it doesn't work (error not sorted). I gave every row an ID when it was sorted for company_name and date. So i now did "sort ID eventday" but it gave the error. So the next step only works if i first sort like this "sort eventday ID". but then i have the problem like in my question before.
@SteffensClassroom
@SteffensClassroom Год назад
Hi Lisa, It does sound strange, but I think I understand the problem. I think it would be better if you mail the question, and show some screenshots.
@lisanaert4123
@lisanaert4123 Год назад
@@SteffensClassroom how can I contact you?
@SteffensClassroom
@SteffensClassroom Год назад
Hi Liss, my channel has a contact mail.
@LocNguyen-qe2ss
@LocNguyen-qe2ss 7 месяцев назад
Hi, thank you for making this video. In addition, I also have to calculate the cumulative realized return and idiosyncratic risk(epsilon). Can you give some help. Thanks!
@SteffensClassroom
@SteffensClassroom 7 месяцев назад
Morning! Thank you for your message. It is unfortunately not something that I have looked into.
@4LIveAFCA
@4LIveAFCA 9 месяцев назад
Hi Steffen, hope all is wel. Thank you for uploading this video as it’s helping me run through my event study. I’m currently facing an issue when entering code line 97 of oyu video. My normal_returns aren’t calculating and i’m only seeing dots. Any idea what i can be doing wrong (or anyone reading this comment for all i care). Many thanks in advance!
@SteffensClassroom
@SteffensClassroom 9 месяцев назад
Hello! It is difficult for me to see what the exact issue is, but my first thought would be that it has something to do with missing values. Does your dataset contain missing values? If so, this may influence the code, and adding an option such as if !=. or !(missing) would be needed.
@4LIveAFCA
@4LIveAFCA 9 месяцев назад
i@@SteffensClassroom i was able to figure it out and started working! My next challenge is with the loop. I have two comanies with their own event dates. Strangely when running the loop in line 97 from your video it only runs from one company. bellow is the code i use. When i change the number that in the first line it will only calculate the normal returns for the corresponding id and not for both. Do you know what i'm doing wrong or how i can fix this? forvalues i=1(1)2 { /*note: replace 2 with your highest number of id in your dataset */ reg return mkt_return if id==`i' & estimation_window==1 predict p if id==`i' predict std_err_residual, stdr replace SE_residual = std_err_residual if id==`i' replace normal_return = p if `i' /*& event_window==1*/ drop p drop std_err_residual }
@HuongNguyen-pd9sr
@HuongNguyen-pd9sr Год назад
Thanks a lot. But how to generate the event date?
@SteffensClassroom
@SteffensClassroom Год назад
I show you starting at 4:00. Line 41 in the code.
@epiccheese100
@epiccheese100 Год назад
Hi Steffen, very helpful video - could you give me some instruction on where to change to event id instead of company id for multiple events per company?
@SteffensClassroom
@SteffensClassroom Год назад
Hi! I believe this would simply involve changing your event date variable. I mention it as the 'target' variable in my comments.
@epiccheese100
@epiccheese100 Год назад
@@SteffensClassroom would it be multiple event dates in the same eventdate column, and if so would you let me know what the code may look like? For example if I had 15 years of data and was looking at 3 events per year on different days for each company?
@SteffensClassroom
@SteffensClassroom Год назад
Hi Sachin, Sorry for the slow reply. I have not looked much into it myself, as I have generally limited experience with event studies :) However, I would change from looking at a company id to an event id. Line 38 in the code would then be altered to reflect to events rather than companies.
@epiccheese100
@epiccheese100 Год назад
@@SteffensClassroom Hi Steffen, this makes sense, but would this then mean that you would have to do each company separately? I very much value your advice as I think I am less experienced with Stata! Does there seem to be a method to analyse multiple events and multiple companies at the same time? Many thanks
@SteffensClassroom
@SteffensClassroom Год назад
@@epiccheese100 Hi! I gave it a look, but I am currently noy quite sure how to analyze this. My guess would still be to split the company data, so there is one event per company. So if a company has 2 events, the company would be featured twice in your data. This may be very naive, but it is a guess.
@isabelm.6640
@isabelm.6640 5 месяцев назад
🚨🚨 SOS! 🚨🚨 I so hope you see this, because unfortunately I have to submit my dissertation soon and I'm getting desperate about moderators. You already show how I examine the influence of controls (sex), how does this work with moderators coded as dummies (0 = Liberal; 1= other)? Many thanks in advance! ☺
@isabelm.6640
@isabelm.6640 5 месяцев назад
and thank you very much for the insightful video, because surprisingly there are very few videos on the subject of event studies. You have saved me!
@SteffensClassroom
@SteffensClassroom 5 месяцев назад
Hi Isabel. Feel free to write an email to the mail written on the channel page. Then I can see if I can help out. However, from what I get, you can do this in much the same way. :)
Далее
Stata - 10 Tips and Tricks
11:12
Просмотров 1,6 тыс.
Best exercises to lose weight ! 😱
00:19
Просмотров 14 млн
Stata - How to conduct an event study
10:14
Просмотров 19 тыс.
Event Study Methodologies - Basic
12:46
Просмотров 82 тыс.
Difference-in-differences methods
16:18
Просмотров 43 тыс.
Stata - How to Estimate a Heckman Selection Model
11:03
Event Studies and Abnormal Returns in Excel
16:38
Просмотров 45 тыс.
Event Studies in finance and economics
20:15
Просмотров 10 тыс.
Best exercises to lose weight ! 😱
00:19
Просмотров 14 млн