How do I convert monthly data to quarterly using as the value of the quarter the value of the 1st month of each quarter?
조회 수: 8 (최근 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!