Hi. I have been trying to use the
mediation package to do a mediation analysis, with models from the
wt <- svydesign(id = ~id, weights = ~weights, strata = ~strata, data = wt_pre, nest = T) model.M <- svyglm(a ~ b+c, wt, family = quasibinomial()) model.Y <- svyglm(y ~ a+b+c, wt, family = quasibinomial()) results <- mediate(model.M, model.Y, treat="b", mediator="a", boot=TRUE, sims=500)
Returns error message:
ERROR in R:
Error in statistic(data, original, ...) : unsupported glm family
Any advice to fix it? Thx.