Helper function to construct covariate model matrices from a list of two-sided formulas.
par_model_matrix.Rd
Helper 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
, wheretheta
is a parameter or state in asalmonIPM
model that accepts covariates andt1 ... tK
are 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_data
using the formulas inpar_models
should 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 = FALSE
may be appropriate.- scale
Logical indicating whether the terms in model matrices constructed from
fish_data
using the formulas inpar_models
should 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