-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using cluster-robust SEs within a zero-inflated negative binomial model through ggpredict won't return confidence intervals #353
Comments
do you have a reproducible example, possibly using some toy data? |
Sure! Here is the model and its application using ggpredict:
And here is the data
|
Thanks! Looks like a duplicate of #360? |
Yes, exactly. Vincent was basing that question off this original post (which I also posted on stackoverflow https://stackoverflow.com/questions/76780457/using-cluster-robust-ses-within-a-zero-inflated-negative-binomial-model-through). |
Ok, closing in favor of #360 |
Hey all,
I've been stuck the last few days trying to apply cluster-robust standard errors in my calculation of the marginal effects of two predictor variables (main effects and their interaction) in a ZINB model. The code works perfectly when I don't include the cluster-robust standard error code, but as soon as I include them it stops returning confidence intervals and standard errors and gives this error "Could not compute variance-covariance matrix of predictions. No confidence intervals are returned."
Here is the code for the ZINB model:
moderation <- zeroinfl(ASR_Aggr_Raw ~ scale(NEO_A)*scale(CogCrystalComp_AgeAdj), data=dat, dist = "negbin")
Here is the code and generated output (screenshot) for marginal effects without the cluster-robust standard error estimator:
predict.1 <- ggpredict(moderation, c("NEO_A", "CogCrystalComp_AgeAdj"), ci.lvl = .99, type = "count"))
Here is the code and generated output (screenshot) with the estimator (which was taken almost exactly from the code's website https://strengejacke.github.io/ggeffects/articles/practical_robustestimation.html):
predict.2 <- ggpredict(moderation, c("NEO_A", "CogCrystalComp_AgeAdj"), ci.lvl = .99, type = "count", vcov.fun = "vcovCR", vcov.type = "CR1", vcov.args = list(cluster = dat$Family_ID))
Help in generating the CIs for the cluster-robust SEs would be incredibly appreciated, as I'm not sure where to go from here. Thank you in advance for your help!
The text was updated successfully, but these errors were encountered: