Questions tagged [ggdag]

An R package for working with causal directed acyclic graphs (DAGs).

This library is available in this website.

3 questions
0
votes
1 answer

Use labels with ggdag and ggplot

I'm using ggdag to create a DAG such as test <- dagify("a" ~ "b", "b" ~ "c", "c" ~ "d", "b" ~ "d", exposure = "b", outcome = "d", labels = c(a = "A", b = "B", c = "D")) And with ggplot I can get nice control…
pgcudahy
  • 1,542
  • 13
  • 36
0
votes
0 answers

ggdag: Error in `dplyr::left_join()` relationship = "many-to-many"

This is my first time using the tool, but I do not understand why I do not manage to plot a graph. My original intention was to run a simple graph with many variables like the next one: dagify( Y ~ Z1+X1+Z2+X2+U1+U2, X1 ~ Z1+U1, X2 ~ Z2+U2), …
Gero
  • 107
  • 1
  • 8
0
votes
0 answers

ggdag plot backdoor paths only

How can I use ggdag to plot backdoor paths only? For instance, given the following code: library(ggdag) tidy_ggdag <- dagify( y ~ t + x1, t ~ x1, exposure = "t", outcome = "y" ) %>% tidy_dagitty() ggdag_paths(tidy_ggdag) +…
robertspierre
  • 3,218
  • 2
  • 31
  • 46