Simulates results from a distributed lag model under an hypothetical effect
pattern provided by the user, which can be linear or non-linear. The output
is the passed to the plot method to visualize consequences of
collinearity.
collindlnm(
model,
x,
cb,
at = 1,
cen = 0,
effect,
type = c("coef", "risk"),
shape = c("linear", "nonlinear"),
nsim = 100,
verbose = TRUE,
seed = NULL
)A list including the results of the simulations to be passed to the plot
method.
a model that includes a crossbasis. Currently, models allowed are those
of class "glm" or "lme", if shape = "linear"; or
"glm", if shape = "nonlinear".
if shape = "linear", a matrix that includes the values of the predictor
under study, in the first column, and the lagged values, up to the maximum lag
considered, as the subsequent columns. If shape = "nonlinear", a numeric
vector or 1-column matrix including the original (i.e. lag 0) values of the
predictor.
an object of class "crossbasis". The crossbasis included in model.
the increase(s) in the predictor under study to be considered to report the
effects of the variable. If shape = "linear", at must be a single
number. If shape = "nonlinear", at must be a numeric vector with
at least two different values.
a number. Reference value of the predictor under study, used to calculate
effects. If shape = "linear", the value of cen is irrelevant (and
it is internally set to 0).
a vector or a matrix, depending on shape, including the
hypothetical effect of the predictor under analysis. If shape = "linear",
a vector including the linear effect at each lag (including lag 0). If
shape = "nonlinear", a matrix including the effect at each lag (including
lag 0) (columns) and for each value in at (rows).
a character. If type = "coef" (default), effect is supposed
to be in the linear predictor scale (i.e. it is considered as regression
coefficients in model). If type = "risk", effect is supposed
to be in terms of relative risks (i.e. exp(coef), as ORs or RRs in logistic
or Poisson families, respectively). If model is of class "lme",
then it must be type = "coef" (default).
the shape of the relationship between the linear predictor of the model
and the outcome. Default is "linear".
number of simulations. Default is 100.
a logical value indicating output status messages. Default is TRUE.
a number. Seed for reproducibility of results. Default is NULL (no
seed).
# For detailed examples:
browseVignettes("collin")
Run the code above in your browser using DataLab