Learn R Programming

simITS (version 0.1.1)

fit_model_default: Default ITS model

Description

This fits the model `outcomename ~ lag.outcome + month`, with no covariates.

Usage

fit_model_default(dat, outcomename, lagless = FALSE, ...)

Arguments

dat

Dataframe of pre-policy data to fit model to. Needs a "month" 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 month and lagged month.

Examples

Run this code
# NOT RUN {
mecklenberg = add_lagged_covariates(mecklenberg, "pbail")
meck.pre = filter( mecklenberg, month <= 0 )
mod = fit_model_default( meck.pre, "pbail", lagless = TRUE )
summary( mod )
mod = fit_model_default( meck.pre, "pbail", lagless = FALSE )
summary( mod )
# }

Run the code above in your browser using DataLab