# Coding the Backdoor Criterion to estimate the total effect of variables and selecting priors

**URL:** <https://discourse.pymc.io/t/coding-the-backdoor-criterion-to-estimate-the-total-effect-of-variables-and-selecting-priors/9339>\
**Category:** Questions\
**Tags:** modeling\
**Created:** [May 5, 2022, 10:45am UTC](https://discourse.pymc.io/t/coding-the-backdoor-criterion-to-estimate-the-total-effect-of-variables-and-selecting-priors/9339 "2022-05-05T10:45:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![june14](https://avatars.discourse-cdn.com/v4/letter/j/278dde/32.png) [@june14](https://discourse.pymc.io/u/june14)\
**Post date:** [May 5, 2022, 10:45am UTC](https://discourse.pymc.io/t/coding-the-backdoor-criterion-to-estimate-the-total-effect-of-variables-and-selecting-priors/9339/1 "2022-05-05T10:45:20Z")

</div>

![Untitled](https://canada1.discourse-cdn.com/flex036/uploads/pymc3/original/2X/0/0639ecdca8ec9a13f2ec81352accaf026eb51840.png)

Can you please provide me a sample code on this? I could do the rest but since I am new to programming I am having hard time creating the correct model.

---

<div class="post-metadata">

**Author:** ![drbenvincent](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.pymc.io/drbenvincent/32/4313_2.png) [@drbenvincent](https://discourse.pymc.io/u/drbenvincent)\
**Post date:** [May 8, 2022, 12:39pm UTC](https://discourse.pymc.io/t/coding-the-backdoor-criterion-to-estimate-the-total-effect-of-variables-and-selecting-priors/9339/2 "2022-05-08T12:39:35Z")

</div>

So the model is structurally just some linear regressions. The closest example is for a moderation model [Bayesian mediation analysis — PyMC3 3.11.5 documentation](https://docs.pymc.io/en/v3/pymc-examples/examples/case_studies/mediation_analysis.html)
