[R] reference category for factor in regression

Jos Elkink jos.elkink at ucd.ie
Mon Jan 19 15:15:58 CET 2009


Hi all,

I am struggling with a strange issue in R that I have not encountered
before and I am not sure how to resolve this.

The model looks like this, with all irrelevant variables left out:

LABOUR - a dummy variable
NONLABOUR = 1 - LABOUR
AGE - a categorical variable / factor
VOTE - a dummy variable

glm(VOTE ~ 0 + LABOUR + NONLABOUR + LABOUR : AGE + NONLABOUR : AGE,
family=binomial(link="logit"))

In other words, a standard interaction model, but I want to know the
intercepts and coefficients for each of the two cases (LABOUR and
NONLABOUR), instead of getting coefficients for the differences as in
a normal interaction model.

But the strange thing is, for the two occurances of the AGE variable,
it makes a different choice as to which AGE category to leave out of
the regression. The cross-table of AGE with LABOUR does not have empty
cells.

Anyone any idea what might be going wrong? Or what I could do about this?

Thanks in advance for any help!

Regards,

Jos

-- 
Johan A. Elkink
Lecturer
School of Politics and International Relations & CHS Graduate School
University College Dublin
Ph. +353 1 716 7026  |  Library Building, Rm 512
http://jaeweb.cantr.net




More information about the R-help mailing list