ABSTRACT

The Bayesian method is important in statistics analysis since prior knowledge can be used and the explanation of statistics inference from the Bayesian method is straightforward. In the third-variable effect analysis, the Bayesian method can provide further advantages since it takes third-variables as random variables directly and the goodness-of-fit for the final model is given with third-variable effects embedded in the hierarchical data structure. In this chapter, we provide the third-variable analysis method in the Bayesian setting. Three Bayesian methods are provided: 1) third-variable effects as a function of estimated coefficients, 2) product of partial differences for X-M effect and M-Y effect separately and 3) the resampling method. We provide R codes using WinBUGS models and explain how to extend the method to different types of exposure, third-variable and outcome variables. In the provided R codes, vague informative priors are used in the analysis, which can be adjusted easily. The three Bayesian methods are compared using simulations.