How do I convert monthly data to quarterly using as the value of the quarter the value of the 1st month of each quarter?
10 ビュー (過去 30 日間)
古いコメントを表示
I have a dataset of monthly data on CPI and I want to convert it to quarterly. I tried to use timetable but it didn't work I think.
0 件のコメント
回答 (2 件)
Cris LaPierre
2020 年 12 月 14 日
Not knowing anything about the format of your data, I would suggest using groupsummary. This will allow you to determine how to summarize the monthly data to quarterly data (average, sum, etc). If your data is already in a table or timetable, and your date info is already a datetime, you can use the 'quarter' groupbin.
qtrCPI = groupsummary(mnCPI,"Timestamp","quarter","mean")
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Data Type Conversion についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!