Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indicate "incorrectly adjusted" in adjustementSets()? #96

Open
strengejacke opened this issue Aug 2, 2024 · 1 comment
Open

Indicate "incorrectly adjusted" in adjustementSets()? #96

strengejacke opened this issue Aug 2, 2024 · 1 comment

Comments

@strengejacke
Copy link

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:
image

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.

@malcolmbarrett
Copy link
Contributor

ggdag expects this, so I'd need to know if it was changed, but I agree. It's not clear at all, and even I forget that that's what it means.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants