0

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?

kjetil b halvorsen
  • 63,378
  • 26
  • 142
  • 467
  • 7
    Searching on "caret no information rate" brings up https://topepo.github.io/caret/measuring-performance.html. (The p-value note seems fairly self explanatory. Perhaps you need to review your basic statistics.) – DWin Jul 31 '21 at 05:15
  • @IRTFM I know what is p-value in statistics, but p-value[Acc > NIR] is different from p-value and it is not in statistics, please see this question carefully. –  Jul 31 '21 at 05:31
  • 4
    This is the link in SO's [ask] page about research efforts expected: https://meta.stackoverflow.com/questions/261592/how-much-research-effort-is-expected-of-stack-overflow-users – DWin Jul 31 '21 at 06:34
  • See https://stats.stackexchange.com/questions/253407/how-to-calculate-information-included-in-rs-confusion-matrix/253435#253435 – kjetil b halvorsen Jul 31 '21 at 23:09

0 Answers0