Description Usage Arguments Details Value See Also Examples
View source: R/season_model_functions.R
This method returns a function that will fit a model both with and without lagged outcomes.
1 | make_fit_season_model(formula, no_lag = NULL)
|
formula |
Formula specifying seasonality. No outcome or month needed. |
no_lag |
Formula specifying additional variables to not 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 month component as well, and will add that and an intercept in automatically.
A callable function that takes the arguments of dat, outcomename, and a lagless flag (see, e.g., the parameters listed in 'fit_model_default()').
fit_model_default for the type of function this method will generate.
1 2 3 4 | data( "newjersey")
modF = make_fit_season_model( ~ temperature )
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.