Hello,

I'm fitting a logistic regression as follows and I have this error "In 
predict.lm(object, newdata, se.fit, scale = 1, type = ifelse(type ==  :
  prediction from a rank-deficient fit may be misleading"

Codes:
##Training 

fit<- glm(Y.Binary.training~., family=binomial(link="logit"), data=training)

pred<-predict(fit, training, type="response")
pred
pred.train<-cbind(pred, Y.Binary.training)
preds<-prediction(as.numeric(pred),as.numeric(Y.Binary.training))
perf<- performance(preds, "auc")
perf   #### I get a Roc Curve of 1 which is surprising!

##Testing
pred<-predict(fit, testing, type="response")
pred
pred.test<-cbind(pred, Y.Binary.testing)
preds<-prediction(as.numeric(pred),as.numeric(Y.Binary.testing))
perf<- performance(preds, "auc")
perf   #### I also get a ROC curve of 1...!!!

I'm wondering if there is something wrong in my codes .
Thanks a lot and happy holidays!
 

Best,Farnoosh Sheikhi
        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to