Page 1 of 1

obtaining level 2 residuals from multilevel ordinal model

Posted: Mon Jan 06, 2020 10:47 pm
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!

Re: obtaining level 2 residuals from multilevel ordinal model

Posted: Tue Jan 07, 2020 10:30 am
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?

Re: obtaining level 2 residuals from multilevel ordinal model

Posted: Tue Jan 07, 2020 11:33 am
by becciaa1992
yes, thank you so much!! it's always the comma placement that gets me :roll: :D