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/
GerineLodder
Posts: 42
Joined: Thu Jul 28, 2016 11:33 am

multinomial logistic regression - Error design vector length - no missings

Post by GerineLodder »

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: 1351
Joined: Mon Oct 19, 2009 10:34 am

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

Post by ChrisCharlton »

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: 42
Joined: Thu Jul 28, 2016 11:33 am

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

Post by GerineLodder »

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: 1351
Joined: Mon Oct 19, 2009 10:34 am

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

Post by ChrisCharlton »

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: 42
Joined: Thu Jul 28, 2016 11:33 am

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

Post by GerineLodder »

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 »

Was there a solution to this issue? I am running into a lot of bugs (I am a new user of MLwiN)
Jillianeh
Posts: 4
Joined: Wed Mar 22, 2017 9:01 pm

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

Post by Jillianeh »

Same issues here. Was it resolved?
ChrisCharlton
Posts: 1351
Joined: Mon Oct 19, 2009 10:34 am

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

Post by ChrisCharlton »

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.
GerineLodder
Posts: 42
Joined: Thu Jul 28, 2016 11:33 am

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

Post by GerineLodder »

For me the only solution was running the model via R2mlwin, because there I could tweak the starting values.
Tunze123
Posts: 3
Joined: Mon Oct 28, 2019 5:22 am

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

Post by Tunze123 »

I have the same problem. I suspect the problem is from this district level variable (i have 2 levels, households and districts). However i can not seem to understand what the problem is with this particular variable.
RECODE of ppfrag ((firstnm) ppfrag) Freq. Percent Cum.
NRM Only 4,256 50.85 50.85
FDC only 335 4 54.86
NRM+Independent NRM most 889 10.62 65.48
FDC + NRM 732 8.75 74.23
FDC + Independent 183 2.19 76.41
Independent 507 6.06 82.47
DP, UPC or both DP and UPC 209 2.5 84.97
NRM + FDC + Independent + DP or UPC 624 7.46 92.42
NRM + DP or UPC 429 5.13 97.55
NRM + FDC + Independent 205 2.45 100
Total 8,369 100

i still get the error when i run a PQL 2-level model. Kindly assist me how to resolve this problem.
Thanks
Post Reply