multinomial logistic regression - Error design vector length - no missings

Welcome to the forum for MLwiN users. Feel free to post your question about MLwiN software here. The Centre for Multilevel Modelling take no responsibility for the accuracy of these posts, we are unable to monitor them closely. Do go ahead and post your question and thank you in advance if you find the time to post any answers!

Remember to check out our extensive software FAQs which may answer your question: http://www.bristol.ac.uk/cmm/software/s ... port-faqs/
Post Reply
GerineLodder
Posts: 22
Joined: Thu Jul 28, 2016 11:33 am

multinomial logistic regression - Error design vector length - no missings

Post by GerineLodder » Mon Aug 08, 2016 1:52 pm

I am trying to run a model in which I predict an ordinal variable with 5 categories (% are 50.4%, 32.6%, 7.6%, 3.6% and 5.8%). THe first category is the reference categorie.
My data are nested, with 9137 children nested in 460 classrooms in 153 schools.

I followed the manual to set up a model with CONS for each category compared to the reference category, and cons as a random factor for school and class.

There are no other explanatory variables in my equations, and I have listwise deleted all cases with missing values.

With MQL estimation, everyting then converges fine (although I do have to click yes for the " SSP matrix for fixed part has gone negative definite" error a few times), but when I change the estimation either to PQL2 or to MCMC, I get the error message:

Design vector at level 2 is the wrong length (moni 0).

I have gone through the forum, and found several other people who have ran into this problem. Each time, the problem seemed to be with missing values. That is not the case for me, as I have listwise deleted all missing values. Does anyone know what may have gone wrong?

ChrisCharlton
Posts: 890
Joined: Mon Oct 19, 2009 10:34 am

Re: multinomial logistic regression - Error design vector length - no missings

Post by ChrisCharlton » Mon Aug 08, 2016 5:01 pm

Without seeing the worksheet it is hard to tell what is going on here. Do the MQL results look sensible?

Sometimes that base category can make a difference to how well the model is estimated, so you could try using the last category, although this has a lot fewer associated records.

It's possible that your data contains a variable with the same name as one that MLwiN uses to fit these discrete models (e.g. P), which would confuse it.

It's worth checking the model->hierarchy viewer window to ensure that it matches your expectations as it may be that the data is not sorted in the expected way.

PQL2 and MCMC will use the residuals as part of the estimation, so it might be worth calculating these for the MQL model to check that they look sensible. You might also want to try PQL1 or MQL2 as an intermediate method (i.e. using the More button) to see whether that helps.

GerineLodder
Posts: 22
Joined: Thu Jul 28, 2016 11:33 am

Re: multinomial logistic regression - Error design vector length - no missings

Post by GerineLodder » Tue Aug 09, 2016 7:46 am

Hi Chris,

Thank you for your answer!

I have tried all your suggestions, but unfortunately, no results.

I have changed the reference category, the same problem occured.
I deleted the " denom" variable, which I created for use in another model, just in case this was confusing to MLwin.
The other variables I cannot imagine they could cause a problem (e.g.: PopSelf etc).
The hierarchy viewer looks okay. I saw that there is an option to display only blocks with missing units, wchich gave me no results (confirming that there are no missings).

MQL2 and PQL1 both did not work, I get the same error there.

Basically, I get the " negative definite SSP matrix" error a few times, then the estimates for equations turn imposibly large and MLwin gives me the vector length error.

Your question regarding the MQL results: No, they do not look sensible, at least in the sense that the school level variance is estimated to be 0). I think MLwin just has difficulties estimating even this more or less empty model.
I have run some other analyses on the same dataset, where I dichotomized the outcome. There I also did not get convergence on the higher level variances until about 800.000 iterations and a burnin of 50.000 with the MCMC estimator. In IGLS/MQL1 with some levels there I also got a variance of 0 for school level, but this was adjusted in the MCMC estimations.

If you would be willing to take a look at the data (I will change the variable names then), this would be very helpful. I would prefer it if I could send the data to you instead of posting it on the forum, because of restrictions in our data management plan. I am looking forward to your response!

ChrisCharlton
Posts: 890
Joined: Mon Oct 19, 2009 10:34 am

Re: multinomial logistic regression - Error design vector length - no missings

Post by ChrisCharlton » Tue Aug 09, 2016 10:13 am

Yes, if you are able to send me data I might be able to get a better idea of where it is going wrong (you can find my email address on http://www.bristol.ac.uk/cmm/team/). Otherwise if you could simulate data with similar characteristics that exhibits the same problems then I could look at that.

GerineLodder
Posts: 22
Joined: Thu Jul 28, 2016 11:33 am

Re: multinomial logistic regression - Error design vector length - no missings

Post by GerineLodder » Wed Aug 10, 2016 8:47 am

Thanks, I will send you an email. I will post a solution here if it is found, in case someone else runs into the same problem.

rcv6123328
Posts: 3
Joined: Thu Mar 30, 2017 1:41 pm

Re: multinomial logistic regression - Error design vector length - no missings

Post by rcv6123328 » Sat Apr 01, 2017 2:22 pm

Was there a solution to this issue? I am running into a lot of bugs (I am a new user of MLwiN)

Jillianeh
Posts: 2
Joined: Wed Mar 22, 2017 9:01 pm

Re: multinomial logistic regression - Error design vector length - no missings

Post by Jillianeh » Wed Sep 20, 2017 7:44 pm

Same issues here. Was it resolved?

ChrisCharlton
Posts: 890
Joined: Mon Oct 19, 2009 10:34 am

Re: multinomial logistic regression - Error design vector length - no missings

Post by ChrisCharlton » Thu Sep 21, 2017 11:31 am

If I remember correctly there was something about the data which caused some of the higher level residuals to be calculated as almost zero. Versions of MLwiN prior to 3.01 would replace these small values with the missing value, which is turn would cause problem with the quasi-likelihood estimation. You can test whether this is also the cause of your problem by issuing the command:

Code: Select all

MISR 0
prior to running the model. Alternatively you could update to version 3.01 if you aren't already using this, as the default for this option has changed.

Post Reply