Statistical methods for mediation confounding and moderation analysis using R and SAS Third variable effect refers to the intervening effect of a third variable on the observed relationship between an exposure and an outcome. The third variable effect analysis differentiates the effect from multiple third variables that explain the established exposure outcome relationship. Depending on whether there is a causal relationship from the exposure to the third variable to the outcome the third variable effect can be categorized into two major groups: mediation effect where a causal relationship is assumed and confounding effect where there is no causal relationship. A causal relationship can be established through randomized experiments