coords <- data.frame(
name = c('A', 'C', 'D', 'K', 'U'),
x = c(1, 2, 3, 1.5, 2.5),
y = c(0, 0.5, 0, -1, -1)
)
dagify(
C ~ A + K + D + U,
K ~ A + U,
U ~ D,
coords = coords
) |> ggdag(seed = 2, layout = 'auto') + theme_dag()
There is useful information to transfer across features, here we note there is a correlation between rural and urban probability of use within districts. A model that uses two 1-dimensional distributions (intercepts and slopes) does not consider the covariance structure between rural and urban within district.

