I wrote a logistic regression and used confusionMatrix function of caret library to check the accuracy of this model. Here is my code.
library(caret)
fit=glm(Direction~Lag1+Lag2+Lag3+Lag4+Lag5+Volume,data=Weekly,family=binomial)
predicted <- factor(ifelse(predict(fit, type = "response") < 0.5, "Down", "Up"))
confusionMatrix(predicted, Weekly$Direction, positive = "Up")
Confusion Matrix and Statistics
Reference
Prediction Down Up
Down 54 48
Up 430 557
Accuracy : 0.5611
95% CI : (0.531, 0.5908)
No Information Rate : 0.5556
P-Value [Acc > NIR] : 0.369
Kappa : 0.035
Mcnemar's Test P-Value : <2e-16
Sensitivity : 0.9207
Specificity : 0.1116
Pos Pred Value : 0.5643
Neg Pred Value : 0.5294
Prevalence : 0.5556
Detection Rate : 0.5115
Detection Prevalence : 0.9063
Balanced Accuracy : 0.5161
'Positive' Class : Up
There are many information in confusionMatrix function. I can't understand the meaning of No Information Rage
and P-Value [Acc > NIR] : 0.369
.
Can anyone help me ,please?