Page 1 of 1

Multivariate Ordered regression: error matrix dimensions

Posted: Tue Aug 21, 2012 7:30 am
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

Re: Multivariate Ordered regression: error matrix dimensions

Posted: Mon Sep 24, 2012 2:29 pm
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

Re: Multivariate Ordered regression: error matrix dimensions

Posted: Tue Sep 25, 2012 7:09 am
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

Re: Multivariate Ordered regression: error matrix dimensions

Posted: Tue Sep 25, 2012 10:12 am
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?

Re: Multivariate Ordered regression: error matrix dimensions

Posted: Tue Sep 25, 2012 12:42 pm
by marcoseeber
thanks!
I added the factors, constrained, and the model works.
best regards
Marco Seeber

Re: Multivariate Ordered regression: error matrix dimensions

Posted: Fri Sep 28, 2012 2:36 pm
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

Re: Multivariate Ordered regression: error matrix dimensions

Posted: Mon Oct 01, 2012 8:50 am
by ChrisCharlton
Realcom only understands numeric variables, so you will need to generate the categorical dummies before importing the data.