0
$\begingroup$

This works fine:

lme(fixed=target~target_projection, random= ~ 1|CLINICIAN_USER_ID, data=study_pop)

But if I try to let the slopes vary:

lme(fixed=target~target_projection, random= ~ target|CLINICIAN_USER_ID, data=study_pop)

I get the following error:

Error during wrapup: the leading minor of order 2 is not positive definite

My data set should be large enough, the second level of the model breaks into 60 groups with 30 data points each, what could be causing this?

$\endgroup$
8
  • $\begingroup$ Searching our site for the key words in the error message, "leading minor," turns up the thread at stats.stackexchange.com/questions/55925. The information there might help you identify which additional details of your dataset you should share with us--and perhaps it even answers your question. $\endgroup$
    – whuber
    Commented Mar 20, 2015 at 22:22
  • $\begingroup$ @whuber I did see that post, but it does not make sense for my issue. My data has no missing data points and there are only parameters, one of which is a factor, so it could not be colinear with the other. $\endgroup$ Commented Mar 23, 2015 at 15:46
  • $\begingroup$ You seem to be using "data" and "parameters" in an unconventional way. In particular, what exactly do you mean by "only parameters"? Please note, too, that the answer in the linked thread points to other potential causes of this problem, including overfitting, which is a possibility you should consider. $\endgroup$
    – whuber
    Commented Mar 23, 2015 at 15:49
  • $\begingroup$ Sorry, a symbol got left out, I meant to say there are only 2 parameters. I know from manual plotting of the data that it could not be overfit with what I have provided to lme. $\endgroup$ Commented Mar 23, 2015 at 15:56
  • $\begingroup$ What package is this from? $\endgroup$ Commented Mar 23, 2015 at 16:06

1 Answer 1

3
+100
$\begingroup$

It looks like a syntax error; the random effect random= ~ target|CLINICIAN_USER_ID should be specified as random= ~ target_projection|CLINICIAN_USER_ID.

It's possible to (sort of) reproduce this using the Oats dataset:

library(nlme)

m1 <- lme(yield ~ nitro, random ~ 1|Block, data = Oats) #fine

m2 <- lme(yield ~ nitro, random = ~yield|Block, data=Oats)
##Error in chol.default((value + t(value))/2) : 
##the leading minor of order 2 is not positive definite
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.