First published online: 10 December 2019, Int J Epidemiol 2019; Volume 48, Issue 2, April 2019, Pages 640–653. doi: https://doi.org/10.1093/ije/dyy275
The corrigendum to this article published on 10 December 2019 (https://doi.org/10.1093/ije/dyz247) referred to corrections made to the code in Box 2. These corrections were in fact, incorrect, as was the sentence referring to Box 2. The correct text and Box 2 code is as follows (changes shown in bold).
Box 2. To generate data consistent with Figure 2B
library(visreg) # load package to visualize regression output
library(ggplot2) # load package to visualize regression output
N <- 1000 # sample size
set.seed(777)
A <- rnorm(N) # exposure
Y <- 0.3 * A + rnorm(N)
C <- 1.2 * A + 0.9 * Y + rnorm(N)
fit3 <- lm(Y ∼ A) # crude model
fit4 <- lm(Y ∼ A + C) # adjusted model
# visualize adjusted model
g2 < - visreg(fit4, ‘A’, gg = TRUE, line = list(col = ‘red’),
points = list(size = 2, pch = 1, col = ‘black’)) + theme_classic()+
coord_cartesian(ylim = c(-4, 4)) +
ggtitle(“Figure 2B”)
“The true causal coefficient of the exposure A is 0.3, and the coefficients for the association of the collider C with the exposure A and the outcome Y are 1.2 and 0.9, respectively (Box 2).”