Specify the default (imputation) model types

get_models(fixed, random = NULL, data, auxvars = NULL,
no_model = NULL, models = NULL)

## Arguments

fixed |
a two sided formula describing the fixed-effects part of the
model (see `formula` ) |

random |
only for multi-level models:
a one-sided formula of the form `~x1 + ... + xn | g` ,
where `x1 + ... + xn` specifies the model for the random
effects and `g` the grouping variable |

data |
a `data.frame` |

auxvars |
optional one-sided formula of variables that should be used as
predictors in the imputation procedure (and will be imputed
if necessary) but are not part of the analysis model |

no_model |
names of variables for which no model should be specified.
Note that this is only possible for completely observed
variables and implies the assumptions of independence between
the excluded variable and the incomplete variables. |

models |
optional named vector specifying the types of models for
(incomplete) covariates.
This arguments replaces the argument `meth` used in earlier versions.
If `NULL` (default) models will be determined
automatically based on the class of the respective columns of `data` . |

## Value

`get_models()`

returns a list of two vectors named `models`

and `meth`

.

`models`

is a named vector containing the names of covariates
that either have missing values and/or are longitudinal (level-1)
covariates and the corresponding (imputation) models as well
as models for variables for which the user has specified a model.

`meth`

is a subset of `models`

containing only the variables
that have missing values.

## Examples

get_models(y ~ C1 + C2 + B2 + O2 + M2, data = wideDF)

#> $models
#> O2 M2 C2 B2
#> "cumlogit" "multilogit" "norm" "logit"
#>
#> $meth
#> O2 M2 C2 B2
#> "cumlogit" "multilogit" "norm" "logit"
#>

get_models(y ~ C1 + O2 + c2 + b1 + o2 + time, random = ~ 1 | id, data = longDF)

#> $models
#> O2 b1 time o2 c2
#> "cumlogit" "glmm_logit" "lmm" "clmm" "lmm"
#>
#> $meth
#> O2 o2 c2
#> "cumlogit" "clmm" "lmm"
#>

get_models(y ~ C1 + O2 + c2 + b1 + o2 + time, random = ~ 1 | id,
no_model = 'time', data = longDF)

#> $models
#> O2 b1 o2 c2
#> "cumlogit" "glmm_logit" "clmm" "lmm"
#>
#> $meth
#> O2 o2 c2
#> "cumlogit" "clmm" "lmm"
#>

get_models(y ~ C1 + O2 + c2 + b1 + o2 + time, random = ~ 1 | id,
no_model = 'time', data = longDF, models = c(C1 = 'norm'))

#> Note:
#> Models have been specified for the variabe(s) C1.
#> These models are not needed for imputation and are likely to increase the computational time.

#> $models
#> C1 O2 b1 o2 c2
#> "norm" "cumlogit" "glmm_logit" "clmm" "lmm"
#>
#> $meth
#> O2 o2 c2
#> "cumlogit" "clmm" "lmm"
#>