cross_basis | R Documentation |
Creates cross-basis using natural splines for regression in DLIM
cross_basis(
x,
M,
L = NULL,
argmod = list(),
arglag = list(),
model_type = "standard"
)
x |
a numeric time series vector of length n or matrix of lagged exposures (columns) for n individuals (rows) |
M |
vector of length n containing modifier values |
L |
a numeric vector of length 1 containing the number of lag terms. This is required if |
argmod |
a list: $fun is the spline function for the modifier ("ps" or "cr" to penalize), $arg is a list of arguments for the spline function (must be named by argument), $df is the degrees of freedom, $sp is optional smoothing parameter |
arglag |
a list: $fun is the spline function for the lag ("ps" or "cr" to penalize), $arg is a list of arguments for the spline function (must be named by argument), $df is the degrees of freedom, $sp is optional smoothing parameter |
model_type |
"linear" for a DLIM with linear interaction, "quadratic" for a DLIM with quadratic interaction, "standard" for a DLIM with splines |
This function returns a list of 5 or 6 elements:
cb |
cross-basis (matrix) |
B_lag |
lag basis (basis matrix) |
B_mod |
modifier basis (basis matrix) |
df_l |
lag degrees of freedom (numeric) |
df_m |
modifier degrees of freedom (numeric) |
L |
number of lags (numeric) |
Slist |
lag and modifier penalty matrices, if penalizing (list) |
dlim
Type vignette('dlimOverview')
for a detailed description.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.