Skip to content

Commit

Permalink
doc cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Jun 12, 2024
1 parent cf8b824 commit 9f475f7
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 39 deletions.
34 changes: 14 additions & 20 deletions R/select_parameters.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,29 @@
#' @param model A statistical model (of class `lm`, `glm`, or `merMod`).
#' @param ... Arguments passed to or from other methods.
#'
#' @details
#' \subsection{Classical lm and glm}{
#' For frequentist GLMs, `select_parameters()` performs an AIC-based
#' stepwise selection.
#' }
#' @section Classical lm and glm:
#' For frequentist GLMs, `select_parameters()` performs an AIC-based stepwise
#' selection.
#'
#' \subsection{Mixed models}{
#' For mixed-effects models of class `merMod`, stepwise selection is
#' based on [cAIC4::stepcAIC()]. This step function
#' only searches the "best" model based on the random-effects structure,
#' i.e. `select_parameters()` adds or excludes random-effects until
#' the cAIC can't be improved further.
#' }
#' @section Mixed models:
#' For mixed-effects models of class `merMod`, stepwise selection is based on
#' [`cAIC4::stepcAIC()`]. This step function only searches the "best" model
#' based on the random-effects structure, i.e. `select_parameters()` adds or
#' excludes random-effects until the cAIC can't be improved further.
#'
#' @examples
#' @examplesIf requireNamespace("lme4")
#' model <- lm(mpg ~ ., data = mtcars)
#' select_parameters(model)
#'
#' model <- lm(mpg ~ cyl * disp * hp * wt, data = mtcars)
#' select_parameters(model)
#' \donttest{
#' # lme4 -------------------------------------------
#' if (require("lme4")) {
#' model <- lmer(
#' Sepal.Width ~ Sepal.Length * Petal.Width * Petal.Length + (1 | Species),
#' data = iris
#' )
#' select_parameters(model)
#' }
#' model <- lme4::lmer(
#' Sepal.Width ~ Sepal.Length * Petal.Width * Petal.Length + (1 | Species),
#' data = iris
#' )
#' select_parameters(model)
#' }
#'
#' @return The model refitted with optimal number of parameters.
Expand Down
37 changes: 18 additions & 19 deletions man/select_parameters.Rd

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

0 comments on commit 9f475f7

Please sign in to comment.