From 036ff87fd1e67abf066ced2632e5671410a3615c Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 13 Sep 2024 14:22:37 +0200 Subject: [PATCH] fix --- R/check_dag.R | 2 +- tests/testthat/_snaps/check_dag.md | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/R/check_dag.R b/R/check_dag.R index 90c176011..56918c5f9 100644 --- a/R/check_dag.R +++ b/R/check_dag.R @@ -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 diff --git a/tests/testthat/_snaps/check_dag.md b/tests/testthat/_snaps/check_dag.md index 88a4bee3b..7bfcca5a6 100644 --- a/tests/testthat/_snaps/check_dag.md +++ b/tests/testthat/_snaps/check_dag.md @@ -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`. --- @@ -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`. --- @@ -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`. --- @@ -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 @@ -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