Closed mjohnston118 closed 3 years ago
The iteration history suggests that your data have a flat (approximate) log-likelihood surface. This can be so because either you have too few clusters or to small clusters (I spuspect the latter).
Maybe you try setting maxit=83
. You may get a warning about non-convergence, but at least "preliminary" estimates.
Hi Martin,
Thanks for the response. I have a few questions:
Sorry but what does a "flat (approximate) log-likelihood surface" mean exactly?
Maxit = 83 works as you say with the following error: "Algorithm did not convergeFitted probabilities numerically 0 occurred". I then use BIC(study1_fullModel) to obtain the BIC value. Can this value be trusted?
Where did "83" come from? When I remove the three way interaction to get the BIC value of the reduced model I encounter the convergence problem again so it would be useful if I could solve this solution myself in the future
I'm quite new to this type of analysis so apologies if these questions are basic.
Regards, Matthew
A log-likelihood function is flat if it does not have a maximum. This may occur e.g. when there is separation in logitistic regression. As a consequence, no maximum likelihood estimate exists. I write "(approximate)" because the (log-)likelihood function of logit models with random effects does not have a closed form.
"Algorithm did not converge Fitted probabilities numerically 0 occurred" is a warning and not an error. Nevertheless I would not trust BICs here, because the log-likehood function is only a rough approximation.
I suggested to set 'maxit=83' because this is the last iteration before the algorithm diverges. You may at least have finite (yet not very trustworthy) estimates then.
It seems that indeed you do not have enough data to be able to estimate the random effects variance reliably. A quick fix would be to try fitting a multinomial model without random effects but with overdisperision. There may also a very slight chance that trying mblogit(...,estimator="REML")
may help.
Hi Prof. Martin Elff,
I am trying to use your mblogit function to fit a multinomial logistic regression to examine the factors which predict participants in my experiment selecting one of three answers. Because my model is mixed (I am comparing different age groups of participants and also participants' performance on one of two trial types) I am including subject ID as a random factor.
For model selection, my approach is to start by fitting a full model (3 IVs with all their interactions) then removing components and comparing the BIC score of the model before and after removing each component. If removing a component dramatically reduces the BIC score (based on Raftery, 1995) then I will argue it does not add predictive value to the model and that component will not be included in the final model.
My problem here is that with the full model R studio returns the error "Algorithm does not converge". I increased the number of iterations to 200 but it returns the following issue:
Traceback() returns:
I then tried changing method to "MQL" but it gets to iteration 99 and returns this error:
Error in qr.default(x) : NA/NaN/Inf in foreign function call (arg 1)
Taking a few of the interactions out does remove this problem of convergence but if possible would like to get an estimate of the full model and all its interactions so I can report the BIC of this full model.
Do you know what I can do here to get the full model to run?
Thanks in advance! Matthew