Dealing with Data Involving Semesters

I am working on a time series analysis and forecast using course enrollment data collected on a semester basis three times per year (summer, fall, and spring). When I reindex the data using row numbers as the index, following the stock prices example in section 5.2 of Dr. Hyndman's textbook, I run into the issue where a decomposition of the time series with components omits the seasonal component of the series. Consequently, using autoplot to plot the components results in a plot with only a trend and remainder component, with the seasonal component missing.

I am aware that the lubridate package offers the semester() accessor function, but recoding my data with a two-semester solution that splits the year into two exact halves would not only result in a loss of detail, but would preclude me from being able to make predictions for the spring term, since semester() would combine the spring and summer terms into just one term.

Is there any way to recode the data in a way that would still allow me to take full advantage of all the new features in tidyverts?

For context, my tibble consists of three variables (TERM, COURSE, and ENROLLMENT), where TERM contains 202201, 202205, 202208, etc., COURSE contains the course name and number (e.g., MAT101, ENG102, etc.), and ENROLLMENT contains enrollment for that course and term.

Thank you all for your help.


Referred here by Forecasting: Principles and Practice, by Rob J Hyndman and George Athanasopoulos

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.