Convert table of Daily Stock data into Monthly data
1 次查看(过去 30 天)
显示 更早的评论
I have a 13000x3000 table with colums representing the dates and rows representing the stocks with values of daily stock returns in it.
Now I'd like to get the monthly sum of returns for each stock (each line).
Would appreciate any kind of help.
采纳的回答
Cris LaPierre
2021-3-12
Use the date info as your groupvar.
6 个评论
Cris LaPierre
2021-3-15
编辑:Cris LaPierre
2021-3-20
It would appear that your grouping variable, dates, is not valid with the syntax you are using.
When you use the table form, your grouping variable needs to be a variable in the table. Try adding dates as a new column in your table rather than as the rownames.
G_CRSP.dates = dates;
Then your groupsummary statement should work.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Dates and Time 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!