## Everything dag <- 'dag { bb="-4.79,-6.035,4.818,5.504" SES [pos="-4.463,-2.925"] ad_treat [pos="2.007,-1.567"] afli [pos="0.028,-1.851"] age [pos="-1.242,-0.765"] alc [pos="-3.716,-0.111"] ami [pos="-3.137,3.986"] civil [pos="-4.099,0.703"] diabetes [pos="-3.838,3.579"] education [pos="-3.632,-3.678"] gen_PA [pos="-2.820,-1.247"] hypertension [pos="-4.034,2.468"] mrs_0 [pos="-1.746,2.715"] mrs_1 [pos="1.326,-0.469"] nihss_0 [pos="0.271,1.296"] pase_0 [exposure,pos="-0.542,0.173"] revasc [pos="0.980,2.332"] rtreat [pos="2.334,2.036"] sex [pos="-4.538,-0.778"] smoker [pos="-1.877,-2.160"] stroke [adjusted,pos="0.766,0.321"] svd [latent,pos="-2.400,1.493"] tci [pos="-2.418,4.467"] vasc_event [outcome,pos="3.754,0.358"] SES -> ad_treat SES -> age SES -> alc SES -> gen_PA SES -> stroke SES -> vasc_event ad_treat -> vasc_event afli -> pase_0 afli -> stroke afli -> vasc_event age -> afli age -> civil age -> mrs_1 age -> nihss_0 age -> vasc_event alc -> hypertension alc -> pase_0 alc -> stroke alc -> svd alc -> vasc_event ami -> afli ami -> mrs_0 ami -> stroke ami -> vasc_event civil -> pase_0 civil -> stroke civil -> vasc_event diabetes -> mrs_0 diabetes -> nihss_0 diabetes -> stroke diabetes -> svd diabetes -> vasc_event education -> SES education -> ad_treat education -> age education -> alc education -> gen_PA education -> stroke education -> vasc_event gen_PA -> ami gen_PA -> diabetes gen_PA -> hypertension gen_PA -> pase_0 gen_PA -> smoker gen_PA -> tci hypertension -> afli hypertension -> mrs_0 hypertension -> nihss_0 hypertension -> stroke hypertension -> svd hypertension -> vasc_event mrs_0 -> pase_0 mrs_0 -> revasc mrs_1 -> ad_treat mrs_1 -> vasc_event nihss_0 -> revasc pase_0 -> ad_treat pase_0 -> nihss_0 pase_0 -> stroke revasc -> mrs_1 rtreat -> mrs_1 rtreat -> vasc_event sex -> ad_treat sex -> alc sex -> education sex -> mrs_1 sex -> pase_0 sex -> stroke sex -> vasc_event smoker -> age smoker -> mrs_1 smoker -> vasc_event stroke -> mrs_1 stroke -> nihss_0 stroke -> rtreat stroke -> vasc_event svd -> mrs_0 svd -> pase_0 svd -> vasc_event tci -> mrs_0 tci -> stroke tci -> vasc_event }' ## Simplified dag <- 'dag { bb="-4.79,-6.035,4.818,5.504" "Higher SES" [pos="-1.671,-1.740"] "U: higher svd score" [latent,pos="-3.091,2.172"] "active treat" [pos="1.914,3.209"] "higher PA" [exposure,pos="-0.999,0.555"] "lower mrs_0" [pos="-2.437,1.259"] ad_treat [pos="-0.448,-0.358"] cardio_vasc [pos="-4.202,0.839"] male [pos="-3.119,-0.926"] vasc_event [outcome,pos="3.754,0.358"] "Higher SES" -> "higher PA" "Higher SES" -> ad_treat "Higher SES" -> vasc_event "U: higher svd score" -> "lower mrs_0" "U: higher svd score" -> vasc_event "active treat" -> vasc_event "higher PA" -> ad_treat "higher PA" -> vasc_event "lower mrs_0" -> "higher PA" ad_treat -> vasc_event cardio_vasc -> "U: higher svd score" cardio_vasc -> "higher PA" [pos="-2.876,-0.185"] cardio_vasc -> "lower mrs_0" cardio_vasc -> vasc_event [pos="-4.762,5.060"] male -> "higher PA" male -> vasc_event [pos="-2.540,-5.134"] }' dag |> ggdag::ggdag_adjustment_set(node_size = 14, text_col = "black") + theme(legend.position = "bottom")