{'fraction_non_alphanumeric': 0.02283464566929134, 'fraction_numerical': 0.009448818897637795, 'mean_word_length': 5.451776649746193, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Theory and Analysis of Total, Direct, and Indirect Causal Effects

Mediation analysis, or more generally models with direct and indirect effects, are commonly used in the behavioral sciences. As we show in our illustrative example, traditional methods of mediation analysis that omit confounding variables can lead to systematically biased direct and indirect effects, even in the context of a randomized experiment. Therefore, several definitions of causal effects in mediation models have been presented in the literature (Baron & Kenny, 1986; Imai, Keele, & Tingley, 2010; Pearl, 2012). We illustrate the stochastic theory of causal effects as an alternative foundation of causal mediation analysis based on probability theory. In this theory we define total, direct, and indirect effects and show how they can be identified in the context of our illustrative example. A particular strength of the stochastic theory of causal effects are the causality conditions that imply causal unbiasedness of effect estimates. The causality conditions have empirically testable implications and can be used for covariate selection. In the discussion, we highlight some similarities and differences of the stochastic theory of causal effects with other theories of causal effects.