Linear and quadratic trends with seasonality

Good afternoon to who this may concern. This is my first time using R studio for a class and any guidance would be appreciated.

The data i am using very basic. It is the year as the y variable and hours per week as the x variable.

there are 4 things that i am trying to do with this data set.

A) Linear trend model
B)liner trend with seasonality
C)Quadratic Trend
D) Quadratic trend with seasonality

I am able to get A and C to run in R studio. The problem i am having is when i try to run B and D the seasonality. it gives me an error

Model_B <- tslm(AMERICA ~trend+season)
Error in tslm(AMERICA ~ trend + season) :
Non-seasonal data cannot be modelled using a seasonal factor

This is the error that comes up when i try to run it in RStudio

Thank you so much for your time and i hope you have a great rest of your Sunday.

We don't have the data (or all of the code) so it's very difficult to troubleshoot.

A reprex (reproducible example) would be helpful? If you've never heard of a reprex before, start by reading "What is a reprex", and follow the advice further down that page.

For one though though, you should not attach the data frame (assuming that you did). whenever you use the formula method, you should follow the formula with a data argument that points to the data frame that contains the columns.


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.