Topic 5 Key Structures in Causal Graphs
Pre-class work
Videos/slides
Checkpoint questions: Link to Moodle checkpoint
- Suppose that the variables A, B, and C in a causal graph are connected as such: A – B – C without knowledge of the arrow directions. If we only know that A and C are marginally dependent, which of the following structures are possible?
- A –> B –> C
- A <– B <– C
- A <– B –> C
- A –> B <– C
- If we know that A and C are conditionally dependent given B, which of the following structures are possible?
- A –> B –> C
- A <– B <– C
- A <– B –> C
- A –> B <– C
- If we know that A and C are marginally dependent and that A and C are conditionally independent given B, which of the following structures are possible?
- A –> B –> C
- A <– B <– C
- A <– B –> C
- A –> B <– C
- How do chains, forks, and colliders relate to the concepts of exchangeability and causal effects? Explain in a few sentences.
Learning Goals
- DSEP3: Simulate data from causal graphs under linear and logistic regression structural equation models to check d-separation properties through regression modeling and visualization.
Exercises
You can download a template RMarkdown file to start from here.
In these exercises, you’ll be practicing simulating data from structural equation models and verifying marginal and conditional (in)dependence properties in DAG structures.
- Always use a regression model as a check.
- If the situation readily corresponds to a plot, also make a plot as a check.
Coding note: When you simulate binary variables and store them in a dataset, it is useful to store them explicitly as categorical as below. (This is most helpful for plotting.)
# X is binary. Y and Z are quantitative.
data.frame(X = factor(X), Y, Z) sim_data <-
Exercise 1
Simulate a chain X -> Y -> Z
where all three variables are quantitative. (Use a sample size of 10,000 and a significance level of 0.05 throughout these exercises.)
Use appropriate check(s) to verify the conditional relation in this structure.
Exercise 2
Simulate a fork X <- Y -> Z
where X
and Z
are quantitative, and Y
is binary.
Use appropriate check(s) to verify the conditional relation in this structure.
Exercise 3
Simulate a collider X -> Y <- Z
where Y
also has a child A
(Y -> A
). Let all 4 variables be binary.
Use appropriate check(s) to verify the marginal and conditional relations between X
and Z
in this structure.
Exercise 4
Can we extend building block thinking to longer, more complex structures? Let’s investigate here (conceptually, no simulation).
Consider the longer structure
A <- B <- C -> D
. What do you expect about marginal/conditional (in)dependence ofA
andD
? Explain.Consider the longer structure
A -> B <- C <- D -> E
. What do you expect about marginal/conditional (in)dependence ofA
andE
? Explain.
Exercise 5
Discuss the Tweet below with your group.
- What does Liz Stuart mean by a “stark effect”? What might the trends look like if the effect weren’t so stark?
- What is the treatment? What evidence does this analysis provide? Is it strong evidence? Do you have any concerns?
Wow this is a pretty compelling comparative interrupted time series graph. Don't usually see such a stark effect. https://t.co/VCPLwUrXby
— Elizabeth Stuart (@Lizstuartdc) September 6, 2020