Can Bayesian mediation be conducted in JASP?
I thought I saw that Bayesian mediation could be conducted in JASP, but don't see it anywhere (including under SEM < Mediation Analysis? If not, does anyone know of another GUI stats program that allows for Bayesian mediation?
Thanks!
Comments
I don't think you can do it automatically through a menu, but you can do it through the JAGS module. Here's a syntax where x = Extraversion, m = Satisfaction, and y = ITL (intention to leave), i.e. extraversion leads to higher satisfaction which in turn leads to lower intention to leave:
model{ # likelihood for(i in 1:978) # 978 is number of rows { Satisfaction[i]~dnorm(mu_m[i],1/sigma_m^2) ITL[i]~dnorm(mu_y[i],1/sigma_y^2) mu_m[i]<-beta0_m+betax_m*Extraversion[i] mu_y[i]<-beta0_y+betam_y*Satisfaction[i]+betax_y*Extraversion[i] } # priors beta0_m~dnorm(0,1/10^3) betax_m~dnorm(0,1/10^3) beta0_y~dnorm(0,1/10^3) betam_y~dnorm(0,1/10^3) betax_y~dnorm(0,1/10^3) sigma_m~dunif(1*10^-3,1*10^3) sigma_y~dunif(1*10^-3,1*10^3) # parameters indirect<-betam_y*betax_m }Here's what my window looks like:
This replicates the output from the SEM module (since I have noninformative priors):
Isn't this one of the models in the Process module?
EJ
Wow you're right, I hadn't realized Bayesian had been implemented in Process. Here's how I replicated the analysis:
Equivalently you can also specify this using paths (no need for Hayes model numbers):
Thank you, this is great! As this is the 1st time I've used JAGS, I can't seem to figure out how to get the parameters into the "Parameters in model" window. Also, how would I include covariates? And multiple (2) mediators? Thanks again, much appreciated.
I had neglected to refresh... I had initially done a series of mediation analyses, examining separate models for each mediator (2 mediators) and outcomes (3 different outcomes) using Process; however, reviewers recommended reducing the number of models by using an SEM-based mediation test (e.g., including 2 mediators simultaneously; two outcomes that are independent in the same model [my third outcome is essentially a composite of these two outcomes and would be examined in a separate model]).
Is an SEM-like mediation model testable using Bayesian stats? And if so, can that be done using JAGS?
Thanks!
To make parameters appear in the "Parameters in model" you need to click ctrl+enter to apply the model you wrote.
Yes it's possible in both JAGS and Process. Why do you prefer JAGS? Here's the setup using the Process module (1 predictor = Age, 2 mediators = Satisfaction and Work.engagement, 2 outcomes = ITL and Extraversion):
Note that you have to add residual covariances between IVs/mediators/outcomes (left-hand checkboxes at the bottom of the screenshot). JAGS is a bit harder for me to specify right this minute because you have to add covariances between predictors/mediators/outcomes, and I don't remember how to do that by heart
To answer your question about how to add control variables: you simply add direct paths from your controls to all mediators and outcomes in the model, e.g. like this (say I'm controlling for Gender):
Both JAGS and Process would give the same results (within Monte Carlo error), they're both equivalent and they're both SEM (you're estimating multiple equations simultaneously)
Thanks again (and I'm fine with Process). In running it (simplest version with 1 mediator and 1 outcome, plus 2 covariates), however, I get the following error:
Don't add paths from controls to IV, only to mediators and outcomes (here it fails because your IV is categorical). Age and mschool shouldn't predict NEGFAMDI (that's your IV right?)
Yes, careless error. It runs fine! Thank you (and EJ for suggesting Process) for all of your help, much appreciated.
One hopefully final question - as Bayesian stats are new to me, my understanding is that one shouldn't use the 95% Credible Interval as one might use a Confidence Interval to determine significance (and my main interest is in strength of relationships rather than hypothesis testing per se), but if true than how are the findings of the Credible Interval described? I've found a wide variety of interpretations in the literature...
To put it simply, you can say things like we're 95% sure that the parameter (e.g. regression coefficient) is between <lower> and <upper>, or there is a 95% chance that the parameter is between <lower> and <upper>. The reality is applied researchers interpret either type of interval pretty much the same.
And yes, you can use credible intervals (or confidence intervals) to determine significance.
Thanks!
Ideally we'd have Bayes factors in addition to credible intervals, as credible intervals are conditional on a model in which the effects are present. You could use BIC as a rough estimate of the BF under relatively wide priors.
EJ
You're right, Bayesian mediation isn't in JASP yet, even though it’s a cool feature. As for alternatives, try BayesFactor or Mplus they both support Bayesian mediation and have GUI options. You could also check out R with the `brms` package for more flexibility.
Bayesian mediation is in JASP, right? Just not with Bayes factors under informed priors.