How to give labels to predictions instead of probabilities in logit in R

logistic_regression

#1

Hello,

I am trying to fit a logit model on the data using:

 predict.glm <- predict(mylogit, data, type="response")

However there is a warning message:

Warning message:
In predict.lm(object, newdata, se.fit, scale = 1, type = ifelse(type ==  :
  prediction from a rank-deficient fit may be misleading

Is this because in the case of logit prob are assigned instead of class labels?
Is there any way I can assign labels 1/0 for prob above a certain cutoff value?
Also,in a logit model how do i know whether the prob is of 1 or 0,or is it that if more number of obs have 1 as label then the model is on 1 and not 0??


#2

Hi ,
Logistic equation yields probability of outcome rather than class . You can assign class to Probability based on predicted value .This is based on thresh hold , that you decided on sensitivity, specificity of model . By default , if Probability greater than equal 0.5 assign class = 1 else class = 0 .