Stimulate, Simulate, Insinuate

Plant a known effect. See if your model can find it.

Plant. Fit. Check.

Does warm water change growth?

Dry years: warm and lean

Who leaves early?

Today we know the answer

One number per arrow

set.seed(42)
n <- 500
drought <- rnorm(n)
temp    <-  0.6 * drought + rnorm(n, sd = 0.8)
growth  <-  0.3 * temp - 0.8 * drought + rnorm(n)
timing  <- -0.7 * temp - 0.7 * growth + rnorm(n, sd = 0.5)

Plot it

Model 1

Same fish, colored by water year

Within a water year

Model 2

Model 3

What model 2 sees

Fish that left at the same time

Every group tells the same lie

300 new datasets

The diagram decides

Resources

library(dagitty)
g <- dagitty("dag{ drought -> temp; drought -> growth; temp -> growth
                   temp -> timing; growth -> timing }")
adjustmentSets(g, exposure = "temp", outcome = "growth")
#> { drought }