dagitty
dagitty copied to clipboard
Indicate "incorrectly adjusted" in `adjustementSets()`?
When using this Model code in https://www.dagitty.net/dags.html,
dag {
B [adjusted]
D [outcome]
E [exposure]
B -> D
E -> B
E -> D
}
the tool informs me about incorrect adjustments:
However, dagitty::adjustmentSets() just returns an empty list for the total effect, not indicating that B should not be adjusted:
dag <- dagitty::dagitty("dag {
B [adjusted]
D [outcome]
E [exposure]
B -> D
E -> B
E -> D
}")
# empty list - what does this mean?
dagitty::adjustmentSets(dag)
dagitty::adjustmentSets(dag, effect = "direct")
#> { B }
Current workaround is to check for adjusted node lengths:
r <- dagitty::adjustmentSets(dag)
# incorrectly adjusted?
(!length(r) && length(dagitty::adjustedNodes(dag)) > 0)
#> [1] TRUE
It would be great if dagitty::adjustmentSets() would directly yield a warning about incorrect adjustments, instead of returning an empty list.