runmlwin error
runmlwin error
Hi
I am trying to fit a two level ordinal model with runmlwin. Using the stata, I imputed level-1 missing variables(multiple imputation). Now, I get the "mi estimate: command not supported" error as I try the following syntax. Why this happened and is there any solution?
mi est, saving(miest) cmdoc: runmlwin V_outcome5 V_SEXID cons, level2( TheKey: cons) level1( V_id:) discrete(dist(multinomial) link(ologit) denom(cons) basecategory(3)) nopause
I also tried the above syntax without mi est, again I got " type mismatch" error.
runmlwin V_outcome5 V_SEXID cons, level2( TheKey: cons) level1( V_id:) discrete(dist(multinomial) link(ologit) denom(cons) basecategory(3)) nopause
I appreciate your advises
Best, Ali
I am trying to fit a two level ordinal model with runmlwin. Using the stata, I imputed level-1 missing variables(multiple imputation). Now, I get the "mi estimate: command not supported" error as I try the following syntax. Why this happened and is there any solution?
mi est, saving(miest) cmdoc: runmlwin V_outcome5 V_SEXID cons, level2( TheKey: cons) level1( V_id:) discrete(dist(multinomial) link(ologit) denom(cons) basecategory(3)) nopause
I also tried the above syntax without mi est, again I got " type mismatch" error.
runmlwin V_outcome5 V_SEXID cons, level2( TheKey: cons) level1( V_id:) discrete(dist(multinomial) link(ologit) denom(cons) basecategory(3)) nopause
I appreciate your advises
Best, Ali
-
- Site Admin
- Posts: 432
- Joined: Fri Apr 01, 2011 2:14 pm
Re: runmlwin error
Dear Ali,
Let's focus on the more fundamental problem of your "type mismatch" error. Its not immediately obvious what the source of this error is, so lease will you run the following two commands and then copy and paste the entire resulting Stata Results window output including any error messages for us.
Many thanks
George
Let's focus on the more fundamental problem of your "type mismatch" error. Its not immediately obvious what the source of this error is, so lease will you run the following two commands and then copy and paste the entire resulting Stata Results window output including any error messages for us.
Many thanks
George
Code: Select all
. tabulate V_outcome5, miss
. runmlwin V_outcome5 cons, level1(V_id:) discrete(dist(multinomial) link(ologit) denom(cons) basecategory(3)) nopause
Re: runmlwin error
Hi Dear George
I did what you asked me;
tabulate V_outcome5,miss
. runmlwin V_outcome5 cons, level1(V_id:) discrete(dist(multinomial) link(ologit) denom(cons) basecategor
> y(3)) nopause
type mismatch
r(109);
I did what you asked me;
tabulate V_outcome5,miss
Code: Select all
V_outcome5 | Freq. Percent Cum.
------------+-----------------------------------
No injury | 19,067 91.51 91.51
Injured | 1,610 7.73 99.23
Dead | 142 0.68 99.91
. | 18 0.09 100.00
-----------------------------------------------
Total | 20,837 100.00
> y(3)) nopause
type mismatch
r(109);
Last edited by ali482002 on Fri Feb 13, 2015 6:52 am, edited 1 time in total.
-
- Site Admin
- Posts: 432
- Joined: Fri Apr 01, 2011 2:14 pm
Re: runmlwin error
Apologies, I didn't realise that you had value labels attached, try ...
Code: Select all
. tabulate V_outcome5, miss nolabel
Re: runmlwin error
Code: Select all
. tabulate V_outcome5, miss nolabel
V_outcome5 | Freq. Percent Cum.
------------+-----------------------------------
1 | 19,067 91.51 91.51
2 | 1,610 7.73 99.23
3 | 142 0.68 99.91
. | 18 0.09 100.00
------------+-----------------------------------
Total | 20,837 100.00
-
- Site Admin
- Posts: 432
- Joined: Fri Apr 01, 2011 2:14 pm
Re: runmlwin error
Strange, I had assumed the problem was that you did not have a response category coded "3", which is required as you choose to omit "basecategory(3)". One thing you could try is dropping observations with missing values before you fit the model as we have seen rare instances previously where runmlwin gets thrown by missing values.
So try...
By the way, more generally, I do note that your third category "dead" is very rare in your data and that might pose problems down the line when you start to specify more complex models.
So try...
Code: Select all
. drop if V_outcome5>=.
. runmlwin V_outcome5 cons, level1(V_id:) discrete(dist(multinomial) link(ologit) denom(cons) basecategory(3)) nopause
Re: runmlwin error
Yes, the third category is rare.
drop if V_outcome5>=.
(18 observations deleted)
. runmlwin V_outcome5 cons, level1(V_id:) discrete(dist(multinomial) link(ologit) denom(cons) basecategor
> y(3)) nopause
type mismatch
drop if V_outcome5>=.
(18 observations deleted)
. runmlwin V_outcome5 cons, level1(V_id:) discrete(dist(multinomial) link(ologit) denom(cons) basecategor
> y(3)) nopause
type mismatch
-
- Site Admin
- Posts: 432
- Joined: Fri Apr 01, 2011 2:14 pm
Re: runmlwin error
I'm afraid it is still not obvious why you get the error you do. As you can see when I replicate your data I do not get any error...
COMMANDS
OUTPUT
Please can you confirm that the above commands work on your computer?
COMMANDS
Code: Select all
. clear
. set obs 20819
. generate V_id = _n
. generate V_outcome5 = .
. replace V_outcome5 = 1 in 1/19067
. replace V_outcome5 = 2 in 19068/20678
. replace V_outcome5 = 3 in 20678/20819
. tabulate V_outcome5
. generate cons = 1
. runmlwin V_outcome5 cons, level1(V_id:) discrete(dist(multinomial) link(ologit) denom(cons) basecategory(3)) nopause
. exit
Code: Select all
. clear
. set obs 20819
obs was 0, now 20819
. generate V_id = _n
. generate V_outcome5 = .
. replace V_outcome5 = 1 in 1/19067
(19067 real changes made)
. replace V_outcome5 = 2 in 19068/20678
(1611 real changes made)
. replace V_outcome5 = 3 in 20678/20819
(142 real changes made)
. tabulate V_outcome5
V_outcome5 | Freq. Percent Cum.
------------+-----------------------------------
1 | 19,067 91.58 91.58
2 | 1,610 7.73 99.32
3 | 142 0.68 100.00
------------+-----------------------------------
Total | 20,819 100.00
. generate cons = 1
. runmlwin V_outcome5 cons, level1(V_id:) discrete(dist(multinomial) link(ologit) denom(cons) basecategory(3
> )) nopause
MLwiN 2.32 multilevel model Number of obs = 20819
Ordered multinomial logit response model
Estimation algorithm: IGLS, MQL1
----------------------------------
Contrast | Log-odds
-------------+--------------------
1 | 1 vs. 2 3
2 | 1 2 vs. 3
----------------------------------
Run time (seconds) = 14.59
Number of iterations = 7
------------------------------------------------------------------------------
| Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
Contrast 1 |
cons_1 | 2.387202 .0249644 95.62 0.000 2.338272 2.436131
-------------+----------------------------------------------------------------
Contrast 2 |
cons_2 | 4.980548 .0830331 59.98 0.000 4.817807 5.14329
------------------------------------------------------------------------------
Re: runmlwin error
Hi Dear George
This is my computer outputs, but yet I have problem with "runmlwin command"
clear
. . set obs 20819
obs was 0, now 20819
. . generate V_id = _n
. . generate V_outcome5 = .
(20819 missing values generated)
. . replace V_outcome5 = 1 in 1/19067
(19067 real changes made)
. . replace V_outcome5 = 2 in 19068/20678
(1611 real changes made)
. . replace V_outcome5 = 3 in 20678/20819
(142 real changes made)
. . tabulate V_outcome5
V_outcome5 | Freq. Percent Cum.
------------+-----------------------------------
1 | 19,067 91.58 91.58
2 | 1,610 7.73 99.32
3 | 142 0.68 100.00
------------+-----------------------------------
Total | 20,819 100.00
.
. . generate cons = 1
.
. . runmlwin V_outcome5 cons, level1(V_id:) discrete(dist(multinomial) link(ologit) denom(cons) basecateg
> ory(3)) nopause
type mismatch
r(109);
This is my computer outputs, but yet I have problem with "runmlwin command"
clear
. . set obs 20819
obs was 0, now 20819
. . generate V_id = _n
. . generate V_outcome5 = .
(20819 missing values generated)
. . replace V_outcome5 = 1 in 1/19067
(19067 real changes made)
. . replace V_outcome5 = 2 in 19068/20678
(1611 real changes made)
. . replace V_outcome5 = 3 in 20678/20819
(142 real changes made)
. . tabulate V_outcome5
V_outcome5 | Freq. Percent Cum.
------------+-----------------------------------
1 | 19,067 91.58 91.58
2 | 1,610 7.73 99.32
3 | 142 0.68 100.00
------------+-----------------------------------
Total | 20,819 100.00
.
. . generate cons = 1
.
. . runmlwin V_outcome5 cons, level1(V_id:) discrete(dist(multinomial) link(ologit) denom(cons) basecateg
> ory(3)) nopause
type mismatch
r(109);
Re: runmlwin error
Dear George
I am wonder if I installed runmlwin properly on my computer. Although I installed it base on mnual several times and got "successful installation" message. How can I check that installation is correct?
Regards
I am wonder if I installed runmlwin properly on my computer. Although I installed it base on mnual several times and got "successful installation" message. How can I check that installation is correct?
Regards