I'm trying to get the Confusion Matrix for a probit model, nonetheless, i get the next error! Actually i know that length(Y) is bigger than length(pprobit) but i don't know how to fix this.
**Probit model coefficients**
probit<- glm(Y ~ X, family=binomial (link="probit"))
**Probit model predicted probabilities**
pprobit<- predict(probit, type="response")
**Percent correctly predicted values**
table(true = Y, pred = round(fitted(probit)))
**Error in table(true = Y, pred = round(fitted(probit))) :
all arguments must have the same length**
What i tried in order to fix the error:
1. na.omit(y)
2.
tab=table(true = Y[complete.cases(X)], pred = round( fitted(probit ))