diff --git a/DESCRIPTION b/DESCRIPTION index b3c8fdee2..a9f38f15d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: modelbased Title: Estimation of Model-Based Predictions, Contrasts and Means -Version: 0.17.0.18 +Version: 0.17.0.19 Authors@R: c(person(given = "Dominique", family = "Makowski", diff --git a/R/estimate_predicted.R b/R/estimate_predicted.R index dffd9d318..55866938a 100644 --- a/R/estimate_predicted.R +++ b/R/estimate_predicted.R @@ -564,7 +564,9 @@ estimate_relation <- function( out$Residuals <- response - out$Predicted } - # transform reponse? + # transform response? we keep the argument as passed by the user for the + # table footer + transform_arg <- transform if (isTRUE(transform)) { trans_fun <- insight::get_transformation(model, verbose = FALSE)$inverse } else { @@ -582,8 +584,7 @@ estimate_relation <- function( attr(out, "iterations") <- iterations attr(out, "keep_iterations") <- keep_iterations attr(out, "response") <- model_response - attr(out, "transform") <- !is.null(transform) - attr(out, "transform_arg") <- transform + attr(out, "transform") <- transform_arg attr(out, "model") <- model attr(out, "datagrid") <- data attr(out, "focal_terms") <- grid_specs$at_specs$varname @@ -603,8 +604,7 @@ estimate_relation <- function( # attributes in `grid_specs`, so we replace them with those of this call footer_info <- grid_specs footer_info$predict <- predict - footer_info$transform <- !is.null(transform) - footer_info$transform_arg <- transform + footer_info$transform <- transform_arg footer_info$predict_used <- footer_predict attr(out, "table_footer") <- .table_footer( out, @@ -616,7 +616,7 @@ estimate_relation <- function( attributes(out) <- c( attributes(out), - grid_specs[!names(grid_specs) %in% c(names(attributes(out)), "transform_arg")] + grid_specs[!names(grid_specs) %in% names(attributes(out))] ) # Class diff --git a/R/get_marginalcontrasts.R b/R/get_marginalcontrasts.R index 70ae023df..8b3a281cc 100644 --- a/R/get_marginalcontrasts.R +++ b/R/get_marginalcontrasts.R @@ -184,7 +184,6 @@ get_marginalcontrasts <- function( contrast = my_args$contrast, predict = predict, transform = transform, - transform_arg = transform, comparison = my_args$comparison, estimate = estimate, p_adjust = p_adjust, diff --git a/R/get_marginalmeans.R b/R/get_marginalmeans.R index 4138f5ed0..0839abd1a 100644 --- a/R/get_marginalmeans.R +++ b/R/get_marginalmeans.R @@ -319,8 +319,7 @@ get_marginalmeans <- function( predict = predict_args$predict, estimate = estimate, datagrid = datagrid, - transform = !is.null(transform), - transform_arg = transform_arg, + transform = transform_arg, iterations = iterations, keep_iterations = keep_iterations, joint_test = joint_test, @@ -668,7 +667,7 @@ get_marginalmeans <- function( # - slope: the type of slope, e.g. "dx/dy". equals the "slope" argument when # calling avg_slopes() # - model_info: object from insight::model_info() -# - transform_arg: the `transform` argument as passed by the user (`transform` +# - transform: the `transform` argument as passed by the user (`transform` # is often only a logical), used for the scale line of the table footer # - renamed_focal: focal terms with the name of an output column, named by # their old names, with the new names ".1" as values @@ -701,8 +700,8 @@ get_marginalmeans <- function( # fmt: skip c( "at", "by", "focal_terms", "adjusted_for", "predict", "trend", "comparison", - "contrast", "estimate", "p_adjust", "transform", "transform_arg", "datagrid", - "preserve_range", "coef_name", "slope", "ci", "model_info", "contrast_filter", "null", + "contrast", "estimate", "p_adjust", "transform", "datagrid", "preserve_range", + "coef_name", "slope", "ci", "model_info", "contrast_filter", "null", "iterations", "keep_iterations", "joint_test", "omnibus_test", "vcov", "equivalence", "context_effects", "renamed_focal" ) diff --git a/R/table_footer.R b/R/table_footer.R index f82650d6e..d86b55162 100644 --- a/R/table_footer.R +++ b/R/table_footer.R @@ -134,7 +134,7 @@ # here. `info$transform` is often only a logical (and always `TRUE` for # emmeans), so we use the `transform` argument as passed by the user if (predict == "link") { - predict <- .link_transform_label(info$transform_arg, model) + predict <- .link_transform_label(info$transform, model) } # if we have contrasts of slope for GLMs, the default is to calculate # ORs or IRRs - in this case, we don't add information about the scale