Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
12 changes: 6 additions & 6 deletions R/estimate_predicted.R
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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
Expand All @@ -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,
Expand All @@ -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
Expand Down
1 change: 0 additions & 1 deletion R/get_marginalcontrasts.R
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
9 changes: 4 additions & 5 deletions R/get_marginalmeans.R
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 "<name>.1" as values
Expand Down Expand Up @@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion R/table_footer.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading