Re: [R] Declaring All Variables as Factors in GLM()

2016-04-30 Thread Leonardo Ferreira Fontenelle
This should do the trick: history2 <- as.data.frame(lapply(history, as.factor)) Mind you that read.csv() by default reads string vectors as factors, so that declaring the variables as factors should only be necessary for the numeric ones, like income. Using as.factor() in factor variables may dro

[R] Declaring All Variables as Factors in GLM()

2016-04-30 Thread Preetam Pal
Hi guys, I am running glm(y~., data = history,family=binomial)-essentially, logistic regression for credit scoring (y = 0 or 1). The dataset 'history' has 14 variables, a few examples: history <- read.csv("history.csv". header = TRUE) 1> 'income = 100,200,300 (these are numbers in my dataset; howe