Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
strengejacke committed Sep 13, 2024
1 parent a52d295 commit 036ff87
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion R/check_dag.R
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ check_dag <- function(...,
# so we can correctly compare required and current sets
all_required_adjustments <- sort(unique(c(exposure, adjustment_set)))
# this is what we have and which are allow
all_allowed_adjustments <- unique(setdiff(c(exposure, adjustment_nodes), collider))
all_allowed_adjustments <- sort(unique(setdiff(c(exposure, adjustment_nodes), collider)))
list(
# no adjustment needed when
# - required and current adjustment sets are NULL
Expand Down
20 changes: 10 additions & 10 deletions tests/testthat/_snaps/check_dag.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
Identification of direct and total effects
Incorrectly adjusted!
To estimate the direct and total effect, do not adjust for `b`.
Model is correctly specified.
No adjustment needed to estimate the direct and total effect of `x` on `y`.

---
Expand Down Expand Up @@ -56,8 +56,8 @@
Identification of direct and total effects
Incorrectly adjusted!
To estimate the direct and total effect, do not adjust for `c`.
Model is correctly specified.
No adjustment needed to estimate the direct and total effect of `x` on `y`.

---
Expand All @@ -72,8 +72,8 @@
Identification of direct and total effects
Incorrectly adjusted!
To estimate the direct and total effect, do not adjust for `c`.
Model is correctly specified.
No adjustment needed to estimate the direct and total effect of `x` on `y`.

---
Expand All @@ -88,8 +88,8 @@
Identification of direct and total effects
Incorrectly adjusted!
To estimate the direct and total effect, do not adjust for `cyl`, `disp` and `gear`.
Model is correctly specified.
No adjustment needed to estimate the direct and total effect of `wt` on `mpg`.

# check_dag, multiple adjustment sets
Expand Down Expand Up @@ -119,8 +119,8 @@
Identification of direct and total effects
Incorrectly adjusted!
To estimate the direct and total effect, do not adjust for `alertness` and `prepared`.
Model is correctly specified.
No adjustment needed to estimate the direct and total effect of `podcast` on `exam`.

# check_dag, different adjustements for total and direct
Expand Down

0 comments on commit 036ff87

Please sign in to comment.