View source: R/season_model_functions.R
fit_model_default | R Documentation |
This fits the model 'outcomename ~ lag.outcome + time', with no covariates.
fit_model_default(dat, outcomename, timename = "time", lagless = FALSE, ...)
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. |
A fit model (a 'lm' object from a 'lm()' call) from fitting a simple regression of outcome onto time and lagged time.
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 )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.