Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Nov 18, 2024
1 parent afc3f7c commit 2c75de5
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 21 deletions.
41 changes: 39 additions & 2 deletions R/methods_cplm.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,43 @@
#' @seealso [insight::standardize_names()] to rename
#' columns into a consistent, standardized naming scheme.
#'
#' @section Model components:
#' Possible values for the `component` argument depend on the model class.
#' Following are valid options:
#' - `"all"`: returns all model components, applies to all models, but will only
#' have an effect for models with more than just the conditional model component.
#' - `"conditional"`: only returns the conditional component, i.e. "fixed effects"
#' terms from the model. Will only have an effect for models with more than
#' just the conditional model component.
#' - `"smooth_terms"`: returns smooth terms, only applies to GAMs (or similar
#' models that may contain smooth terms).
#' - `"zero_inflated"` (or `"zi"`): returns the zero-inflation component.
#' - `"dispersion"`: returns the dispersion model component. This is common
#' for models with zero-inflation or that can model the dispersion parameter.
#' - `"instruments"`: for instrumental-variable or some fixed effects regression,
#' returns the instruments.
#' - `"nonlinear"`: for non-linear models (like models of class `nlmerMod` or
#' `nls`), returns staring estimates for the nonlinear parameters.
#' - `"correlation"`: for models with correlation-component, like `gls`, the
#' variables used to describe the correlation structure are returned.
#'
#' **Special models**
#'
#' Some model classes also allow rather uncommon options. These are:
#' - **mhurdle**: `"infrequent_purchase"`, `"ip"`, and `"auxiliary"`
#' - **BGGM**: `"correlation"` and `"intercept"`
#' - **BFBayesFactor**, **glmx**: `"extra"`
#' - **averaging**:`"conditional"` and `"full"`
#' - **mjoint**: `"survival"`
#' - **mfx**: `"precision"`, `"marginal"`
#' - **betareg**, **DirichletRegModel**: `"precision"`
#' - **mvord**: `"thresholds"` and `"correlation"`
#' - **clm2**: `"scale"`
#'
#' For models of class `brmsfit` (package **brms**), `component`, even more
#' options are possible for the `component` argument, which are not all
#' documented in detail here.
#'
#' @examples
#' library(parameters)
#' if (require("pscl")) {
Expand All @@ -32,7 +69,7 @@ model_parameters.zcpglm <- function(model,
ci = 0.95,
bootstrap = FALSE,
iterations = 1000,
component = c("all", "conditional", "zi", "zero_inflated"),
component = "all",
standardize = NULL,
exponentiate = FALSE,
p_adjust = NULL,
Expand All @@ -42,7 +79,7 @@ model_parameters.zcpglm <- function(model,
drop = NULL,
verbose = TRUE,
...) {
component <- match.arg(component)
component <- insight::validate_argument(component, c("all", "conditional", "zi", "zero_inflated"))

# fix argument, if model has no zi-part
if (!insight::model_info(model, verbose = FALSE)$is_zero_inflated && component != "conditional") {
Expand Down
8 changes: 5 additions & 3 deletions R/methods_mhurdle.R
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
#' @rdname model_parameters.zcpglm
#' @export
model_parameters.mhurdle <- function(model,
ci = 0.95,
component = c("all", "conditional", "zi", "zero_inflated", "infrequent_purchase", "ip", "auxiliary"),
component = "all",
exponentiate = FALSE,
p_adjust = NULL,
keep = NULL,
drop = NULL,
verbose = TRUE,
...) {
component <- match.arg(component)
component <- insight::validate_argument(
component,
c("all", "conditional", "zi", "zero_inflated", "infrequent_purchase", "ip", "auxiliary")
)

params <- .model_parameters_generic(
model,
Expand Down
61 changes: 45 additions & 16 deletions man/model_parameters.zcpglm.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2c75de5

Please sign in to comment.