Skip to content
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

ggpredict with gamlss and re : unable to compute vcov matrix of predictions #224

Open
ghost opened this issue Jun 21, 2021 · 6 comments
Open

Comments

@ghost
Copy link

ghost commented Jun 21, 2021

Dear all

I am trying to plot estimates and CI from a mixed model fitted with gamlss (data attached):

synchro.sp5.txt

The model has random effects fitted with re, so unsurprisingly the computation of the vcov matrix of predictions becomes rather uneasy :

beinf=gamlss(sync ~re(fixed=~guilde2*(saison+nb),random=~1|espece),family=BEINF,data=synchro.sp5) pred2=ggpredict(beinf,terms=c("saison","guilde2"))
This code returns the following :

new prediction 
Could not compute variance-covariance matrix of predictions. No confidence intervals are returned.

Is there any meaningful workaround to get meaningful CI in this case, perhaps working through bootstraping or changing the vcov arguments, or any kind of code trick? I do not feel confident enough with the underlying stats and with the way ggpredict generates its outputs to just dig and guess something myself.

Thanks!!

@aja2182
Copy link

aja2182 commented Sep 5, 2021

I am getting the same message when I pipe to plot() and, in turn, I am receiving a plot without confidence intervals. I figured I would share what I am trying to do. I've fit a multilevel model and I am trying to plot the cross-level interaction term of a lower-level binary variable and upper-level continuous variable in a model that, in addition to individuals, includes two random effects (state-year and state). Additionally, I let the slope of my lower-level predictor vary across state-year and state. I've tried to reproduce what I am doing and it seems like the issue - at least for me - occurs anytime I include more than one random effect, i.e., it also occurs when I have (1| state) + (1| year). I'm a novice so I can't really tell if what I am doing is related to modeling or using the program (but I do know, analytically, it makes sense to include a random effect for state and year and ideally have a nested term for year/state). Thanks so much for this amazing package :)

@aja2182
Copy link

aja2182 commented Sep 8, 2021

Update: This now seems to work! I'm not sure how or why though :)

@olvic
Copy link

olvic commented Feb 15, 2022

Any luck on this? Having the same error code and can't figure out how to get around it.

@aja2182
Copy link

aja2182 commented Feb 22, 2022

did you figure this out? It is likely a result of issues w/ convergence.

what does your model look like? any way for me to reproduce this? lmk

@olvic
Copy link

olvic commented Feb 22, 2022

Hi, thanks! I should have updated here when I found the issue.
I think the problem was that I have a multiple predictor variables as well as a control. whenever I had a control, all predictors had to have a value of "control". I therefore had redundancy in the model. Fixed it by merging the predictors into a single parameter and doing emmeans / contrasts. Works now!
See this stackexchange: https://stats.stackexchange.com/questions/562761/using-mixed-models-is-there-a-way-to-explicitly-ignore-one-pair-of-crossed-fixe

@aja2182
Copy link

aja2182 commented Feb 22, 2022

That's great, and great to know too!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants