This may sound like an easy question, but I am unable to find a way to calculate monthly returns from daily price data in R. I have data for 500 companies for over 10 years, therefore I have a panel dataset. My data is presented in the following way:
Date | Ticker | Closing Price |
---|---|---|
2018-09-07 | CBRE | 45.80 |
2018-09-10 | CBRE | 46.35 |
2018-09-11 | CBRE | 46.65 |
.... | ||
2018-09-07 | CE | 20.80 |
2018-09-10 | CE | 21.35 |
2018-09-11 | CE | 21.65 |
... | .. | ... |
Thank you very much for your help. I would really appreciate some guideline on how to calculate this.