Skip to content

Commit

Permalink
#688 move to WIP for now
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Apr 4, 2022
1 parent 1031a7f commit d486ff7
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 65 deletions.
1 change: 0 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ Suggests:
poorman,
posterior,
PROreg,
projpred,
pscl,
psych,
pvclust,
Expand Down
2 changes: 0 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -581,10 +581,8 @@ S3method(reshape_loadings,parameters_efa)
S3method(se_satterthwaite,default)
S3method(se_satterthwaite,gls)
S3method(se_satterthwaite,lme)
S3method(select_parameters,brmsfit)
S3method(select_parameters,lm)
S3method(select_parameters,merMod)
S3method(select_parameters,stanreg)
S3method(simulate_model,LORgee)
S3method(simulate_model,MixMod)
S3method(simulate_model,betamfx)
Expand Down
26 changes: 1 addition & 25 deletions R/select_parameters.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
#' This function performs an automated selection of the 'best' parameters,
#' updating and returning the "best" model.
#'
#' @param model A statistical model (of class `lm`, `glm`,
#' `merMod`, `stanreg` or `brmsfit`).
#' @param model A statistical model (of class `lm`, `glm`, or `merMod`).
#' @param ... Arguments passed to or from other methods.
#'
#' @details
Expand All @@ -21,10 +20,6 @@
#' the cAIC can't be improved further.
#' }
#'
#' \subsection{Bayesian models}{
#' For Bayesian models, it uses the **projpred** package.
#' }
#'
#' @examples
#' model <- lm(mpg ~ ., data = mtcars)
#' select_parameters(model)
Expand All @@ -42,25 +37,6 @@
#' }
#' }
#'
#' \dontrun{
#' # rstanarm -------------------------------------------
#' if (require("rstanarm") && require("projpred")) {
#' model <- stan_glm(
#' mpg ~ .,
#' data = mtcars,
#' iter = 500, refresh = 0, verbose = FALSE
#' )
#' select_parameters(model, cross_validation = TRUE)
#'
#' model <- stan_glm(
#' mpg ~ cyl * disp * hp,
#' data = mtcars,
#' iter = 500, refresh = 0, verbose = FALSE
#' )
#' select_parameters(model, cross_validation = FALSE)
#' }
#' }
#'
#' @return The model refitted with optimal number of parameters.
#' @export
select_parameters <- function(model, ...) {
Expand Down
File renamed without changes.
37 changes: 2 additions & 35 deletions man/select_parameters.Rd

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

4 changes: 2 additions & 2 deletions vignettes/parameters_selection.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,13 @@ and should not be used in place of **theoretical** or **hypothetical** reasons
(*i.e.*, you should have *a priori* hypotheses about which parameters of your
model you want to focus on).

## Mixed and Bayesian models
## Mixed models

For simple linear regressions as above, the selection is made using the `step()`
function (available in base R). This performs a
[**stepwise**](https://en.wikipedia.org/wiki/Stepwise_regression) selection.
However, this procedures is not available for other types of models, such as
**mixed** or **Bayesian** models.
**mixed** models.

### Mixed models

Expand Down

0 comments on commit d486ff7

Please sign in to comment.