fit_model_default: Default ITS model

View source: R/season_model_functions.R

fit_model_defaultR Documentation

Default ITS model

Description

This fits the model 'outcomename ~ lag.outcome + time', with no covariates.

Usage

fit_model_default(dat, outcomename, timename = "time", lagless = FALSE, ...)

Arguments

dat

Dataframe of pre-policy data to fit model to. Needs a "time" column

outcomename

Outcome of interest

lagless

Boolean, include the lagged outcome, or not?

...

Extra arguments passed to the lm() call.

Value

A fit model (a 'lm' object from a 'lm()' call) from fitting a simple regression of outcome onto time and lagged time.

Examples

mecklenberg = add_lagged_covariates(mecklenberg, "pbail")
meck.pre = filter( mecklenberg, month <= 0 )
mod = fit_model_default( meck.pre, "pbail", "month", lagless = TRUE )
summary( mod )
mod = fit_model_default( meck.pre, "pbail", "month", lagless = FALSE )
summary( mod )

lmiratrix/simITS documentation built on Sept. 1, 2023, 9:02 p.m.