I have run two multilevel logistic regressions using the same predictors but on two different responses:
fruitMLM <- lmer(InsuffFruit ~ Income + HDI + Income:HDI + (1 + Income | Country),family=binomial(link="logit"))
fuelMLM <- lmer(Pollution ~ Income + HDI + Income:HDI + (1 + Income | Country),family=binomial(link="logit"))
Income is discrete with values c(-2,-1,0,1,2), HDI is continuous between 0 and 1, Country is categorical and the responses are both 1/0.
To plot confidence bands I run a simulation using the sim() function from the arm package:
sim(fruitMLM,100)
sim(fuelMLM,100)
The first one computes fine. The second one returns the following error:
Error in mvnorm(n.sims, bhat[j,], V.beta) :
'Sigma' is not positive definite
I actually am doing this with 8 different responses. Six of them worked fine and two of them returned this error.
Does anyone know how to rectify this?