Data preparation

Required R libraries

#rm(list = ls())
library(dplyr, quietly = TRUE)
library(BayesFactor, quietly = TRUE)
set.seed(123)

Loading the dataset

setwd(dir = "/Users/ivanropovik/OneDrive/MANUSCRIPTS/2017 penguin project_sexual orientation/Datasets")
full.data <- read.csv(file = "penguin_confirm.csv", header = TRUE, sep = ";")
#View(full.data)
data.na <- full.data %>% select(DEQ, csi, cbt, seconds, urald, sinod, sex, romrec, sexpref, Zmonog)

Listwise deletion

data <- data.na[complete.cases(data.na),]

Dichotomizing the sexpref variable

data$sexpref10[data$sexpref == 1] <- 1
data$sexpref10[data$sexpref == 2] <- 2
data$sexpref10[data$sexpref == 3] <- 2
data$sexpref10[data$sexpref == 4] <- 2

Calculation of interaction terms

data <- data %>% mutate(
  int_rom_alpha = DEQ * romrec,
  int_rom_beta = csi * romrec,
  int_sexpref_alpha = DEQ * sexpref10,
  int_sexpref_beta = csi * sexpref10,
  int_monog_alpha = DEQ * Zmonog,
  int_monog_beta = csi * Zmonog,
  int_sex_alpha = DEQ * sex,
  int_sex_beta = csi * sex,
  int_sex_rom_alphaXW = DEQ * romrec,
  int_sex_rom_alphaXZ = DEQ * sex,
  int_sex_rom_alphaWZ = romrec * sex,
  int_sex_rom_alphaXWZ = DEQ * romrec * sex
)

BF options

Prior width (r scale)

r.scale <- sqrt(2)/4

Number of iterations

n.iter <- 100000

CSI mediation

Alpha path

bfmodel1 <- regressionBF(csi ~ DEQ + seconds + urald + sinod + sex, data, rscaleCont = r.scale)
alpha.path <- bfmodel1[31]/bfmodel1[30]

BF for the alpha path

paste(ifelse(extractBF(alpha.path)$bf > 1, "BF10 = ", "BF01 = "),
      round(ifelse(extractBF(alpha.path)$bf > 1, extractBF(alpha.path)$bf, 1/extractBF(alpha.path)$bf), 2), sep = "")
## [1] "BF10 = 509.8"

Bayesian posterior estimate of the alpha path

round(summary(posterior(alpha.path, iterations =  n.iter))$statistics[1], 3)
## [1] 0.013

Posterior probability of the alpha path

post.odds.alpha <- newPriorOdds(alpha.path) * alpha.path
round(extractProbabilities(as.BFprobability(post.odds.alpha)[1])$probs, 3)
## [1] 0.998

Beta path

bfmodel2 <- regressionBF(cbt ~ csi + DEQ + seconds + urald + sinod + sex, data, rscaleCont = r.scale)
beta.path <- bfmodel2[63]/bfmodel2[62]

BF for the beta path

paste(ifelse(extractBF(beta.path)$bf > 1, "BF10 = ", "BF01 = "),
      round(ifelse(extractBF(beta.path)$bf > 1, extractBF(beta.path)$bf, 1/extractBF(beta.path)$bf), 2), sep = "")
## [1] "BF10 = 43.23"

Bayesian posterior estimate of the beta path

round(summary(posterior(beta.path, iterations = n.iter))$statistic[1], 3)
## [1] 0.046

Posterior probability of the beta path

post.odds.beta <- newPriorOdds(beta.path) * beta.path
round(extractProbabilities(as.BFprobability(post.odds.beta)[1])$probs, 3)
## [1] 0.977

Tau path

tau.path <- bfmodel2[63]/bfmodel2[61]

BF for the tau path

paste(ifelse(extractBF(tau.path)$bf > 1, "BF10 = ", "BF01 = "),
      round(ifelse(extractBF(tau.path)$bf > 1, extractBF(tau.path)$bf, 1/extractBF(tau.path)$bf), 2), sep = "")
## [1] "BF10 = 623.04"

Bayesian posterior estimate of the tau path

round(summary(posterior(tau.path, iterations = n.iter))$statistic[2], 3)
## [1] -0.005

Posterior probability of the tau path

post.odds.tau <- newPriorOdds(tau.path) * tau.path
round(extractProbabilities(as.BFprobability(post.odds.tau)[1])$probs, 3)
## [1] 0.998

BF for the mediation - the indirect (ab) path

post.prob.med <- extractBF(alpha.path)$bf/(extractBF(alpha.path)$bf + 1) * extractBF(beta.path)$bf/(extractBF(beta.path)$bf + 1)
bf.med <- post.prob.med/(1 - post.prob.med)

paste(ifelse(bf.med > 1, "BF10 = ", "BF01 = "), round(ifelse(bf.med > 1, bf.med, 1/bf.med), 2), sep = "")
## [1] "BF10 = 39.78"

Romantic - moderated CSI mediation

Moderation of the alpha path

bfmodel1rom <- regressionBF(csi ~ DEQ + romrec + int_rom_alpha + seconds + urald + sinod + sex, data, rscaleCont = r.scale)
alpha.rom <- bfmodel1rom[127]/bfmodel1rom[124]

BF for the moderation of the alpha path

paste(ifelse(extractBF(alpha.rom)$bf > 1, "BF10 = ", "BF01 = "),
      round(ifelse(extractBF(alpha.rom)$bf > 1, extractBF(alpha.rom)$bf, 1/extractBF(alpha.rom)$bf), 2), sep = "")
## [1] "BF10 = 429.78"

Bayesian posterior estimate of the moderation effect of the alpha path

round(summary(posterior(alpha.rom, iterations = n.iter))$statistics[1], 3)
## [1] 0.01

Posterior probability for the moderation effect of the alpha path

post.odds.alpha.rom <- newPriorOdds(alpha.rom) * alpha.rom
round(extractProbabilities(as.BFprobability(post.odds.alpha.rom)[1])$probs, 3)
## [1] 0.998

Moderation of the beta path

bfmodel2rom <- regressionBF(cbt ~ csi + DEQ + romrec + int_rom_beta + seconds + urald + sinod + sex, data, rscaleCont = r.scale)
beta.rom <- bfmodel2rom[255]/bfmodel2rom[251]

BF for the moderation of the beta path

paste(ifelse(extractBF(beta.rom)$bf > 1, "BF10 = ", "BF01 = "),
      round(ifelse(extractBF(beta.rom)$bf > 1, extractBF(beta.rom)$bf, 1/extractBF(beta.rom)$bf), 2), sep = "")
## [1] "BF01 = 3.42"

Bayesian posterior estimate of the moderation effect of the beta path

round(summary(posterior(beta.rom, iterations = n.iter))$statistic[1], 3)
## [1] 0.04

Posterior probability for the moderation effect of the beta path

post.odds.beta.rom <- newPriorOdds(beta.rom) * beta.rom
round(extractProbabilities(as.BFprobability(post.odds.beta.rom)[1])$probs, 3)
## [1] 0.226

Sexual orientation - moderated CSI mediation

Moderation of the alpha path

bfmodel1sexpref <- regressionBF(csi ~ DEQ + sexpref10 + int_sexpref_alpha + seconds + urald + sinod + sex, data, rscaleCont = r.scale)
alpha.sexpref <- bfmodel1sexpref[127]/bfmodel1sexpref[124]

BF for the moderation of the alpha path

paste(ifelse(extractBF(alpha.sexpref)$bf > 1, "BF10 = ", "BF01 = "),
      round(ifelse(extractBF(alpha.sexpref)$bf > 1, extractBF(alpha.sexpref)$bf, 1/extractBF(alpha.sexpref)$bf), 2), sep = "")
## [1] "BF01 = 2.57"

Bayesian posterior estimate of the moderation effect of the alpha path

round(summary(posterior(alpha.sexpref, iterations =  n.iter))$statistics[1], 3)
## [1] 0.031

Posterior probability for the moderation effect of the alpha path

post.odds.alpha.sexpref <- newPriorOdds(alpha.sexpref) * alpha.sexpref
round(extractProbabilities(as.BFprobability(post.odds.alpha.sexpref)[1])$probs, 3)
## [1] 0.28

Moderation of the beta path

bfmodel2sexpref <- regressionBF(cbt ~ csi + DEQ + sexpref10 + int_sexpref_beta + seconds + urald + sinod + sex, data, rscaleCont = r.scale)
beta.sexpref <- bfmodel2sexpref[255]/bfmodel2sexpref[251]

BF for the moderation of the beta path

paste(ifelse(extractBF(beta.sexpref)$bf > 1, "BF10 = ", "BF01 = "),
      round(ifelse(extractBF(beta.sexpref)$bf > 1, extractBF(beta.sexpref)$bf, 1/extractBF(beta.sexpref)$bf), 2), sep = "")
## [1] "BF01 = 3.81"

Bayesian posterior estimate of the moderation effect of the beta path

round(summary(posterior(beta.sexpref, iterations = n.iter))$statistic[1], 3)
## [1] 0.002

Posterior probability for the moderation effect of the beta path

post.odds.beta.sexpref <- newPriorOdds(beta.sexpref) * beta.sexpref
round(extractProbabilities(as.BFprobability(post.odds.beta.sexpref)[1])$probs, 3)
## [1] 0.208

Monogamy - moderated CSI mediation

Moderation of the alpha path

bfmodel1monog <- regressionBF(csi ~ DEQ + Zmonog + int_monog_alpha + seconds + urald + sinod + sex, data, rscaleCont = r.scale)
alpha.monog <- bfmodel1monog[127]/bfmodel1monog[124]

BF for the moderation of the alpha path

paste(ifelse(extractBF(alpha.monog)$bf > 1, "BF10 = ", "BF01 = "),
      round(ifelse(extractBF(alpha.monog)$bf > 1, extractBF(alpha.monog)$bf, 1/extractBF(alpha.monog)$bf), 2), sep = "")
## [1] "BF01 = 2.79"

Bayesian posterior estimate of the moderation effect of the alpha path

round(summary(posterior(alpha.monog, iterations =  n.iter))$statistics[1], 3)
## [1] 0.013

Posterior probability for the moderation effect of the alpha path

post.odds.alpha.monog <- newPriorOdds(alpha.monog) * alpha.monog
round(extractProbabilities(as.BFprobability(post.odds.alpha.monog)[1])$probs, 3)
## [1] 0.264

Moderation of the beta path

bfmodel2monog <- regressionBF(cbt ~ csi + DEQ + Zmonog + int_monog_beta + seconds + urald + sinod + sex, data, rscaleCont = r.scale)
beta.monog <- bfmodel2monog[255]/bfmodel2monog[251]

BF for the moderation of the beta path

paste(ifelse(extractBF(beta.monog)$bf > 1, "BF10 = ", "BF01 = "),
      round(ifelse(extractBF(beta.monog)$bf > 1, extractBF(beta.monog)$bf, 1/extractBF(beta.monog)$bf), 2), sep = "")
## [1] "BF01 = 4.39"

Bayesian posterior estimate of the moderation effect of the beta path

round(summary(posterior(beta.monog, iterations = n.iter))$statistic[1], 3)
## [1] 0.045

Posterior probability for the moderation effect of the beta path

post.odds.beta.monog <- newPriorOdds(beta.monog) * beta.monog
round(extractProbabilities(as.BFprobability(post.odds.beta.monog)[1])$probs, 3)
## [1] 0.186

Monogamy mediation

Alpha path

bfmodel1 <- regressionBF(Zmonog ~ DEQ + seconds + urald + sinod + sex, data, rscaleCont = r.scale)
alpha.path <- bfmodel1[31]/bfmodel1[30]

BF for the alpha path

paste(ifelse(extractBF(alpha.path)$bf > 1, "BF10 = ", "BF01 = "),
      round(ifelse(extractBF(alpha.path)$bf > 1, extractBF(alpha.path)$bf, 1/extractBF(alpha.path)$bf), 2), sep = "")
## [1] "BF10 = 2.73"

Bayesian posterior estimate of the alpha path

round(summary(posterior(alpha.path, iterations =  n.iter))$statistics[1], 3)
## [1] 0.006

Posterior probability of the alpha path

post.odds.alpha <- newPriorOdds(alpha.path) * alpha.path
round(extractProbabilities(as.BFprobability(post.odds.alpha)[1])$probs, 3)
## [1] 0.732

Beta path

bfmodel2 <- regressionBF(cbt ~ Zmonog + DEQ + seconds + urald + sinod + sex, data, rscaleCont = r.scale)
beta.path <- bfmodel2[63]/bfmodel2[62]

BF for the beta path

paste(ifelse(extractBF(beta.path)$bf > 1, "BF10 = ", "BF01 = "),
      round(ifelse(extractBF(beta.path)$bf > 1, extractBF(beta.path)$bf, 1/extractBF(beta.path)$bf), 2), sep = "")
## [1] "BF01 = 4.74"

Bayesian posterior estimate of the beta path

round(summary(posterior(beta.path, iterations = n.iter))$statistic[1], 3)
## [1] 0.012

Posterior probability of the beta path

post.odds.beta <- newPriorOdds(beta.path) * beta.path
round(extractProbabilities(as.BFprobability(post.odds.beta)[1])$probs, 3)
## [1] 0.174

Tau path

tau.path <- bfmodel2[63]/bfmodel2[61]

BF for the tau path

paste(ifelse(extractBF(tau.path)$bf > 1, "BF10 = ", "BF01 = "),
      round(ifelse(extractBF(tau.path)$bf > 1, extractBF(tau.path)$bf, 1/extractBF(tau.path)$bf), 2), sep = "")
## [1] "BF10 = 112.65"

Bayesian posterior estimate of the tau path

round(summary(posterior(tau.path, iterations = n.iter))$statistic[2], 3)
## [1] -0.004

Posterior probability of the tau path

post.odds.tau <- newPriorOdds(tau.path) * tau.path
round(extractProbabilities(as.BFprobability(post.odds.tau)[1])$probs, 3)
## [1] 0.991

BF for the mediation - the indirect (ab) path

post.prob.med <- extractBF(alpha.path)$bf/(extractBF(alpha.path)$bf + 1) * extractBF(beta.path)$bf/(extractBF(beta.path)$bf + 1)
bf.med <- post.prob.med/(1 - post.prob.med)

paste(ifelse(bf.med > 1, "BF10 = ", "BF01 = "), round(ifelse(bf.med > 1, bf.med, 1/bf.med), 2), sep = "")
## [1] "BF01 = 6.84"

MON->CSI double mediation

DEQ_CBT path

bfmodel1 <- regressionBF(cbt ~ DEQ + seconds + urald + sinod + sex, data, rscaleCont = r.scale)
DEQ_CBT.path <- bfmodel1[31]/bfmodel1[30]

BF for the DEQ_CBT path

paste(ifelse(extractBF(DEQ_CBT.path)$bf > 1, "BF10 = ", "BF01 = "),
      round(ifelse(extractBF(DEQ_CBT.path)$bf > 1, extractBF(DEQ_CBT.path)$bf, 1/extractBF(DEQ_CBT.path)$bf), 2), sep = "")
## [1] "BF10 = 87.26"

Bayesian posterior estimate of the DEQ_CBT path

round(summary(posterior(DEQ_CBT.path, iterations =  n.iter))$statistics[1], 3)
## [1] -0.004

Posterior probability of the DEQ_CBT path

post.odds.DEQ_CBT <- newPriorOdds(DEQ_CBT.path) * DEQ_CBT.path
round(extractProbabilities(as.BFprobability(post.odds.DEQ_CBT)[1])$probs, 3)
## [1] 0.989

DEQ_MON path

bfmodel2 <- regressionBF(Zmonog ~ DEQ + seconds + urald + sinod + sex, data, rscaleCont = r.scale)
DEQ_MON.path <- bfmodel2[31]/bfmodel2[30]

BF for the DEQ_MON path

paste(ifelse(extractBF(DEQ_MON.path)$bf > 1, "BF10 = ", "BF01 = "),
      round(ifelse(extractBF(DEQ_MON.path)$bf > 1, extractBF(DEQ_MON.path)$bf, 1/extractBF(DEQ_MON.path)$bf), 2), sep = "")
## [1] "BF10 = 2.73"

Bayesian posterior estimate of the DEQ_MON path

round(summary(posterior(DEQ_MON.path, iterations = n.iter))$statistic[1], 3)
## [1] 0.006

Posterior probability of the DEQ_MON path

post.odds.DEQ_MON <- newPriorOdds(DEQ_MON.path) * DEQ_MON.path
round(extractProbabilities(as.BFprobability(post.odds.DEQ_MON)[1])$probs, 3)
## [1] 0.732

DEQ_CSI path

bfmodel3 <- regressionBF(csi ~ DEQ + Zmonog + seconds + urald + sinod + sex, data, rscaleCont = r.scale)
DEQ_CSI.path <- bfmodel3[63]/bfmodel3[62]

BF for the DEQ_CSI path

paste(ifelse(extractBF(DEQ_CSI.path)$bf > 1, "BF10 = ", "BF01 = "),
      round(ifelse(extractBF(DEQ_CSI.path)$bf > 1, extractBF(DEQ_CSI.path)$bf, 1/extractBF(DEQ_CSI.path)$bf), 2), sep = "")
## [1] "BF10 = 295.92"

Bayesian posterior estimate of the DEQ_CSI path

round(summary(posterior(DEQ_CSI.path, iterations = n.iter))$statistic[1], 3)
## [1] 0.012

Posterior probability of the DEQ_CSI path

post.odds.DEQ_CSI <- newPriorOdds(DEQ_CSI.path) * DEQ_CSI.path
round(extractProbabilities(as.BFprobability(post.odds.DEQ_CSI)[1])$probs, 3)
## [1] 0.997

MON_CSI path

bfmodel4 <- regressionBF(csi ~ Zmonog + DEQ + seconds + urald + sinod + sex, data, rscaleCont = r.scale)
MON_CSI.path <- bfmodel4[63]/bfmodel4[62]

BF for the MON_CSI path

paste(ifelse(extractBF(MON_CSI.path)$bf > 1, "BF10 = ", "BF01 = "),
      round(ifelse(extractBF(MON_CSI.path)$bf > 1, extractBF(MON_CSI.path)$bf, 1/extractBF(MON_CSI.path)$bf), 2), sep = "")
## [1] "BF01 = 2.04"

Bayesian posterior estimate of the MON_CSI path

round(summary(posterior(MON_CSI.path, iterations = n.iter))$statistic[1], 3)
## [1] 0.07

Posterior probability of the MON_CSI path

post.odds.MON_CSI <- newPriorOdds(MON_CSI.path) * MON_CSI.path
round(extractProbabilities(as.BFprobability(post.odds.MON_CSI)[1])$probs, 3)
## [1] 0.329

MON_CBT path

bfmodel5 <- regressionBF(cbt ~ Zmonog + DEQ + csi + seconds + urald + sinod + sex, data, rscaleCont = r.scale)
MON_CBT.path <- bfmodel5[127]/bfmodel5[126]

BF for the MON_CBT path

paste(ifelse(extractBF(MON_CBT.path)$bf > 1, "BF10 = ", "BF01 = "),
      round(ifelse(extractBF(MON_CBT.path)$bf > 1, extractBF(MON_CBT.path)$bf, 1/extractBF(MON_CBT.path)$bf), 2), sep = "")
## [1] "BF01 = 5.14"

Bayesian posterior estimate of the MON_CBT path

round(summary(posterior(MON_CBT.path, iterations = n.iter))$statistic[1], 3)
## [1] 0.009

Posterior probability of the MON_CBT path

post.odds.MON_CBT <- newPriorOdds(MON_CBT.path) * MON_CBT.path
round(extractProbabilities(as.BFprobability(post.odds.MON_CBT)[1])$probs, 3)
## [1] 0.163

CSI_CBT path

bfmodel6 <- regressionBF(cbt ~ csi + DEQ + Zmonog + seconds + urald + sinod + sex, data, rscaleCont = r.scale)
CSI_CBT.path <- bfmodel6[127]/bfmodel6[126]

BF for the CSI_CBT path

paste(ifelse(extractBF(CSI_CBT.path)$bf > 1, "BF10 = ", "BF01 = "),
      round(ifelse(extractBF(CSI_CBT.path)$bf > 1, extractBF(CSI_CBT.path)$bf, 1/extractBF(CSI_CBT.path)$bf), 2), sep = "")
## [1] "BF10 = 39.87"

Bayesian posterior estimate of the CSI_CBT path

round(summary(posterior(CSI_CBT.path, iterations = n.iter))$statistic[1], 3)
## [1] 0.045

Posterior probability of the CSI_CBT path

post.odds.CSI_CBT <- newPriorOdds(CSI_CBT.path) * CSI_CBT.path
round(extractProbabilities(as.BFprobability(post.odds.CSI_CBT)[1])$probs, 3)
## [1] 0.976

CSI->MON double mediation

DEQ_CBT path

bfmodel1 <- regressionBF(cbt ~ DEQ + seconds + urald + sinod + sex, data, rscaleCont = r.scale)
DEQ_CBT.path <- bfmodel1[31]/bfmodel1[30]

BF for the DEQ_CBT path

paste(ifelse(extractBF(DEQ_CBT.path)$bf > 1, "BF10 = ", "BF01 = "),
      round(ifelse(extractBF(DEQ_CBT.path)$bf > 1, extractBF(DEQ_CBT.path)$bf, 1/extractBF(DEQ_CBT.path)$bf), 2), sep = "")
## [1] "BF10 = 87.26"

Bayesian posterior estimate of the DEQ_CBT path

round(summary(posterior(DEQ_CBT.path, iterations =  n.iter))$statistics[1], 3)
## [1] -0.004

Posterior probability of the DEQ_CBT path

post.odds.DEQ_CBT <- newPriorOdds(DEQ_CBT.path) * DEQ_CBT.path
round(extractProbabilities(as.BFprobability(post.odds.DEQ_CBT)[1])$probs, 3)
## [1] 0.989

DEQ_CSI path

bfmodel2 <- regressionBF(csi ~ DEQ + seconds + urald + sinod + sex, data, rscaleCont = r.scale)
DEQ_CSI.path <- bfmodel2[31]/bfmodel2[30]

BF for the DEQ_CSI path

paste(ifelse(extractBF(DEQ_CSI.path)$bf > 1, "BF10 = ", "BF01 = "),
      round(ifelse(extractBF(DEQ_CSI.path)$bf > 1, extractBF(DEQ_CSI.path)$bf, 1/extractBF(DEQ_CSI.path)$bf), 2), sep = "")
## [1] "BF10 = 509.8"

Bayesian posterior estimate of the DEQ_CSI path

round(summary(posterior(DEQ_CSI.path, iterations = n.iter))$statistic[1], 3)
## [1] 0.013

Posterior probability of the DEQ_CSI path

post.odds.DEQ_CSI <- newPriorOdds(DEQ_CSI.path) * DEQ_CSI.path
round(extractProbabilities(as.BFprobability(post.odds.DEQ_CSI)[1])$probs, 3)
## [1] 0.998

DEQ_MON path

bfmodel3 <- regressionBF(Zmonog ~ DEQ + csi + seconds + urald + sinod + sex, data, rscaleCont = r.scale)
DEQ_MON.path <- bfmodel3[63]/bfmodel3[62]

BF for the DEQ_MON path

paste(ifelse(extractBF(DEQ_MON.path)$bf > 1, "BF10 = ", "BF01 = "),
      round(ifelse(extractBF(DEQ_MON.path)$bf > 1, extractBF(DEQ_MON.path)$bf, 1/extractBF(DEQ_MON.path)$bf), 2), sep = "")
## [1] "BF10 = 1.61"

Bayesian posterior estimate of the DEQ_MON path

round(summary(posterior(DEQ_MON.path, iterations = n.iter))$statistic[1], 3)
## [1] 0.005

Posterior probability of the DEQ_MON path

post.odds.DEQ_MON <- newPriorOdds(DEQ_MON.path) * DEQ_MON.path
round(extractProbabilities(as.BFprobability(post.odds.DEQ_MON)[1])$probs, 3)
## [1] 0.618

CSI_MON path

bfmodel4 <- regressionBF(Zmonog ~ csi + DEQ + seconds + urald + sinod + sex, data, rscaleCont = r.scale)
CSI_MON.path <- bfmodel4[63]/bfmodel4[62]

BF for the CSI_MON path

paste(ifelse(extractBF(CSI_MON.path)$bf > 1, "BF10 = ", "BF01 = "),
      round(ifelse(extractBF(CSI_MON.path)$bf > 1, extractBF(CSI_MON.path)$bf, 1/extractBF(CSI_MON.path)$bf), 2), sep = "")
## [1] "BF01 = 1.34"

Bayesian posterior estimate of the CSI_MON path

round(summary(posterior(CSI_MON.path, iterations = n.iter))$statistic[1], 3)
## [1] 0.051

Posterior probability of the CSI_MON path

post.odds.CSI_MON <- newPriorOdds(CSI_MON.path) * CSI_MON.path
round(extractProbabilities(as.BFprobability(post.odds.CSI_MON)[1])$probs, 3)
## [1] 0.427

CSI_CBT path

bfmodel5 <- regressionBF(cbt ~ csi + DEQ + Zmonog + seconds + urald + sinod + sex, data, rscaleCont = r.scale)
CSI_CBT.path <- bfmodel5[127]/bfmodel5[126]

BF for the CSI_CBT path

paste(ifelse(extractBF(CSI_CBT.path)$bf > 1, "BF10 = ", "BF01 = "),
      round(ifelse(extractBF(CSI_CBT.path)$bf > 1, extractBF(CSI_CBT.path)$bf, 1/extractBF(CSI_CBT.path)$bf), 2), sep = "")
## [1] "BF10 = 39.87"

Bayesian posterior estimate of the CSI_CBT path

round(summary(posterior(CSI_CBT.path, iterations = n.iter))$statistic[1], 3)
## [1] 0.045

Posterior probability of the CSI_CBT path

post.odds.CSI_CBT <- newPriorOdds(CSI_CBT.path) * CSI_CBT.path
round(extractProbabilities(as.BFprobability(post.odds.CSI_CBT)[1])$probs, 3)
## [1] 0.976

MON_CBT path

bfmodel6 <- regressionBF(cbt ~ Zmonog + DEQ + csi + seconds + urald + sinod + sex, data, rscaleCont = r.scale)
MON_CBT.path <- bfmodel6[127]/bfmodel6[126]

BF for the MON_CBT path

paste(ifelse(extractBF(MON_CBT.path)$bf > 1, "BF10 = ", "BF01 = "),
      round(ifelse(extractBF(MON_CBT.path)$bf > 1, extractBF(MON_CBT.path)$bf, 1/extractBF(MON_CBT.path)$bf), 2), sep = "")
## [1] "BF01 = 5.14"

Bayesian posterior estimate of the MON_CBT path

round(summary(posterior(MON_CBT.path, iterations = n.iter))$statistic[1], 3)
## [1] 0.009

Posterior probability of the MON_CBT path

post.odds.MON_CBT <- newPriorOdds(MON_CBT.path) * MON_CBT.path
round(extractProbabilities(as.BFprobability(post.odds.MON_CBT)[1])$probs, 3)
## [1] 0.163

Sex - moderated CSI mediation

Moderation of the alpha path

bfmodel1sex <- regressionBF(csi ~ DEQ + sex + int_sex_alpha + seconds + urald + sinod, data, rscaleCont = r.scale)
alpha.sex <- bfmodel1sex[63]/bfmodel1sex[60]

BF for the moderation of the alpha path

paste(ifelse(extractBF(alpha.sex)$bf > 1, "BF10 = ", "BF01 = "),
      round(ifelse(extractBF(alpha.sex)$bf > 1, extractBF(alpha.sex)$bf, 1/extractBF(alpha.sex)$bf), 2), sep = "")
## [1] "BF10 = 1.59"

Bayesian posterior estimate of the moderation effect of the alpha path

round(summary(posterior(alpha.sex, iterations = n.iter))$statistics[1], 3)
## [1] -0.012

Posterior probability for the moderation effect of the alpha path

post.odds.alpha.sex <- newPriorOdds(alpha.sex) * alpha.sex
round(extractProbabilities(as.BFprobability(post.odds.alpha.sex)[1])$probs, 3)
## [1] 0.614

Moderation of the beta path

bfmodel2sex <- regressionBF(cbt ~ csi + DEQ + sex + int_sex_beta + seconds + urald + sinod, data, rscaleCont = r.scale)
beta.sex <- bfmodel2sex[127]/bfmodel2sex[123]

BF for the moderation of the beta path

paste(ifelse(extractBF(beta.sex)$bf > 1, "BF10 = ", "BF01 = "),
      round(ifelse(extractBF(beta.sex)$bf > 1, extractBF(beta.sex)$bf, 1/extractBF(beta.sex)$bf), 2), sep = "")
## [1] "BF01 = 5.94"

Bayesian posterior estimate of the moderation effect of the beta path

round(summary(posterior(beta.sex, iterations = n.iter))$statistic[1], 3)
## [1] 0.04

Posterior probability for the moderation effect of the beta path

post.odds.beta.sex <- newPriorOdds(beta.sex) * beta.sex
round(extractProbabilities(as.BFprobability(post.odds.beta.sex)[1])$probs, 3)
## [1] 0.144

Sex - moderated moderation (by romantic) of the CSI mediation (M11)

Moderated moderation of the alpha path

bfmodel1sex_rom <- regressionBF(csi ~ DEQ + romrec + sex + int_sex_rom_alphaXW + int_sex_rom_alphaXZ + int_sex_rom_alphaWZ + int_sex_rom_alphaXWZ + seconds + urald + sinod, data, rscaleCont = r.scale)
alpha.3way <- bfmodel1sex_rom[1023]/bfmodel1sex_rom[1016]

BF for the moderation of the alpha path

paste(ifelse(extractBF(alpha.3way)$bf > 1, "BF10 = ", "BF01 = "),
      round(ifelse(extractBF(alpha.3way)$bf > 1, extractBF(alpha.3way)$bf, 1/extractBF(alpha.3way)$bf), 2), sep = "")
## [1] "BF01 = 3.05"

Bayesian posterior estimate of the moderation effect of the alpha path

round(summary(posterior(alpha.3way, iterations = n.iter))$statistics[1], 3)
## [1] -0.016

Posterior probability for the moderation effect of the alpha path

post.odds.alpha.3way <- newPriorOdds(alpha.3way) * alpha.3way
round(extractProbabilities(as.BFprobability(post.odds.alpha.3way)[1])$probs, 3)
## [1] 0.247

Sex - moderated CSI mediation controlling for romantic

Moderation of the alpha path

bfmodel1sex_rom <- regressionBF(csi ~ DEQ + sex + int_sex_alpha + romrec + seconds + urald + sinod, data, rscaleCont = r.scale)
alpha.sex <- bfmodel1sex_rom[127]/bfmodel1sex_rom[124]

BF for the moderation of the alpha path

paste(ifelse(extractBF(alpha.sex)$bf > 1, "BF10 = ", "BF01 = "),
      round(ifelse(extractBF(alpha.sex)$bf > 1, extractBF(alpha.sex)$bf, 1/extractBF(alpha.sex)$bf), 2), sep = "")
## [1] "BF10 = 1.75"

Bayesian posterior estimate of the moderation effect of the alpha path

round(summary(posterior(alpha.sex, iterations = n.iter))$statistics[1], 3)
## [1] -0.013

Posterior probability for the moderation effect of the alpha path

post.odds.alpha.sex <- newPriorOdds(alpha.sex) * alpha.sex
round(extractProbabilities(as.BFprobability(post.odds.alpha.sex)[1])$probs, 3)
## [1] 0.637

Moderation of the beta path

bfmodel2sex_rom <- regressionBF(cbt ~ csi + DEQ + sex + int_sex_beta + romrec + seconds + urald + sinod, data, rscaleCont = r.scale)
beta.sex <- bfmodel2sex_rom[255]/bfmodel2sex_rom[251]

BF for the moderation of the beta path

paste(ifelse(extractBF(beta.sex)$bf > 1, "BF10 = ", "BF01 = "),
      round(ifelse(extractBF(beta.sex)$bf > 1, extractBF(beta.sex)$bf, 1/extractBF(beta.sex)$bf), 2), sep = "")
## [1] "BF01 = 5.52"

Bayesian posterior estimate of the moderation effect of the beta path

round(summary(posterior(beta.sex, iterations = n.iter))$statistic[1], 3)
## [1] 0.036

Posterior probability for the moderation effect of the beta path

post.odds.beta.sex <- newPriorOdds(beta.sex) * beta.sex
round(extractProbabilities(as.BFprobability(post.odds.beta.sex)[1])$probs, 3)
## [1] 0.153
sessionInfo()
## R version 3.3.2 (2016-10-31)
## Platform: x86_64-apple-darwin13.4.0 (64-bit)
## Running under: macOS Sierra 10.12.6
## 
## locale:
## [1] sk_SK.UTF-8/sk_SK.UTF-8/sk_SK.UTF-8/C/sk_SK.UTF-8/sk_SK.UTF-8
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
## [1] BayesFactor_0.9.12-2 Matrix_1.2-8         coda_0.19-1         
## [4] dplyr_0.5.0         
## 
## loaded via a namespace (and not attached):
##  [1] Rcpp_0.12.10       knitr_1.15.1       magrittr_1.5      
##  [4] lattice_0.20-34    R6_2.2.0           pbapply_1.3-2     
##  [7] stringr_1.2.0      tools_3.3.2        parallel_3.3.2    
## [10] grid_3.3.2         DBI_0.6            htmltools_0.3.5   
## [13] MatrixModels_0.4-1 gtools_3.5.0       yaml_2.1.14       
## [16] lazyeval_0.2.0     assertthat_0.1     rprojroot_1.2     
## [19] digest_0.6.12      tibble_1.2         evaluate_0.10     
## [22] rmarkdown_1.3      stringi_1.1.2      backports_1.0.5   
## [25] mvtnorm_1.0-6