Fit DLIM for simulation
Usage
sim_dlim(
data,
df_m,
df_l,
penalize = TRUE,
pen_fn = "ps",
mod_args = NULL,
lag_args = NULL,
fit_dlm = FALSE,
model_type = "standard",
...
)
Arguments
- data
output from
sim_data
- df_m
degrees of freedom for modifiers
- df_l
degrees of freedom for lags
- penalize
True to penalize model
- pen_fn
if penalizing, can specify "ps" for penalized B-splines or "cr" for cubic regression splines with penalties on second derivatives
- mod_args
a list of additional arguments for the spline function (must be named by argument)
- lag_args
a list of additional arguments for the spline function (must be named by argument)
- fit_dlm
True to additionally fit dlm for comparison
- model_type
"linear" for a DLIM with linear interaction, "quadratic" for a DLIM with quadratic interaction, "standard" for a DLIM with splines
- ...
arguments to pass to model fitting function
Value
This function returns an object of class "sim_dlim
"
- cb
DLIM cross-basis (class "
cross-basis
")- fit
DLIM model fit (class "
lm
", "glm
", "gam
")- cb_dlm
DLM cross-basis (class "
crossbasis
")- model_dlm
DLM model fit (class "
lm
", "glm
", "gam
")- true_betas
true linear effect of the exposure on the response for each individual and time point (class "
matrix
")- modifiers
modifiers
fromnumeric
- data
data
(class "list
")