Skip to content

Commit

Permalink
allow 'parametric' (ignored) in tidy.stanreg (fixes #153)
Browse files Browse the repository at this point in the history
  • Loading branch information
bbolker committed Oct 27, 2024
1 parent 8402765 commit 91f4d9a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ Suggests:
MCMCglmm,
mediation,
mgcv,
mice,
ordinal,
pander,
pbkrtest,
Expand Down
3 changes: 2 additions & 1 deletion R/rstanarm_tidiers.R
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,8 @@ tidy.stanreg <- function(x,
conf.method=c("quantile","HPDinterval"),
exponentiate = FALSE,
...) {
check_dots(...)
## ignore 'parametric', which may be passed by mice:::summary.mira()
check_dots(..., .ignore = "parametric")
conf.method <- match.arg(conf.method)
std.error <- estimate <- NULL ## fool code checker/NSE
miss_effects <- missing(effects)
Expand Down
16 changes: 15 additions & 1 deletion tests/testthat/test-rstanarm.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,19 @@ if (suppressPackageStartupMessages(require(rstanarm, quietly = TRUE))) {
expect_equal(td1e$conf.high, exp(td1$conf.high))
expect_equal(td1e$std.error, exp(td1$estimate)*td1$std.error)
})


## GH 153
if (requireNamespace("mice", quietly = TRUE)) {
test_that("mice imputed data", {
data(nhanes)
imp <- mice(nhanes, m = 3, print = FALSE)
suppressWarnings(
capture.output(ms <- with(imp,
stan_glm(age ~ bmi + chl)))
)
expect_is(summary(pool(ms)), "mipo.summary")
})
}

} ## rstanarm available

0 comments on commit 91f4d9a

Please sign in to comment.