Page 1 of 1

How to change reference category in ordered logistic regression

Posted: Thu Jan 25, 2018 1:32 pm
by GerineLodder
I have a variable with 5 levels.
Level 5 is now automatically taken as the reference category (that is: I get intercept_1 thru intercept_4), but I want level 1 to be the reference category (i.e., have intercept_2 thru intercept_5 estimated).
What code do I have to add to change that?

If this information is available in any documentation, I would be happy if you could point me to that info as well (So far, I have worked through the Zang et al. 2016 paper, the "translation" of chapter 13 about ordered logistic regression into R2mlwin and the LEMMA course material, although that doesn't include Rcode).

Re: How to change reference category in ordered logistic regression

Posted: Fri Jan 26, 2018 9:57 am
by ChrisCharlton
To do this you can either use the R relevel() function (https://stat.ethz.ch/R-manual/R-devel/l ... level.html) as used at the beginning of http://www.bristol.ac.uk/cmm/media/r2ml ... rGuide10.R or you can specify the reference category in the model equation as in the section 11.4 A two-level model in http://www.bristol.ac.uk/cmm/media/r2ml ... rGuide11.R.

Re: How to change reference category in ordered logistic regression

Posted: Mon Jan 29, 2018 9:34 am
by GerineLodder
Could you indicate where in the function of 11.4 the reference category is specified?

I have tried replacing:

Code: Select all

Function <- logit(variable, cons, 5) ~ 1 + (1[1:4] |school)  
With:

Code: Select all

Function <- logit(variable, cons, 5) ~ 1 + (1[2:5] |school)  
But that doesn't work.

Re: How to change reference category in ordered logistic regression

Posted: Mon Jan 29, 2018 10:24 am
by ChrisCharlton
It's the third parameter of the logit() function. The three parameters are:
  1. Response
  2. Denominator
  3. Reference category
Note that the category specified needs to be the underlying value if it is a factor variable.

Re: How to change reference category in ordered logistic regression

Posted: Mon Jan 29, 2018 11:06 am
by GerineLodder
Thanks!! Thought the 5 was for "N categories", so good to know!