0

I am running a logistic regression model on a very small data set (n=78). I partitioned these data at 0.7 and when I tested the predictive ability of my selected model the accuracy was 0. The code I used to determine accuracy is below:

fitted.results <- predict(s0, newdata=test, type = 'response')
fitted.results <- ifelse(fitted.results > 0.5,1,0)
misClasificError <- mean(fitted.results !=test$Pluck)
print(paste('Accuracy', 1-misClasificError))

I'm unsure of whether this result is an artifact of my small sample size or not. The pseudoR2 value is decent (~.50) and the AUC is very high (0.96). Any advice would be greatly appreciated!

MrFlick
  • 195,160
  • 17
  • 277
  • 295
  • are you sure that `test$Pluck` is coded 0 and 1? how's the in-sample predictive accuracy? in any case, not much can be said without the data. – amatsuo_net Aug 04 '17 at 17:30
  • 2
    Something's wrong, but you haven't shared enough for us to be able to diagnose it. Nothing in your code jumps out. Maybe you could [make a reproducible example](https://stackoverflow.com/q/5963269/903061)? Is `test$Pluck` your response? Is it numeric, 0/1 coded? – Gregor Thomas Aug 04 '17 at 17:30

0 Answers0