Skip to content

Commit

Permalink
20250220 - directed acyclic graphs (DAGs)
Browse files Browse the repository at this point in the history
  • Loading branch information
isaactpetersen committed Feb 20, 2025
1 parent 62c25ce commit a4331be
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 0 deletions.
2 changes: 2 additions & 0 deletions _site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ navbar:
href: dataManagement.html
- text: Developmental Scaling
href: developmentalScaling.html
- text: Directed Acyclic Graphs
href: dags.html
- text: Electroencaphalography/Event-Related Potentials
href: eegERP.html
- text: Exploratory Data Analysis
Expand Down
28 changes: 28 additions & 0 deletions dags.Rmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
title: "Directed Acyclic Graphs (DAGs)"
---

```{r setup, include = FALSE}
knitr::opts_chunk$set(
echo = TRUE,
error = TRUE,
warning = FALSE,
comment = "")
```

When conceptualizing and designing a study, or when developing plans to test a research question, it is important to draw a directed acyclic graph (DAG).
DAGs, like [path diagrams](figures.html#pathDiagrams), are causal diagrams.
Causal diagrams depict the hypoothesized causal processes that link two or more variables.
Path diagrams are typically used after analysis to describe and report the findings in analysis (when using path analysis, [factor analysis](factorAnalysis.html), or [structural equation modeling](sem.html)).
By contrast, DAGs are particularly useful when designing a study or before analysis, because they can help specify which variables it is important to control for and—just as importantly—which variables it is important not to control for.

When drawing a DAG for your study, draw all the variables that link the hypothesized cause to the hypothesized effect, including confounders, mediators, and colliders.
In your study, it is important to control for confounders.
Moreover, it is important not to control to control for mediators when you are interested in the total effect of the predictor on the outcome.
In addition, it is important not to control for descendants of the outcome variable.
When there is a collision, it is important not to control for the collider when examining the association between the two causes of the collider.
The only time when one should control for a collider is when the collider is also a cause (i.e., confound) of both the predictor and outcome variable rather than a common effect of both.

For more information on DAGs, including ancestors, descendants, confounders, and colliders, see here: https://isaactpetersen.github.io/Fantasy-Football-Analytics-Textbook/causal-inference.html#sec-causalDiagrams.

After determining what variables are confounders and what are important to control for, there are various ways one can control for variables, as described here: https://isaactpetersen.github.io/Fantasy-Football-Analytics-Textbook/causal-inference.html#sec-causalInferenceControlVariables.
1 change: 1 addition & 0 deletions index.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ knitr::opts_chunk$set(
- [Bayesian Analysis](bayesian.html)
- [Data Management](dataManagement.html)
- [Developmental Scaling](developmentalScaling.html)
- [Directed Acyclic Graphs](dags.html)
- [Electroencaphalography/Event-Related Potentials](eegERP.html)
- [Exploratory Data Analysis](eda.html)
- [Factor Analysis](factorAnalysis.html)
Expand Down

0 comments on commit a4331be

Please sign in to comment.