View source: R/model_functions.R
make_inlamemi_stacks | R Documentation |
Make data stacks for joint model specification in INLA
make_inlamemi_stacks(
formula_moi,
formula_imp,
formula_mis = NULL,
family_moi = "gaussian",
data,
error_type = "classical",
error_variable = NULL,
repeated_observations = FALSE,
vars = NULL
)
formula_moi |
an object of class "formula", describing the main model to be fitted. |
formula_imp |
an object of class "formula", describing the imputation model for the mismeasured and/or missing observations. |
formula_mis |
an object of class "formula", describing the missingness model. Does not need to have a response variable, since this will always be a binary missingness indicator. |
family_moi |
a string indicating the likelihood family for the model of interest (the main model). |
data |
an object of class data.frame or list containing the variables in the model. |
error_type |
type of error (one or more of "classical", "berkson", "missing") |
error_variable |
character vector with the name(s) of the variable(s) with error. |
repeated_observations |
Does the variable with measurement error and/or missingness have repeated observations? If so, set this to "TRUE". In that case, when specifying the formula, use the name of the variable without any numbers, but when specifying the data, make sure that the repeated measurements end in a number, i.e "sbp1" and "sbp2". |
vars |
Results from a call to "extract_variables_from_formula" function. If this is not passed as an argument, it is called inside the function. |
An object of class inla.stack with data structured according to specified formulas and error models.
make_inlamemi_stacks(formula_moi = y ~ x + z,
formula_imp = x ~ z,
data = simple_data,
error_type = "classical")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.