From d3ca9a2e2be5418b702daf857af761b813ba7ec6 Mon Sep 17 00:00:00 2001 From: Daniel Date: Tue, 19 Nov 2024 08:45:02 +0100 Subject: [PATCH] docs --- R/1_model_parameters.R | 5 +- R/methods_MCMCglmm.R | 1 - R/methods_aod.R | 21 +-- R/methods_base.R | 1 - R/methods_brms.R | 15 +- R/methods_cplm.R | 6 +- R/methods_posterior.R | 1 - R/methods_rstanarm.R | 20 +-- R/utils_model_parameters.R | 2 +- man/model_parameters.Rd | 5 +- man/model_parameters.glimML.Rd | 59 +++++++- man/model_parameters.glmmTMB.Rd | 6 +- man/model_parameters.mlm.Rd | 6 +- man/model_parameters.stanreg.Rd | 244 +++++++++++++++----------------- man/model_parameters.zcpglm.Rd | 6 +- pkgdown/_pkgdown.yml | 15 +- 16 files changed, 232 insertions(+), 181 deletions(-) diff --git a/R/1_model_parameters.R b/R/1_model_parameters.R index 179a8c13e..1345b122d 100644 --- a/R/1_model_parameters.R +++ b/R/1_model_parameters.R @@ -10,8 +10,9 @@ #' - [Default method][model_parameters.default()]: `lm`, `glm`, **stats**, **censReg**, #' **MASS**, **survey**, ... #' - [Additive models][model_parameters.cgam()]: **bamlss**, **gamlss**, **mgcv**, -#' **scam**, **VGAM**, `Gam`, `gamm`, ... -#' - [ANOVA][model_parameters.aov()]: **afex**, `aov`, `anova`, ... +#' **scam**, **VGAM**, `Gam` (although the output of `Gam` is more Anova-alike), +#' `gamm`, ... +#' - [ANOVA][model_parameters.aov()]: **afex**, `aov`, `anova`, `Gam`, ... #' - [Bayesian][model_parameters.stanreg()]: **BayesFactor**, **blavaan**, **brms**, #' **MCMCglmm**, **posterior**, **rstanarm**, `bayesQR`, `bcplm`, `BGGM`, `blmrm`, #' `blrm`, `mcmc.list`, `MCMCglmm`, ... diff --git a/R/methods_MCMCglmm.R b/R/methods_MCMCglmm.R index 296307485..d83240b61 100644 --- a/R/methods_MCMCglmm.R +++ b/R/methods_MCMCglmm.R @@ -21,7 +21,6 @@ p_value.MCMCglmm <- function(model, ...) { } -#' @rdname model_parameters.stanreg #' @export model_parameters.MCMCglmm <- function(model, centrality = "median", diff --git a/R/methods_aod.R b/R/methods_aod.R index f2b7c455c..f45b16062 100644 --- a/R/methods_aod.R +++ b/R/methods_aod.R @@ -6,23 +6,28 @@ #################### .glimML ------ -#' Parameters from special models +#' @title Parameters from special models +#' @name model_parameters.glimML #' -#' Parameters from special regression models not listed under one of the previous categories yet. +#' @description +#' Parameters from special regression models not listed under one of the +#' previous categories yet. #' #' @param component Model component for which parameters should be shown. May be -#' one of `"conditional"`, `"precision"` (**betareg**), -#' `"scale"` (**ordinal**), `"extra"` (**glmx**), -#' `"marginal"` (**mfx**), `"conditional"` or `"full"` (for -#' `MuMIn::model.avg()`) or `"all"`. +#' one of `"conditional"`, `"precision"` (e.g. **betareg**), `"scale"` (e.g. +#' **ordinal**), `"extra"` (e.g. **glmx**), `"marginal"` (e.g. **mfx**), +#' `"conditional"` or `"full"` (for `MuMIn::model.avg()`) or `"all"`. See section +#' _Model components_ for an overview of possible options for `component`. #' @param include_studies Logical, if `TRUE` (default), includes parameters #' for all studies. Else, only parameters for overall-effects are shown. #' @inheritParams model_parameters.default #' @inheritParams model_parameters.stanreg #' @inheritParams simulate_model #' -#' @seealso [insight::standardize_names()] to rename -#' columns into a consistent, standardized naming scheme. +#' @seealso [insight::standardize_names()] to rename columns into a consistent, +#' standardized naming scheme. +#' +#' @inheritSection model_parameters.zcpglm Model components #' #' @examples #' library(parameters) diff --git a/R/methods_base.R b/R/methods_base.R index 08236bab4..826a39e06 100644 --- a/R/methods_base.R +++ b/R/methods_base.R @@ -1,4 +1,3 @@ -#' @rdname model_parameters.stanreg #' @export model_parameters.data.frame <- function(model, as_draws = FALSE, diff --git a/R/methods_brms.R b/R/methods_brms.R index c2a7637fa..3ec843058 100644 --- a/R/methods_brms.R +++ b/R/methods_brms.R @@ -1,4 +1,3 @@ -#' @rdname model_parameters.stanreg #' @inheritParams insight::get_parameters #' @export model_parameters.brmsfit <- function(model, @@ -209,11 +208,17 @@ model_parameters.brmsfit <- function(model, #' @export standard_error.brmsfit <- function(model, - effects = c("fixed", "random"), - component = c("all", "conditional", "zi", "zero_inflated"), + effects = "fixed", + component = "all", ...) { - effects <- match.arg(effects) - component <- match.arg(component) + effects <- insight::validate_argument( + effects, + c("fixed", "random") + ) + component <- insight::validate_argument( + component, + c("all", "conditional", "zi", "zero_inflated") + ) params <- insight::get_parameters(model, effects = effects, component = component, ...) diff --git a/R/methods_cplm.R b/R/methods_cplm.R index 503371584..1c729cd63 100644 --- a/R/methods_cplm.R +++ b/R/methods_cplm.R @@ -52,9 +52,9 @@ #' - **clm2**: `"scale"` #' - **selection**: `"selection"`, `"outcome"`, and `"auxiliary"` #' -#' 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. +#' For models of class `brmsfit` (package **brms**), even more options are +#' possible for the `component` argument, which are not all documented in detail +#' here. #' #' @examples #' library(parameters) diff --git a/R/methods_posterior.R b/R/methods_posterior.R index a79e9bb08..eecbc83ac 100644 --- a/R/methods_posterior.R +++ b/R/methods_posterior.R @@ -1,4 +1,3 @@ -#' @rdname model_parameters.stanreg #' @export model_parameters.draws <- function(model, centrality = "median", diff --git a/R/methods_rstanarm.R b/R/methods_rstanarm.R index 625e2b68b..50af6d454 100644 --- a/R/methods_rstanarm.R +++ b/R/methods_rstanarm.R @@ -33,19 +33,21 @@ #' @inheritParams bayestestR::describe_posterior #' @inheritParams insight::get_parameters #' -#' @seealso [insight::standardize_names()] to -#' rename columns into a consistent, standardized naming scheme. +#' @seealso [insight::standardize_names()] to rename columns into a consistent, +#' standardized naming scheme. #' -#' @note When `standardize = "refit"`, columns `diagnostic`, -#' `bf_prior` and `priors` refer to the *original* -#' `model`. If `model` is a data frame, arguments `diagnostic`, -#' `bf_prior` and `priors` are ignored. \cr \cr There is also a -#' [`plot()`-method](https://easystats.github.io/see/articles/parameters.html) -#' implemented in the -#' [**see**-package](https://easystats.github.io/see/). +#' @note When `standardize = "refit"`, columns `diagnostic`, `bf_prior` and +#' `priors` refer to the *original* `model`. If `model` is a data frame, +#' arguments `diagnostic`, `bf_prior` and `priors` are ignored. +#' +#' There is also a +#' [`plot()`-method](https://easystats.github.io/see/articles/parameters.html) +#' implemented in the [**see**-package](https://easystats.github.io/see/). #' #' @inheritSection model_parameters Confidence intervals and approximation of degrees of freedom #' +#' @inheritSection model_parameters.zcpglm Model components +#' #' @examples #' \donttest{ #' library(parameters) diff --git a/R/utils_model_parameters.R b/R/utils_model_parameters.R index 4896982c1..2ae4c0efc 100644 --- a/R/utils_model_parameters.R +++ b/R/utils_model_parameters.R @@ -458,7 +458,7 @@ not_allowed_string <- datawizard::text_concatenate(not_allowed, enclose = "\"") insight::format_alert( sprintf("Following arguments are not supported in `%s()` for models of class `%s` and will be ignored: %s", function_name, model_class, not_allowed_string), # nolint - sprintf("Please run `%s()` again without specifying the above mentioned arguments to obtain expected results.", function_name) # nolint + sprintf("In case you obtain expected results, please run `%s()` again without specifying the above mentioned arguments.", function_name) # nolint ) } dots[not_allowed] <- NULL diff --git a/man/model_parameters.Rd b/man/model_parameters.Rd index 22386cf97..4c57e319e 100644 --- a/man/model_parameters.Rd +++ b/man/model_parameters.Rd @@ -40,8 +40,9 @@ the model-specific documentation: \item \link[=model_parameters.default]{Default method}: \code{lm}, \code{glm}, \strong{stats}, \strong{censReg}, \strong{MASS}, \strong{survey}, ... \item \link[=model_parameters.cgam]{Additive models}: \strong{bamlss}, \strong{gamlss}, \strong{mgcv}, -\strong{scam}, \strong{VGAM}, \code{Gam}, \code{gamm}, ... -\item \link[=model_parameters.aov]{ANOVA}: \strong{afex}, \code{aov}, \code{anova}, ... +\strong{scam}, \strong{VGAM}, \code{Gam} (although the output of \code{Gam} is more Anova-alike), +\code{gamm}, ... +\item \link[=model_parameters.aov]{ANOVA}: \strong{afex}, \code{aov}, \code{anova}, \code{Gam}, ... \item \link[=model_parameters.stanreg]{Bayesian}: \strong{BayesFactor}, \strong{blavaan}, \strong{brms}, \strong{MCMCglmm}, \strong{posterior}, \strong{rstanarm}, \code{bayesQR}, \code{bcplm}, \code{BGGM}, \code{blmrm}, \code{blrm}, \code{mcmc.list}, \code{MCMCglmm}, ... diff --git a/man/model_parameters.glimML.Rd b/man/model_parameters.glimML.Rd index 0e9a625db..ad53307e7 100644 --- a/man/model_parameters.glimML.Rd +++ b/man/model_parameters.glimML.Rd @@ -34,10 +34,10 @@ case of bootstrapped frequentist models.} \item{component}{Model component for which parameters should be shown. May be -one of \code{"conditional"}, \code{"precision"} (\strong{betareg}), -\code{"scale"} (\strong{ordinal}), \code{"extra"} (\strong{glmx}), -\code{"marginal"} (\strong{mfx}), \code{"conditional"} or \code{"full"} (for -\code{MuMIn::model.avg()}) or \code{"all"}.} +one of \code{"conditional"}, \code{"precision"} (e.g. \strong{betareg}), \code{"scale"} (e.g. +\strong{ordinal}), \code{"extra"} (e.g. \strong{glmx}), \code{"marginal"} (e.g. \strong{mfx}), +\code{"conditional"} or \code{"full"} (for \code{MuMIn::model.avg()}) or \code{"all"}. See section +\emph{Model components} for an overview of possible options for \code{component}.} \item{standardize}{The method used for standardizing the parameters. Can be \code{NULL} (default; no standardization), \code{"refit"} (for re-fitting the model @@ -134,8 +134,53 @@ for all studies. Else, only parameters for overall-effects are shown.} A data frame of indices related to the model's parameters. } \description{ -Parameters from special regression models not listed under one of the previous categories yet. +Parameters from special regression models not listed under one of the +previous categories yet. } +\section{Model components}{ + +Possible values for the \code{component} argument depend on the model class. +Following are valid options: +\itemize{ +\item \code{"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. +\item \code{"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. +\item \code{"smooth_terms"}: returns smooth terms, only applies to GAMs (or similar +models that may contain smooth terms). +\item \code{"zero_inflated"} (or \code{"zi"}): returns the zero-inflation component. +\item \code{"dispersion"}: returns the dispersion model component. This is common +for models with zero-inflation or that can model the dispersion parameter. +\item \code{"instruments"}: for instrumental-variable or some fixed effects regression, +returns the instruments. +\item \code{"nonlinear"}: for non-linear models (like models of class \code{nlmerMod} or +\code{nls}), returns staring estimates for the nonlinear parameters. +\item \code{"correlation"}: for models with correlation-component, like \code{gls}, the +variables used to describe the correlation structure are returned. +} + +\strong{Special models} + +Some model classes also allow rather uncommon options. These are: +\itemize{ +\item \strong{mhurdle}: \code{"infrequent_purchase"}, \code{"ip"}, and \code{"auxiliary"} +\item \strong{BGGM}: \code{"correlation"} and \code{"intercept"} +\item \strong{BFBayesFactor}, \strong{glmx}: \code{"extra"} +\item \strong{averaging}:\code{"conditional"} and \code{"full"} +\item \strong{mjoint}: \code{"survival"} +\item \strong{mfx}: \code{"precision"}, \code{"marginal"} +\item \strong{betareg}, \strong{DirichletRegModel}: \code{"precision"} +\item \strong{mvord}: \code{"thresholds"} and \code{"correlation"} +\item \strong{clm2}: \code{"scale"} +\item \strong{selection}: \code{"selection"}, \code{"outcome"}, and \code{"auxiliary"} +} + +For models of class \code{brmsfit} (package \strong{brms}), even more options are +possible for the \code{component} argument, which are not all documented in detail +here. +} + \examples{ library(parameters) if (require("brglm2", quietly = TRUE)) { @@ -150,6 +195,6 @@ if (require("brglm2", quietly = TRUE)) { } } \seealso{ -\code{\link[insight:standardize_names]{insight::standardize_names()}} to rename -columns into a consistent, standardized naming scheme. +\code{\link[insight:standardize_names]{insight::standardize_names()}} to rename columns into a consistent, +standardized naming scheme. } diff --git a/man/model_parameters.glmmTMB.Rd b/man/model_parameters.glmmTMB.Rd index 799cc8704..527fb6eb2 100644 --- a/man/model_parameters.glmmTMB.Rd +++ b/man/model_parameters.glmmTMB.Rd @@ -302,9 +302,9 @@ Some model classes also allow rather uncommon options. These are: \item \strong{selection}: \code{"selection"}, \code{"outcome"}, and \code{"auxiliary"} } -For models of class \code{brmsfit} (package \strong{brms}), \code{component}, even more -options are possible for the \code{component} argument, which are not all -documented in detail here. +For models of class \code{brmsfit} (package \strong{brms}), even more options are +possible for the \code{component} argument, which are not all documented in detail +here. } \section{Confidence intervals and approximation of degrees of freedom}{ diff --git a/man/model_parameters.mlm.Rd b/man/model_parameters.mlm.Rd index f5d4f0c43..3d46a9385 100644 --- a/man/model_parameters.mlm.Rd +++ b/man/model_parameters.mlm.Rd @@ -246,9 +246,9 @@ Some model classes also allow rather uncommon options. These are: \item \strong{selection}: \code{"selection"}, \code{"outcome"}, and \code{"auxiliary"} } -For models of class \code{brmsfit} (package \strong{brms}), \code{component}, even more -options are possible for the \code{component} argument, which are not all -documented in detail here. +For models of class \code{brmsfit} (package \strong{brms}), even more options are +possible for the \code{component} argument, which are not all documented in detail +here. } \examples{ diff --git a/man/model_parameters.stanreg.Rd b/man/model_parameters.stanreg.Rd index 7ea0a94bc..54558a6f7 100644 --- a/man/model_parameters.stanreg.Rd +++ b/man/model_parameters.stanreg.Rd @@ -1,79 +1,9 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/methods_MCMCglmm.R, R/methods_base.R, -% R/methods_brms.R, R/methods_posterior.R, R/methods_rstanarm.R -\name{model_parameters.MCMCglmm} -\alias{model_parameters.MCMCglmm} -\alias{model_parameters.data.frame} -\alias{model_parameters.brmsfit} -\alias{model_parameters.draws} +% Please edit documentation in R/methods_rstanarm.R +\name{model_parameters.stanreg} \alias{model_parameters.stanreg} \title{Parameters from Bayesian Models} \usage{ -\method{model_parameters}{MCMCglmm}( - model, - centrality = "median", - dispersion = FALSE, - ci = 0.95, - ci_method = "eti", - test = "pd", - rope_range = "default", - rope_ci = 0.95, - bf_prior = NULL, - diagnostic = c("ESS", "Rhat"), - priors = TRUE, - keep = NULL, - drop = NULL, - verbose = TRUE, - ... -) - -\method{model_parameters}{data.frame}( - model, - as_draws = FALSE, - exponentiate = FALSE, - verbose = TRUE, - ... -) - -\method{model_parameters}{brmsfit}( - model, - centrality = "median", - dispersion = FALSE, - ci = 0.95, - ci_method = "eti", - test = "pd", - rope_range = "default", - rope_ci = 0.95, - bf_prior = NULL, - diagnostic = c("ESS", "Rhat"), - priors = FALSE, - effects = "fixed", - component = "all", - exponentiate = FALSE, - standardize = NULL, - group_level = FALSE, - keep = NULL, - drop = NULL, - verbose = TRUE, - ... -) - -\method{model_parameters}{draws}( - model, - centrality = "median", - dispersion = FALSE, - ci = 0.95, - ci_method = "eti", - test = "pd", - rope_range = "default", - rope_ci = 0.95, - exponentiate = FALSE, - keep = NULL, - drop = NULL, - verbose = TRUE, - ... -) - \method{model_parameters}{stanreg}( model, centrality = "median", @@ -148,6 +78,47 @@ with one or more of these options: \code{"ESS"}, \code{"Rhat"}, \code{"MCSE"} or \item{priors}{Add the prior used for each parameter.} +\item{effects}{Should results for fixed effects, random effects or both be +returned? Only applies to mixed models. May be abbreviated.} + +\item{exponentiate}{Logical, indicating whether or not to exponentiate the +coefficients (and related confidence intervals). This is typical for +logistic regression, or more generally speaking, for models with log or +logit links. It is also recommended to use \code{exponentiate = TRUE} for models +with log-transformed response values. For models with a log-transformed +response variable, when \code{exponentiate = TRUE}, a one-unit increase in the +predictor is associated with multiplying the outcome by that predictor's +coefficient. \strong{Note:} Delta-method standard errors are also computed (by +multiplying the standard errors by the transformed coefficients). This is +to mimic behaviour of other software packages, such as Stata, but these +standard errors poorly estimate uncertainty for the transformed +coefficient. The transformed confidence interval more clearly captures this +uncertainty. For \code{compare_parameters()}, \code{exponentiate = "nongaussian"} +will only exponentiate coefficients from non-Gaussian families.} + +\item{standardize}{The method used for standardizing the parameters. Can be +\code{NULL} (default; no standardization), \code{"refit"} (for re-fitting the model +on standardized data) or one of \code{"basic"}, \code{"posthoc"}, \code{"smart"}, +\code{"pseudo"}. See 'Details' in \code{\link[=standardize_parameters]{standardize_parameters()}}. +\strong{Importantly}: +\itemize{ +\item The \code{"refit"} method does \emph{not} standardize categorical predictors (i.e. +factors), which may be a different behaviour compared to other R packages +(such as \strong{lm.beta}) or other software packages (like SPSS). to mimic +such behaviours, either use \code{standardize="basic"} or standardize the data +with \code{datawizard::standardize(force=TRUE)} \emph{before} fitting the model. +\item For mixed models, when using methods other than \code{"refit"}, only the fixed +effects will be standardized. +\item Robust estimation (i.e., \code{vcov} set to a value other than \code{NULL}) of +standardized parameters only works when \code{standardize="refit"}. +}} + +\item{group_level}{Logical, for multilevel models (i.e. models with random +effects) and when \code{effects = "all"} or \code{effects = "random"}, +include the parameters for each group level from random effects. If +\code{group_level = FALSE} (the default), only information on SD and COR +are shown.} + \item{keep}{Character containing a regular expression pattern that describes the parameters that should be included (for \code{keep}) or excluded (for \code{drop}) in the returned data frame. \code{keep} may also be a @@ -170,32 +141,27 @@ names.} \item{drop}{See \code{keep}.} -\item{verbose}{Toggle messages and warnings.} - -\item{...}{Currently not used.} +\item{verbose}{Toggle warnings and messages.} -\item{as_draws}{Logical, if \code{TRUE} and \code{model} is of class \code{data.frame}, -the data frame is treated as posterior samples and handled similar to -Bayesian models. All arguments in \code{...} are passed to -\code{model_parameters.draws()}.} - -\item{exponentiate}{Logical, indicating whether or not to exponentiate the -coefficients (and related confidence intervals). This is typical for -logistic regression, or more generally speaking, for models with log or -logit links. It is also recommended to use \code{exponentiate = TRUE} for models -with log-transformed response values. For models with a log-transformed -response variable, when \code{exponentiate = TRUE}, a one-unit increase in the -predictor is associated with multiplying the outcome by that predictor's -coefficient. \strong{Note:} Delta-method standard errors are also computed (by -multiplying the standard errors by the transformed coefficients). This is -to mimic behaviour of other software packages, such as Stata, but these -standard errors poorly estimate uncertainty for the transformed -coefficient. The transformed confidence interval more clearly captures this -uncertainty. For \code{compare_parameters()}, \code{exponentiate = "nongaussian"} -will only exponentiate coefficients from non-Gaussian families.} +\item{...}{Arguments passed to or from other methods. For instance, when +\code{bootstrap = TRUE}, arguments like \code{type} or \code{parallel} are passed down to +\code{bootstrap_model()}. -\item{effects}{Should results for fixed effects, random effects or both be -returned? Only applies to mixed models. May be abbreviated.} +Further non-documented arguments are: +\itemize{ +\item \code{digits}, \code{p_digits}, \code{ci_digits} and \code{footer_digits} to set the number of +digits for the output. \code{groups} can be used to group coefficients. These +arguments will be passed to the print-method, or can directly be used in +\code{print()}, see documentation in \code{\link[=print.parameters_model]{print.parameters_model()}}. +\item If \code{s_value = TRUE}, the p-value will be replaced by the S-value in the +output (cf. \emph{Rafi and Greenland 2020}). +\item \code{pd} adds an additional column with the \emph{probability of direction} (see +\code{\link[bayestestR:p_direction]{bayestestR::p_direction()}} for details). Furthermore, see 'Examples' for +this function. +\item For developers, whose interest mainly is to get a "tidy" data frame of +model summaries, it is recommended to set \code{pretty_names = FALSE} to speed +up computation of the summary table. +}} \item{component}{Which type of parameters to return, such as parameters for the conditional model, the zero-inflation part of the model, the dispersion @@ -211,28 +177,10 @@ argument - but no auxiliary parameters). For \code{component = "distributional"} (or \code{"auxiliary"}), components like \code{sigma}, \code{dispersion}, or \code{beta} (and other auxiliary parameters) are returned.} -\item{standardize}{The method used for standardizing the parameters. Can be -\code{NULL} (default; no standardization), \code{"refit"} (for re-fitting the model -on standardized data) or one of \code{"basic"}, \code{"posthoc"}, \code{"smart"}, -\code{"pseudo"}. See 'Details' in \code{\link[=standardize_parameters]{standardize_parameters()}}. -\strong{Importantly}: -\itemize{ -\item The \code{"refit"} method does \emph{not} standardize categorical predictors (i.e. -factors), which may be a different behaviour compared to other R packages -(such as \strong{lm.beta}) or other software packages (like SPSS). to mimic -such behaviours, either use \code{standardize="basic"} or standardize the data -with \code{datawizard::standardize(force=TRUE)} \emph{before} fitting the model. -\item For mixed models, when using methods other than \code{"refit"}, only the fixed -effects will be standardized. -\item Robust estimation (i.e., \code{vcov} set to a value other than \code{NULL}) of -standardized parameters only works when \code{standardize="refit"}. -}} - -\item{group_level}{Logical, for multilevel models (i.e. models with random -effects) and when \code{effects = "all"} or \code{effects = "random"}, -include the parameters for each group level from random effects. If -\code{group_level = FALSE} (the default), only information on SD and COR -are shown.} +\item{as_draws}{Logical, if \code{TRUE} and \code{model} is of class \code{data.frame}, +the data frame is treated as posterior samples and handled similar to +Bayesian models. All arguments in \code{...} are passed to +\code{model_parameters.draws()}.} } \value{ A data frame of indices related to the model's parameters. @@ -241,13 +189,13 @@ A data frame of indices related to the model's parameters. Parameters from Bayesian models. } \note{ -When \code{standardize = "refit"}, columns \code{diagnostic}, -\code{bf_prior} and \code{priors} refer to the \emph{original} -\code{model}. If \code{model} is a data frame, arguments \code{diagnostic}, -\code{bf_prior} and \code{priors} are ignored. \cr \cr There is also a +When \code{standardize = "refit"}, columns \code{diagnostic}, \code{bf_prior} and +\code{priors} refer to the \emph{original} \code{model}. If \code{model} is a data frame, +arguments \code{diagnostic}, \code{bf_prior} and \code{priors} are ignored. + +There is also a \href{https://easystats.github.io/see/articles/parameters.html}{\code{plot()}-method} -implemented in the -\href{https://easystats.github.io/see/}{\strong{see}-package}. +implemented in the \href{https://easystats.github.io/see/}{\strong{see}-package}. } \section{Confidence intervals and approximation of degrees of freedom}{ @@ -415,6 +363,50 @@ p-values are based on the probability of direction (\code{\link[bayestestR:p_dir which is converted into a p-value using \code{\link[bayestestR:pd_to_p]{bayestestR::pd_to_p()}}. } +\section{Model components}{ + +Possible values for the \code{component} argument depend on the model class. +Following are valid options: +\itemize{ +\item \code{"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. +\item \code{"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. +\item \code{"smooth_terms"}: returns smooth terms, only applies to GAMs (or similar +models that may contain smooth terms). +\item \code{"zero_inflated"} (or \code{"zi"}): returns the zero-inflation component. +\item \code{"dispersion"}: returns the dispersion model component. This is common +for models with zero-inflation or that can model the dispersion parameter. +\item \code{"instruments"}: for instrumental-variable or some fixed effects regression, +returns the instruments. +\item \code{"nonlinear"}: for non-linear models (like models of class \code{nlmerMod} or +\code{nls}), returns staring estimates for the nonlinear parameters. +\item \code{"correlation"}: for models with correlation-component, like \code{gls}, the +variables used to describe the correlation structure are returned. +} + +\strong{Special models} + +Some model classes also allow rather uncommon options. These are: +\itemize{ +\item \strong{mhurdle}: \code{"infrequent_purchase"}, \code{"ip"}, and \code{"auxiliary"} +\item \strong{BGGM}: \code{"correlation"} and \code{"intercept"} +\item \strong{BFBayesFactor}, \strong{glmx}: \code{"extra"} +\item \strong{averaging}:\code{"conditional"} and \code{"full"} +\item \strong{mjoint}: \code{"survival"} +\item \strong{mfx}: \code{"precision"}, \code{"marginal"} +\item \strong{betareg}, \strong{DirichletRegModel}: \code{"precision"} +\item \strong{mvord}: \code{"thresholds"} and \code{"correlation"} +\item \strong{clm2}: \code{"scale"} +\item \strong{selection}: \code{"selection"}, \code{"outcome"}, and \code{"auxiliary"} +} + +For models of class \code{brmsfit} (package \strong{brms}), even more options are +possible for the \code{component} argument, which are not all documented in detail +here. +} + \examples{ \donttest{ library(parameters) @@ -428,6 +420,6 @@ if (require("rstanarm")) { } } \seealso{ -\code{\link[insight:standardize_names]{insight::standardize_names()}} to -rename columns into a consistent, standardized naming scheme. +\code{\link[insight:standardize_names]{insight::standardize_names()}} to rename columns into a consistent, +standardized naming scheme. } diff --git a/man/model_parameters.zcpglm.Rd b/man/model_parameters.zcpglm.Rd index fa216f1b3..8868831c0 100644 --- a/man/model_parameters.zcpglm.Rd +++ b/man/model_parameters.zcpglm.Rd @@ -173,9 +173,9 @@ Some model classes also allow rather uncommon options. These are: \item \strong{selection}: \code{"selection"}, \code{"outcome"}, and \code{"auxiliary"} } -For models of class \code{brmsfit} (package \strong{brms}), \code{component}, even more -options are possible for the \code{component} argument, which are not all -documented in detail here. +For models of class \code{brmsfit} (package \strong{brms}), even more options are +possible for the \code{component} argument, which are not all documented in detail +here. } \examples{ diff --git a/pkgdown/_pkgdown.yml b/pkgdown/_pkgdown.yml index 463ff250c..963d63490 100644 --- a/pkgdown/_pkgdown.yml +++ b/pkgdown/_pkgdown.yml @@ -10,6 +10,15 @@ reference: - compare_parameters - dominance_analysis - model_parameters + - pool_parameters + - random_parameters + - print.parameters_model + - sort_parameters + - standardize_parameters + - standardize_info + + - title: "Documentation of Specific Class Objects" + contents: - model_parameters.aov - model_parameters.befa - model_parameters.default @@ -30,12 +39,6 @@ reference: - model_parameters.glht - model_parameters.averaging - model_parameters.t1way - - pool_parameters - - random_parameters - - print.parameters_model - - sort_parameters - - standardize_parameters - - standardize_info - title: "Standard Errors, Confidence Intervals, Degrees of Freedom and p-values" contents: