Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Jul 23, 2024
1 parent 9403627 commit 0e4c87f
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 59 deletions.
44 changes: 18 additions & 26 deletions R/methods_mice.R
Original file line number Diff line number Diff line change
Expand Up @@ -140,41 +140,33 @@ model_parameters.mipo <- function(model,
#' similar to `summary(mice::pool())`, i.e. it generates the pooled summary
#' of multiple imputed repeated regression analyses.
#'
#' @examples
#' @examplesIf require("mice", quietly = TRUE) && require("gee", quietly = TRUE)
#' library(parameters)
#' if (require("mice", quietly = TRUE)) {
#' data(nhanes2)
#' imp <- mice(nhanes2)
#' fit <- with(data = imp, exp = lm(bmi ~ age + hyp + chl))
#' model_parameters(fit)
#' }
#' data(nhanes2, package = "mice")
#' imp <- mice::mice(nhanes2)
#' fit <- with(data = imp, exp = lm(bmi ~ age + hyp + chl))
#' model_parameters(fit)
#' \donttest{
#' # model_parameters() also works for models that have no "tidy"-method in mice
#' if (require("mice", quietly = TRUE) && require("gee", quietly = TRUE)) {
#' data(warpbreaks)
#' set.seed(1234)
#' warpbreaks$tension[sample(1:nrow(warpbreaks), size = 10)] <- NA
#' imp <- mice(warpbreaks)
#' fit <- with(data = imp, expr = gee(breaks ~ tension, id = wool))
#' data(warpbreaks, package = "gee")
#' set.seed(1234)
#' warpbreaks$tension[sample(1:nrow(warpbreaks), size = 10)] <- NA
#' imp <- mice::mice(warpbreaks)
#' fit <- with(data = imp, expr = gee::gee(breaks ~ tension, id = wool))
#'
#' # does not work:
#' # summary(pool(fit))
#' # does not work:
#' # summary(mice::pool(fit))
#'
#' model_parameters(fit)
#' }
#' model_parameters(fit)
#' }
#'
#'
#'
#' # and it works with pooled results
#' if (require("mice")) {
#' data("nhanes2")
#' imp <- mice(nhanes2)
#' fit <- with(data = imp, exp = lm(bmi ~ age + hyp + chl))
#' pooled <- pool(fit)
#' data("nhanes2", package = "mice")
#' imp <- mice::mice(nhanes2)
#' fit <- with(data = imp, exp = lm(bmi ~ age + hyp + chl))
#' pooled <- mice::pool(fit)
#'
#' model_parameters(pooled)
#' }
#' model_parameters(pooled)
#' @export
model_parameters.mira <- function(model,
ci = 0.95,
Expand Down
7 changes: 3 additions & 4 deletions man/ci.default.Rd

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

44 changes: 19 additions & 25 deletions man/model_parameters.mira.Rd

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

7 changes: 3 additions & 4 deletions man/p_value.Rd

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

0 comments on commit 0e4c87f

Please sign in to comment.