make_fit_season_model: Make a fit_model that takes a seasonality component

Description Usage Arguments Details Value See Also Examples

View source: R/season_model_functions.R

Description

This method returns a function that will fit a model both with and without lagged outcomes.

Usage

1

Arguments

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).

Details

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.

Value

A callable function that takes the arguments of dat, outcomename, and a lagless flag (see, e.g., the parameters listed in 'fit_model_default()').

See Also

fit_model_default for the type of function this method will generate.

Examples

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" )

simITS documentation built on July 2, 2020, 4:10 a.m.