Helper function to construct covariate model matrices from a list of two-sided formulas.
par_model_matrix.RdHelper function to construct covariate model matrices from a list of two-sided formulas.
Arguments
- par_models
A list of two-sided formulas of the form
theta ~ t1 + ... + tK, wherethetais a parameter or state in asalmonIPMmodel that accepts covariates andt1 ... tKare terms involving variables infish_data; seesalmonIPM()for details.- fish_data
See
salmonIPM(). In particular, the columns...may be used on the right-hand side of formulas inpar_models.- center
Logical indicating whether the terms in model matrices constructed from
fish_datausing the formulas inpar_modelsshould be centered. It is usually recommended to use the default (TRUE) so the baseline parameter estimate applies when predictors are at their sample means, but in some cases such as factor predictorscenter = FALSEmay be appropriate.- scale
Logical indicating whether the terms in model matrices constructed from
fish_datausing the formulas inpar_modelsshould be scaled to have column SDs of 1.
See also
salmonIPM() for specifying covariate effects via par_models,
stan_data() for assembling input data including covariate model matrices