Skip to content

Commit 951934a

Browse files
Benjamin T. VincentdrbenvincentOriolAbril
authored
update Moderation example to best practice and v4 (#297)
* create truncated regression example * delete truncated regression example from main branch * create truncated regression example * delete truncated regression example from main branch * create truncated regression example * delete truncated regression example from main branch * start the update of moderation analysis notebook * bring back target_accept to resolve divergences * suggested updates * add explanation to category Co-authored-by: Oriol Abril-Pla <[email protected]> * fix reference: article -> book * fix a date to match up with references * attempt to add cross references between moderation and mediation notebooks * remove pm. tags on mediation notebook while I'm here * fix notebook cross references Co-authored-by: Benjamin T. Vincent <[email protected]> Co-authored-by: Oriol Abril-Pla <[email protected]>
1 parent f258d10 commit 951934a

File tree

5 files changed

+505
-434
lines changed

5 files changed

+505
-434
lines changed

examples/case_studies/mediation_analysis.ipynb

+4-2
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@
99
"# Bayesian mediation analysis\n",
1010
"\n",
1111
":::{post} February, 2022\n",
12-
":tags: mediation, path analysis, pymc3.ConstantData, pymc3.Deterministic, pymc3.HalfCauchy, pymc3.Model, pymc3.Normal, regression\n",
12+
":tags: mediation, path analysis, regression\n",
1313
":category: beginner\n",
1414
":author: Benjamin T. Vincent\n",
1515
":::\n",
1616
"\n",
1717
"This notebook covers Bayesian [mediation analysis](https://en.wikipedia.org/wiki/Mediation_(statistics) ). This is useful when we want to explore possible mediating pathways between a predictor and an outcome variable.\n",
1818
"\n",
19-
"It is important to note that the approach to mediation analysis has evolved over time. This notebook was heavily influenced by the approach of {cite:t}`hayes2017introduction` as set out in his textbook \"Introduction to Mediation, Moderation and Conditional Process Analysis.\""
19+
"It is important to note that the approach to mediation analysis has evolved over time. This notebook was heavily influenced by the approach of {cite:t}`hayes2017introduction` as set out in his textbook \"Introduction to Mediation, Moderation and Conditional Process Analysis.\"\n",
20+
"\n",
21+
"Readers should be aware that mediation analysis is commonly confused with moderation analysis for which we have a separate example ({ref}`moderation_analysis`)."
2022
]
2123
},
2224
{

examples/case_studies/moderation_analysis.ipynb

+281-287
Large diffs are not rendered by default.

examples/references.bib

+72
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,16 @@ @article{ando2007bayesian
99
publisher = {Oxford University Press},
1010
doi = {10.1093/biomet/asm017}
1111
}
12+
@article{bauer2005probing,
13+
title = {Probing interactions in fixed and multilevel regression: Inferential and graphical techniques},
14+
author = {Bauer, Daniel J and Curran, Patrick J},
15+
journal = {Multivariate behavioral research},
16+
volume = {40},
17+
number = {3},
18+
pages = {373--400},
19+
year = {2005},
20+
publisher = {Taylor \& Francis}
21+
}
1222
@book{breen1996regression,
1323
title = {Regression models: Censored, sample selected, or truncated data},
1424
author = {Breen, Richard and others},
@@ -117,6 +127,26 @@ @misc{hogg2010data
117127
archiveprefix = {arXiv},
118128
primaryclass = {astro-ph.IM}
119129
}
130+
@article{iacobucci2016mean,
131+
title = {Mean centering helps alleviate ``micro'' but not ``macro'' multicollinearity},
132+
author = {Iacobucci, Dawn and Schneider, Matthew J and Popovich, Deidre L and Bakamitsos, Georgios A},
133+
journal = {Behavior research methods},
134+
volume = {48},
135+
number = {4},
136+
pages = {1308--1317},
137+
year = {2016},
138+
publisher = {Springer}
139+
}
140+
@article{iacobucci2017mean,
141+
title = {Mean centering, multicollinearity, and moderators in multiple regression: The reconciliation redux},
142+
author = {Iacobucci, Dawn and Schneider, Matthew J and Popovich, Deidre L and Bakamitsos, Georgios A},
143+
journal = {Behavior research methods},
144+
volume = {49},
145+
number = {1},
146+
pages = {403--404},
147+
year = {2017},
148+
publisher = {Springer}
149+
}
120150
@book{ivezić2014astroMLtext,
121151
author = {\v{Z}eljko Ivezi\'{c} and Andrew J. Connolly and Jacob T. VanderPlas and Alexander Gray},
122152
doi = {10.1515/9781400848911},
@@ -187,6 +217,12 @@ @article{kruschke2013
187217
title = {Bayesian estimation supersedes the t test.},
188218
journal = {Journal of Experimental Psychology: General}
189219
}
220+
@book{kruschke2014doing,
221+
title = {Doing Bayesian data analysis: A tutorial with R, JAGS, and Stan},
222+
author = {Kruschke, John},
223+
year = {2014},
224+
publisher = {Academic Press}
225+
}
190226
@misc{kucukelbir2015automatic,
191227
title = {Automatic Variational Inference in Stan},
192228
author = {Alp Kucukelbir and Rajesh Ranganath and Andrew Gelman and David M. Blei},
@@ -218,6 +254,16 @@ @book{martin2021bayesian
218254
publisher = {Chapman and Hall/CRC},
219255
doi = {10.1201/9781003019169}
220256
}
257+
@article{mcclelland2017multicollinearity,
258+
title = {Multicollinearity is a red herring in the search for moderator variables: A guide to interpreting moderated multiple regression models and a critique of Iacobucci, Schneider, Popovich, and Bakamitsos (2016)},
259+
author = {McClelland, Gary H and Irwin, Julie R and Disatnik, David and Sivan, Liron},
260+
journal = {Behavior research methods},
261+
volume = {49},
262+
number = {1},
263+
pages = {394--402},
264+
year = {2017},
265+
publisher = {Springer}
266+
}
221267
@book{mcelreath2018statistical,
222268
title = {Statistical rethinking: A Bayesian course with examples in R and Stan},
223269
author = {McElreath, Richard},
@@ -294,6 +340,16 @@ @article{silver2016masteringgo
294340
year = {2016},
295341
url = {https://doi.org/10.1038/nature16961}
296342
}
343+
@article{spiller2013spotlights,
344+
title = {Spotlights, floodlights, and the magic number zero: Simple effects tests in moderated regression},
345+
author = {Spiller, Stephen A and Fitzsimons, Gavan J and Lynch Jr, John G and McClelland, Gary H},
346+
journal = {Journal of marketing research},
347+
volume = {50},
348+
number = {2},
349+
pages = {277--288},
350+
year = {2013},
351+
publisher = {SAGE Publications Sage CA: Los Angeles, CA}
352+
}
297353
@misc{szegedy2014going,
298354
title = {Going Deeper with Convolutions},
299355
author = {Christian Szegedy and Wei Liu and Yangqing Jia and Pierre Sermanet and Scott Reed and Dragomir Anguelov and Dumitru Erhan and Vincent Vanhoucke and Andrew Rabinovich},
@@ -302,6 +358,12 @@ @misc{szegedy2014going
302358
archiveprefix = {arXiv},
303359
primaryclass = {cs.CV}
304360
}
361+
@online{vandenbergSPSS,
362+
author = {van den Berg, R. G},
363+
title = {SPSS Moderation Regression Tutorial},
364+
url = {https://www.spss-tutorials.com/spss-regression-with-moderation-interaction-effect/},
365+
urldate = {2022-03-20}
366+
}
305367
@inproceedings{vanderplas2012astroML,
306368
author = {{Vanderplas}, J.T. and {Connolly}, A.J. and {Ivezi{\'c}}, {\v Z}. and {Gray}, A.},
307369
booktitle = {Conference on Intelligent Data Understanding (CIDU)},
@@ -330,3 +392,13 @@ @article{yuan2009bayesian
330392
year = {2009},
331393
publisher = {American Psychological Association}
332394
}
395+
@article{zhang2017moderation,
396+
title = {Moderation analysis with missing data in the predictors.},
397+
author = {Zhang, Qian and Wang, Lijuan},
398+
journal = {Psychological methods},
399+
volume = {22},
400+
number = {4},
401+
pages = {649},
402+
year = {2017},
403+
publisher = {American Psychological Association}
404+
}

myst_nbs/case_studies/mediation_analysis.myst.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ kernelspec:
1515
# Bayesian mediation analysis
1616

1717
:::{post} February, 2022
18-
:tags: mediation, path analysis, pymc3.ConstantData, pymc3.Deterministic, pymc3.HalfCauchy, pymc3.Model, pymc3.Normal, regression
18+
:tags: mediation, path analysis, regression
1919
:category: beginner
2020
:author: Benjamin T. Vincent
2121
:::
@@ -24,6 +24,8 @@ This notebook covers Bayesian [mediation analysis](https://en.wikipedia.org/wiki
2424

2525
It is important to note that the approach to mediation analysis has evolved over time. This notebook was heavily influenced by the approach of {cite:t}`hayes2017introduction` as set out in his textbook "Introduction to Mediation, Moderation and Conditional Process Analysis."
2626

27+
Readers should be aware that mediation analysis is commonly confused with moderation analysis for which we have a separate example ({ref}`moderation_analysis`).
28+
2729
```{code-cell} ipython3
2830
import arviz as az
2931
import matplotlib.pyplot as plt

0 commit comments

Comments
 (0)