Multivariate Ordered regression: error matrix dimensions

Welcome to the forum for REALCOM users. Feel free to post your question about REALCOM 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!

Go REALCOM (Developing multilevel models for REAListically COMplex social science data) >> http://www.bristol.ac.uk/cmm/software/realcom/
Post Reply
marcoseeber
Posts: 4
Joined: Mon Aug 20, 2012 1:18 pm

Multivariate Ordered regression: error matrix dimensions

Post by marcoseeber »

Hello,

I have ordinal responses (i), of respondents (ii) within universities (iii).
Since I have missing completely at random responses, I don't need imputation.

I use MLwiN to create the "ASCII text file output"
I open the Realcom program for factor structural model, open the file and name the columns, setting "university" as level-2 identifier.
I set responses and explanatory variables (included 'cons').

However, when I run the MCMC I receive the following error messages (I just copy the first lines):

"error using ==> times
Matrix dimensions must agree

error in Y predict at 10

(...) "

the same error messages occur with a simpler test file, which is the following (if it can help):

QUESTION1 QUESTION2 QUESTION3 COUNTRY CONS AGE WEALTH
1 1 0 1 1 34 156
2 0 1 1 1 35 159
3 1 2 1 1 36 157
4 1 1 1 1 37 160
0 2 2 1 1 38 158
2 1 2 2 1 39 161
2 3 3 2 1 40 159
2 0 4 2 1 41 162
2 0 0 2 1 42 160
3 4 1 2 1 43 163
3 0 2 3 1 44 161
4 4 4 3 1 45 158
4 4 3 3 1 46 155
1 4 4 3 1 47 152
0 0 1 3 1 48 149
3 1 3 4 1 49 146
3 0 3 4 1 50 143
4 4 3 4 1 51 140
1 4 0 4 1 52 137
2 4 0 4 1 53 134

please, what is the problem?

a second question: how can i specify that one of my explanatory variable is categorical?


many thanks!
Marco
Harvey Goldstein
Posts: 49
Joined: Sun Sep 06, 2009 5:30 pm

Re: Multivariate Ordered regression: error matrix dimensions

Post by Harvey Goldstein »

Re your second question categorical expl variables should be entered with dummy variable coding.
Re first Q try running as a single level model. Can you also confirm which are responses and which explanatory.
Harvey Goldstein
marcoseeber
Posts: 4
Joined: Mon Aug 20, 2012 1:18 pm

Re: Multivariate Ordered regression: error matrix dimensions

Post by marcoseeber »

Thank you very much,
the variables in the test file are the following:
- dependent variables: question 1, question 2, question 3
- level 2 identifier: "country"
- cons
- explanatory variables: age, wealth

I opened the file, named the variables, then tried a single level (I did not specify the level 2 identifier), but the equation window becomes grey, with nothing inside, and if I run the program it replies the same error message as the 2 level

the equation looks correct when I specify the level-2 identifier.
Marco Seeber
ChrisCharlton
Posts: 1351
Joined: Mon Oct 19, 2009 10:34 am

Re: Multivariate Ordered regression: error matrix dimensions

Post by ChrisCharlton »

Can you confirm whether you added any factors to the model before running it, as I am able to replicate the message that you saw if I have no factors, but as soon as I add one the model is estimated without errors?
marcoseeber
Posts: 4
Joined: Mon Aug 20, 2012 1:18 pm

Re: Multivariate Ordered regression: error matrix dimensions

Post by marcoseeber »

thanks!
I added the factors, constrained, and the model works.
best regards
Marco Seeber
marcoseeber
Posts: 4
Joined: Mon Aug 20, 2012 1:18 pm

Re: Multivariate Ordered regression: error matrix dimensions

Post by marcoseeber »

HEllo,
when inserting a categorical variable as a letter the program does not read the columns (only C1 appears when I name them).
You suggested to use DUMMY variable, then for each category I should insert a 0-1 dummy, like the following:

1 1 0 1 1 34 d
-9.999e+029 0 1 1 1 35 d
3 1 2 1 1 36 c
4 1 1 1 1 37 c
.
.

becomes:
1 1 0 1 1 34 1 0
-9.999e+029 0 1 1 1 35 1 0
3 1 2 1 1 36 0 1
4 1 1 1 1 37 0 1

many thanks
Marco Seeber
ChrisCharlton
Posts: 1351
Joined: Mon Oct 19, 2009 10:34 am

Re: Multivariate Ordered regression: error matrix dimensions

Post by ChrisCharlton »

Realcom only understands numeric variables, so you will need to generate the categorical dummies before importing the data.
Post Reply