obtaining level 2 residuals from multilevel ordinal model

Welcome to the forum for runmlwin users. Feel free to post your question about runmlwin 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 to runmlwin: Running MLwiN from within Stata >> http://www.bristol.ac.uk/cmm/software/runmlwin/
Post Reply
becciaa1992
Posts: 21
Joined: Thu Oct 17, 2019 12:21 am

obtaining level 2 residuals from multilevel ordinal model

Post by becciaa1992 »

Hi all,

I am trying to obtain the level 2 residuals from a null two-level ordinal model using runmlwin.

These models work fine:

Code: Select all

* Fit model using IGLS MQL1
runmlwin hiv cons,  ///
   level2(group: (cons, contrast(1/2))) ///
   level1(idcode:) ///
   discrete(dist(multinomial) link(ologit) denom(cons) basecategory(0)) ///
   nopause
  
* Fit model using MCMC
runmlwin hiv cons , ///
  level2(group: (cons, contrast(1/2))) /// 
  level1(idcode:) ///
  discrete(dist(multinomial) link(ologit) denom(cons) basecategory(0)) ///
  mcmc(orthogonal) initsprevious /// 
  nopause 
However, when I add in the code for residuals as I have done with multilevel logistic models with runmlwin, I get the following error:

Code: Select all

* Fit model using IGLS MQL1
runmlwin hiv cons,  ///
   level2(group: (cons, contrast(1/2))) ///
   level1(idcode:) ///
   discrete(dist(multinomial) link(ologit) denom(cons) basecategory(0)) ///
   nopause
  
* Fit model using MCMC
runmlwin hiv cons , ///
  level2(group: (cons, residuals(u) contrast(1/2))) /// 
  level1(idcode:) ///
  discrete(dist(multinomial) link(ologit) denom(cons) basecategory(0)) ///
  mcmc(orthogonal) initsprevious /// 
  nopause 
  
  Cannot specify reset or residual options at level 1, as no random part predictor variables are specified
r(198);
Is it possible to get the level 2 residuals with multilevel ordinal models using runmlwin? I looked at the sample code for runmlwin, and interestingly, this seemed to be the only model that didn't add the residuals(u) line in. Thanks in advance!
ChrisCharlton
Posts: 1351
Joined: Mon Oct 19, 2009 10:34 am

Re: obtaining level 2 residuals from multilevel ordinal model

Post by ChrisCharlton »

This works for me if I do the equivalent of the following:

Code: Select all

* Fit model using IGLS MQL1
runmlwin hiv cons,  ///
   level2(group: (cons, contrast(1/2))) ///
   level1(idcode:) ///
   discrete(dist(multinomial) link(ologit) denom(cons) basecategory(0)) ///
   nopause
  
* Fit model using MCMC
runmlwin hiv cons, ///
  level2(group: (cons, contrast(1/2)), residuals(u)) /// 
  level1(idcode:) ///
  discrete(dist(multinomial) link(ologit) denom(cons) basecategory(0)) ///
  mcmc(orthogonal) initsprevious /// 
  nopause
Can you please confirm that this works for you too?
becciaa1992
Posts: 21
Joined: Thu Oct 17, 2019 12:21 am

Re: obtaining level 2 residuals from multilevel ordinal model

Post by becciaa1992 »

yes, thank you so much!! it's always the comma placement that gets me :roll: :D
Post Reply