tags:

views:

122

answers:

1

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?

A: 

Can you see if the error message is correct, i.e., check "by hand" whether the covariance matrix from the failing model is actually positive semi-definite? I'm not sure, but I imagine there are some checks you could perform - maybe there's something here: http://en.wikipedia.org/wiki/Positive-definite_matrix

John Horton
Thanks for the idea. I'm going to be revisiting the problem soon, so I'l try that out.Sorry for my delay, I didn't realize I was getting replies.
Jared