View source: R/season_model_functions.R
make_fit_season_model | R Documentation |
This method returns a function that will fit a model both with and without lagged outcomes.
make_fit_season_model(formula, no_lag = NULL)
formula |
Formula specifying seasonality. No outcome or time needed. |
no_lag |
Formula specifying additional covariates that should be included, but without lag (usually used due to colinearity of lagged outcomes, such as with a sin and cos component). |
You hand it a formula object specifying the seasonality, e.g., " ~ Q2 + Q3 + Q4", if you have quarterly season effects. This method assumes you want models with a linear time component as well, and will add that and an intercept in automatically.
It gives you a function back, that you can use to analyze data.
Callable function. See make_fit_model.
make_fit_model for the type of function this method will generate.
data( "newjersey")
modF = make_fit_season_model( ~ temperature, timename = "month" )
newjersey = add_lagged_covariates( newjersey, "n.warrant", covariates = c("temperature") )
modF( newjersey, "n.warrant" )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.