Skip to content

Commit

Permalink
model_paramaters with exponentiate = TRUE not working with bootstrapp…
Browse files Browse the repository at this point in the history
…ed object from bootstrap_model

Fixes #1004
  • Loading branch information
strengejacke committed Aug 21, 2024
1 parent 2e2ce84 commit 8d44cd8
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 16 deletions.
8 changes: 6 additions & 2 deletions R/methods_base.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
#' @rdname model_parameters.stanreg
#' @export
model_parameters.data.frame <- function(model, as_draws = FALSE, verbose = TRUE, ...) {
model_parameters.data.frame <- function(model,
as_draws = FALSE,
exponentiate = FALSE,
verbose = TRUE,
...) {
# treat data frame as bootstraps/posteriors?
if (isTRUE(as_draws)) {
return(model_parameters.draws(model, verbose = verbose, ...))
return(model_parameters.draws(model, exponentiate = exponentiate, verbose = verbose, ...))
}
if (isTRUE(verbose)) {
insight::format_warning(
Expand Down
4 changes: 4 additions & 0 deletions R/methods_posterior.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ model_parameters.draws <- function(model,
test = "pd",
rope_range = "default",
rope_ci = 0.95,
exponentiate = FALSE,
keep = NULL,
drop = NULL,
verbose = TRUE,
Expand All @@ -33,6 +34,9 @@ model_parameters.draws <- function(model,
...
)

# exponentiate coefficients and SE/CI, if requested
params <- .exponentiate_parameters(params)

attr(params, "ci") <- ci
attr(params, "object_name") <- insight::safe_deparse_symbol(substitute(model))
class(params) <- c("parameters_model", "see_parameters_model", class(params))
Expand Down
35 changes: 21 additions & 14 deletions man/model_parameters.stanreg.Rd

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

0 comments on commit 8d44cd8

Please sign in to comment.