1818# ' @seealso [insight::standardize_names()] to rename
1919# ' columns into a consistent, standardized naming scheme.
2020# '
21+ # ' @section Model components:
22+ # ' Possible values for the `component` argument depend on the model class.
23+ # ' Following are valid options:
24+ # ' - `"all"`: returns all model components, applies to all models, but will only
25+ # ' have an effect for models with more than just the conditional model component.
26+ # ' - `"conditional"`: only returns the conditional component, i.e. "fixed effects"
27+ # ' terms from the model. Will only have an effect for models with more than
28+ # ' just the conditional model component.
29+ # ' - `"smooth_terms"`: returns smooth terms, only applies to GAMs (or similar
30+ # ' models that may contain smooth terms).
31+ # ' - `"zero_inflated"` (or `"zi"`): returns the zero-inflation component.
32+ # ' - `"dispersion"`: returns the dispersion model component. This is common
33+ # ' for models with zero-inflation or that can model the dispersion parameter.
34+ # ' - `"instruments"`: for instrumental-variable or some fixed effects regression,
35+ # ' returns the instruments.
36+ # ' - `"nonlinear"`: for non-linear models (like models of class `nlmerMod` or
37+ # ' `nls`), returns staring estimates for the nonlinear parameters.
38+ # ' - `"correlation"`: for models with correlation-component, like `gls`, the
39+ # ' variables used to describe the correlation structure are returned.
40+ # '
41+ # ' **Special models**
42+ # '
43+ # ' Some model classes also allow rather uncommon options. These are:
44+ # ' - **mhurdle**: `"infrequent_purchase"`, `"ip"`, and `"auxiliary"`
45+ # ' - **BGGM**: `"correlation"` and `"intercept"`
46+ # ' - **BFBayesFactor**, **glmx**: `"extra"`
47+ # ' - **averaging**:`"conditional"` and `"full"`
48+ # ' - **mjoint**: `"survival"`
49+ # ' - **mfx**: `"precision"`, `"marginal"`
50+ # ' - **betareg**, **DirichletRegModel**: `"precision"`
51+ # ' - **mvord**: `"thresholds"` and `"correlation"`
52+ # ' - **clm2**: `"scale"`
53+ # '
54+ # ' For models of class `brmsfit` (package **brms**), `component`, even more
55+ # ' options are possible for the `component` argument, which are not all
56+ # ' documented in detail here.
57+ # '
2158# ' @examples
2259# ' library(parameters)
2360# ' if (require("pscl")) {
@@ -32,7 +69,7 @@ model_parameters.zcpglm <- function(model,
3269 ci = 0.95 ,
3370 bootstrap = FALSE ,
3471 iterations = 1000 ,
35- component = c( " all" , " conditional " , " zi " , " zero_inflated " ) ,
72+ component = " all" ,
3673 standardize = NULL ,
3774 exponentiate = FALSE ,
3875 p_adjust = NULL ,
@@ -42,7 +79,7 @@ model_parameters.zcpglm <- function(model,
4279 drop = NULL ,
4380 verbose = TRUE ,
4481 ... ) {
45- component <- match.arg (component )
82+ component <- insight :: validate_argument (component , c( " all " , " conditional " , " zi " , " zero_inflated " ) )
4683
4784 # fix argument, if model has no zi-part
4885 if (! insight :: model_info(model , verbose = FALSE )$ is_zero_inflated && component != " conditional" ) {
0 commit comments