[R] Error in contrasts message when using logistic regression code.

hoguejm hoguejm at gmail.com
Tue Oct 23 20:43:54 CEST 2012

I have a rather large data set (about 30 predictor variables)

I need to preform a logistic regression on this data. My response variable
is binary.

My code looks like this:

mylogit <- glm(Enrolled ~ A + B + C + ... + EE, data = data, family =

with A,B,C, ... as my predictor variables. Some categorical, some
continuous, some binary.

I run the code and get this error:

Error in `contrasts<-`(`*tmp*`, value = contr.funs[1 + isOF[nn]]) : 
  contrasts can be applied only to factors with 2 or more levels

Any ideas on how to fix this? I am fairly new to R so Im guessing there is
something missing/wrong in my logit code. 


View this message in context: http://r.789695.n4.nabble.com/Error-in-contrasts-message-when-using-logistic-regression-code-tp4647198.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list