I have to perform an event study for my master thesis. However, I'm only able to to this by hand in excel and I don't even know how to start with R as my skills are very basic. I know the steps, which I have to perform, but I just can't translate it into code + I don't know how to prepare my data. I would be very happy if someone could help me or give me a hint regarding my data set or the code.
The steps I want to perform:
Computing the abnormal return by calculating: Return(event date) - expected return (Regression of the past 40 days based on the S&p500)
Test whether the CAR is significant based on a paper that a picked.
Unfortunately, I don't know how to perform the first step (each firm has a different event date) and how my data should look like. I started with the data and attached a screenshot.enter image description here
Thank you very much in advance and Best regards
Nebsi