I cannot resolve this "error in contrasts" when I run a multiple regression in R. Steps I've taken in R Script:
- 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
- reviewed the code several times, looks right!
- 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