Skip to content

Commit

Permalink
lil update
Browse files Browse the repository at this point in the history
  • Loading branch information
ddsjoberg committed Apr 21, 2024
1 parent 5b309a5 commit d50e4e1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions R/ard_emmeans_mean_difference.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#' @inheritParams construct_model
#' @param response_type (`string`)
#' string indicating whether the model outcome is `'continuous'`
#' or `'binary'`. When `'binary'`, the call to `emmeans::emmeans()` is
#' or `'dichotomous'`. When `'dichotomous'`, the call to `emmeans::emmeans()` is
#' supplemented with argument `regrid="response"`.
#' @param conf.level (scalar `numeric`)\cr
#' confidence level for confidence interval. Default is `0.95`.
Expand All @@ -41,12 +41,12 @@
#' formula = vs ~ am + mpg,
#' method = "glm",
#' method.args = list(family = binomial),
#' response_type = "binary"
#' response_type = "dichotomous"
#' )
ard_emmeans_mean_difference <- function(data, formula, method,
method.args = list(),
package = "base",
response_type = c("continuous", "binary"),
response_type = c("continuous", "dichotomous"),
conf.level = 0.95,
primary_covariate =
stats::terms(formula) |>
Expand Down Expand Up @@ -77,7 +77,7 @@ ard_emmeans_mean_difference <- function(data, formula, method,

# emmeans --------------------------------------------------------------------
emmeans_args <- list(object = mod, specs = reformulate2(primary_covariate))
if (response_type %in% "binary") emmeans_args <- c(emmeans_args, list(regrid = "response"))
if (response_type %in% "dichotomous") emmeans_args <- c(emmeans_args, list(regrid = "response"))
emmeans <-
withr::with_namespace(
package = "emmeans",
Expand Down
6 changes: 3 additions & 3 deletions man/ard_emmeans_mean_difference.Rd

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

4 changes: 2 additions & 2 deletions tests/testthat/test-ard_emmeans_mean_difference.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ test_that("ard_emmeans_mean_difference() works", {
formula = vs ~ am + mpg,
method = "glm",
method.args = list(family = binomial),
response_type = "binary"
response_type = "dichotomous"
),
NA
)
Expand Down Expand Up @@ -36,7 +36,7 @@ test_that("ard_emmeans_mean_difference() works", {
method = "glmer",
method.args = list(family = binomial),
package = "lme4",
response_type = "binary"
response_type = "dichotomous"
),
NA
)
Expand Down

0 comments on commit d50e4e1

Please sign in to comment.