Main effect in a bayesian model

Hello,

I have the following bayesian model:

fit <- brm(response ~  0  + Intercept + language:contrast + (1 | subject), data = test, family = bernoulli("logit"), prior = prior, sample_prior = "yes")
Family: bernoulli 
  Links: mu = logit 
Formula: response ~ 0 + Intercept + language:contrast + (1 | subject) 
   Data: test (Number of observations: 2400) 
  Draws: 4 chains, each with iter = 2000; warmup = 1000; thin = 1;
         total post-warmup draws = 4000

Group-Level Effects: 
~subject (Number of levels: 50) 
              Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept)     0.92      0.12     0.71     1.18 1.00     1133     1462

Population-Level Effects: 
                              Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS
Intercept                         0.56      0.62    -0.62     1.81 1.01      461
languageCG:contrasthad_hard      -0.86      0.65    -2.15     0.43 1.00      492
languageRP:contrasthad_hard       0.90      0.71    -0.47     2.25 1.00      595
languageSMG:contrasthad_hard     -1.88      0.67    -3.23    -0.57 1.01      472
languageCG:contrasthead_heed      4.12      0.95     2.42     6.14 1.00      791
languageRP:contrasthead_heed      3.99      1.21     1.85     6.58 1.00     1426
languageSMG:contrasthead_heed     3.52      0.81     1.96     5.12 1.00      686
languageCG:contrasthid_heed      -1.06      0.64    -2.32     0.22 1.00      466
languageRP:contrasthid_heed       2.09      0.77     0.57     3.56 1.00      667
languageSMG:contrasthid_heed     -2.32      0.68    -3.69    -1.06 1.01      480
languageCG:contrasthoard_hod      0.05      0.64    -1.24     1.30 1.00      484
languageRP:contrasthoard_hod      1.08      0.71    -0.32     2.46 1.00      581
languageSMG:contrasthoard_hod    -0.73      0.66    -2.06     0.51 1.01      473
languageCG:contrasthud_hard      -1.00      0.64    -2.28     0.25 1.01      469
languageRP:contrasthud_hard       0.51      0.70    -0.89     1.88 1.00      586
languageSMG:contrasthud_hard     -1.14      0.67    -2.48     0.15 1.00      489
languageCG:contrastwhod_hood     -0.98      0.65    -2.23     0.25 1.01      493
languageRP:contrastwhod_hood      0.74      0.71    -0.67     2.10 1.00      587
languageSMG:contrastwhod_hood    -1.84      0.67    -3.20    -0.59 1.00      484
                              Tail_ESS
Intercept                          888
languageCG:contrasthad_hard        952
languageRP:contrasthad_hard       1274
languageSMG:contrasthad_hard       947
languageCG:contrasthead_heed      1837
languageRP:contrasthead_heed      2151
languageSMG:contrasthead_heed     1691
languageCG:contrasthid_heed       1121
languageRP:contrasthid_heed       1571
languageSMG:contrasthid_heed      1112
languageCG:contrasthoard_hod      1191
languageRP:contrasthoard_hod      1077
languageSMG:contrasthoard_hod      951
languageCG:contrasthud_hard       1127
languageRP:contrasthud_hard       1241
languageSMG:contrasthud_hard      1032
languageCG:contrastwhod_hood      1189
languageRP:contrastwhod_hood      1277
languageSMG:contrastwhod_hood      929

I would like to find the main effect of contrast (all contrasts) on languageCG. I’m a little bit confused about the code, so any help would be appreciated.

Best,

George

You might find that checking out the emmeans package helps you out here.

You could try looking at something like:

emmeans(fit, specs = c("contrast")
emmeans(fit, specs = c("contrast", "language")