I'm trying to fit the following reproducible mediation model called final
. But I get an error saying:
sigma must be a symmetric matrix
Could you please advise how I can possibly overcome this error?
Reproducible R code:
df <- read.csv("https://raw.githubusercontent.com/fpqq/w/refs/heads/main/t.csv")
library(glmmTMB)
library(mediation)
mediator <- glmmTMB(pic_percent ~ con +
(0+con | ID) +
(0+con | TRIAL_INDEX),
data=df,
family = beta_family(),
ziformula = ~1)
outcome <- glmmTMB(acc ~ con + pic_percent +
(0+con+pic_percent | Q),
data = df,
family = binomial())
final <- mediate(mediator, outcome, sims=50,
treat="con", mediator="pic_percent")