Hi All,
I’m hoping that somebody can help me with an issue. I’m running a lognormal model in brms to measure the population level effects of covariates on my response variable, which is ‘detection delay’. Among the covariates in the model is ‘endemicity’, which refers to one of two datasets that I’m trying to compare through the model estimates (low vs. high).
The estimates of the posterior mean and diagnostics all check out, and I exponentiate the estimates to give the relative differences for each covariate. However, when I generate two and three way effect plots using the marginal_effects function, the output doesn’t match the model estimates (see estimates and plots below), i.e. the detection delay estimates in the ‘high endemicity’ dataset are lower than the ‘low endemicity’ dataset, which is the opposite of what I would expect from the model estimates (this is using the default method: posterior_epred, but is also the case with method = posterior_linpred).
Interestingly, I have only experienced this issue since incorporating heterogeneous variances
for the two data sets in the model, i.e. including sigma ~ 0 + endemicity. Without specifying sigma, the differences in expected mean response values of the PPD in the effect plots reflect the model estimates, with ‘high endemicity’ showing higher detection delay overall regardless of the other covariates shown in the effect plot.
Could anyone help me explain why this is happening?
mod_brmslognorm_final <- brm(detection delay ~ age +
endemicity +
sex +
who_subtype,
sigma ~ 0 + endemicity),
iter = 10000,
warmup = 1000,
init = 0,
prior <- c(set_prior("normal(0,1e+06)", class = "b")),
data = mydata_full,
family = "lognormal")
Operating System: Windows 10 Pro
brms Version: 2.17.0