Skip to content

Commit

Permalink
snaps
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Aug 3, 2024
1 parent e138366 commit ac86685
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: performance
Title: Assessment of Regression Models Performance
Version: 0.12.2.2
Version: 0.12.2.3
Authors@R:
c(person(given = "Daniel",
family = "Lüdecke",
Expand Down
16 changes: 8 additions & 8 deletions R/check_dag.R
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,10 @@ print.check_dag <- function(x, ...) {
insight::color_text("Model is correctly specified.", "green"),
exposure_outcome_text,
"\n\nNo adjustment needed to estimate the ", i, " effect of ",
datawizard::text_concatenate(attributes(x)$exposure),
" on ",
datawizard::text_concatenate(attributes(x)$exposure, enclose = "`"),
" on `",
attributes(x)$outcome,
"."
"`."
)
} else if (isTRUE(out$incorrectly_adjusted)) {
# Scenario 2: incorrectly adjusted, adjustments where none is allowed
Expand All @@ -250,8 +250,8 @@ print.check_dag <- function(x, ...) {
exposure_outcome_text,
"\n\nTo estimate the ", i, " effect, do ",
insight::color_text("not", "italic"),
" adjust for: ",
datawizard::text_concatenate(out$current_adjustments),
" adjust for ",
datawizard::text_concatenate(out$current_adjustments, enclose = "`"),
"."
)
} else if (length(out$current_adjustments) != length(out$minimal_adjustment)) {
Expand All @@ -261,16 +261,16 @@ print.check_dag <- function(x, ...) {
exposure_outcome_text,
"\n\nTo estimate the ", i, " effect, ",
insight::color_text("also", "italic"),
" adjust for: ",
insight::color_text(datawizard::text_concatenate(out$minimal_adjustments), "yellow"),
" adjust for ",
insight::color_text(datawizard::text_concatenate(out$minimal_adjustments, enclose = "`"), "yellow"),
"."
)
if (is.null(out$current_adjustments)) {
msg <- paste0(msg, "\nCurrently, the model does not adjust for any variables.")
} else {
msg <- paste0(
msg, "\nCurrently, the model currently only adjusts for ",
insight::color_text(datawizard::text_concatenate(out$current_adjustments), "yellow"), "."
insight::color_text(datawizard::text_concatenate(out$current_adjustments, enclose = "`"), "yellow"), "."
)
}
} else {
Expand Down
16 changes: 8 additions & 8 deletions tests/testthat/_snaps/check_dag.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
- Outcome: y
- Exposure: x
No adjustment needed to estimate the direct effect of x on y.
No adjustment needed to estimate the direct effect of `x` on `y`.
# Correct adjustments for identifying total effects
Model is correctly specified.
- Outcome: y
- Exposure: x
No adjustment needed to estimate the total effect of x on y.
No adjustment needed to estimate the total effect of `x` on `y`.

---
Expand Down Expand Up @@ -53,7 +53,7 @@
- Outcome: y
- Exposure: x
To estimate the direct effect, also adjust for: b.
To estimate the direct effect, also adjust for `b`.
Currently, the model does not adjust for any variables.
# Correct adjustments for identifying total effects
Expand All @@ -62,7 +62,7 @@
- Outcome: y
- Exposure: x
To estimate the total effect, also adjust for: b.
To estimate the total effect, also adjust for `b`.
Currently, the model does not adjust for any variables.

Expand All @@ -77,16 +77,16 @@
- Outcome: y
- Exposure: x
To estimate the direct effect, also adjust for: b and c.
Currently, the model currently only adjusts for c.
To estimate the direct effect, also adjust for `b` and `c`.
Currently, the model currently only adjusts for `c`.
# Correct adjustments for identifying total effects
Incorrectly adjusted!
- Outcome: y
- Exposure: x
To estimate the total effect, also adjust for: b and c.
Currently, the model currently only adjusts for c.
To estimate the total effect, also adjust for `b` and `c`.
Currently, the model currently only adjusts for `c`.

0 comments on commit ac86685

Please sign in to comment.