Skip to content

Commit 2c75de5

Browse files
committed
docs
1 parent afc3f7c commit 2c75de5

File tree

3 files changed

+89
-21
lines changed

3 files changed

+89
-21
lines changed

R/methods_cplm.R

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,43 @@
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") {

R/methods_mhurdle.R

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
#' @rdname model_parameters.zcpglm
21
#' @export
32
model_parameters.mhurdle <- function(model,
43
ci = 0.95,
5-
component = c("all", "conditional", "zi", "zero_inflated", "infrequent_purchase", "ip", "auxiliary"),
4+
component = "all",
65
exponentiate = FALSE,
76
p_adjust = NULL,
87
keep = NULL,
98
drop = NULL,
109
verbose = TRUE,
1110
...) {
12-
component <- match.arg(component)
11+
component <- insight::validate_argument(
12+
component,
13+
c("all", "conditional", "zi", "zero_inflated", "infrequent_purchase", "ip", "auxiliary")
14+
)
1315

1416
params <- .model_parameters_generic(
1517
model,

man/model_parameters.zcpglm.Rd

Lines changed: 45 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)