R Studio Error message: Error in `contrasts<-`(`*tmp*`, value = contr.funs[1 + isOF[nn]]) :

28 Views Asked by At

I cannot resolve this "error in contrasts" when I run a multiple regression in R. Steps I've taken in R Script:

  1. I've checked for all new or updated packages and versions
  2. the csv file is in my working directory
  3. the dataframe (creddf) has been checked for two factors in the binary data(0 and 1)
  4. there is no missing data (ran sum(is.na(creddf)
  5. installed and loaded packages tidyverse & car
  6. reviewed the code several times, looks right!
  7. for each of the binary variables, used factors for each (i.e. creddf$Student<-factor(creddf$Student,levels = c(0,1),labels = c("Non Student","Student"))

What is the problem? Please help. (Oh, and I even uninstalled and reinstalled R to just make sure...)

I've checked for all new or updated packages and versions

the csv file is in my working directory

the dataframe (creddf) has been checked for two factors in the binary data(0 and 1)

there is no missing data (ran sum(is.na(creddf)

installed and loaded packages tidyverse & car console R reviewed the code several times, looks right! Error in contrasts<-(*tmp*, value = contr.funs[1 + isOF[nn]]) : contrasts can be applied only to factors with 2 or more levels

0

There are 0 best solutions below