0

I am trying to run a glm regression analysis. I am getting an error

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

Now I have read many threads where this problem has been discussed by using debug_contr_error(data) but I am getting another error that

# Error in debug_contr_error(data) : 
  could not find function "debug_contr_error"

I think I am missing some package installation here. Can anyone please help. The code that I am using for glm regression (my data frame is 'data' and placed is one of the column names)

model <- glm(placed ~.,family=binomial(link='logit'),data=data)
MrFlick
  • 195,160
  • 17
  • 277
  • 295
shrutya m
  • 29
  • 4
  • 1
    That function is defined in this answer: https://stackoverflow.com/a/44201384/2372064. It is not something that's built into R itself or a package. – MrFlick May 06 '19 at 06:04
  • You are probably using a categorical predictor with just one level. As such it cannot contribute to the model. – Michael M May 06 '19 at 06:59

0 Answers0