Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Goodness of fit in logit

    I am running a logit function, and am struggling with the goodness of fit question (or more accurately explanatory power question).

    I understand that for logit function, Stata results a pseudo R^2, but I don't quite know what this pseudo R^2 is or how it's calculated.

    Also, we have been told to do confusion matrix after the logit. Not sure confusion matrix is standard terminology, but it's essentially a table that compares predictions to reals...
    Actual "yes" Actual "no"
    Predict "yes" 120 179
    Predict "no" 189 110
    Is there a command for or way to generate it quickly in Stata?
    Thank you for your help!

    Stata SE/17.0, Windows 10 Enterprise

  • #2
    It looks like what you want is the classification table, and you can get that with -estat classification- after -logit-. Note that by default, -estat classification- assumes a cutoff of predicted probability = 0.5 to distinguish "Predict yes" from "Predict no." In real life that is only occasionally useful. So give the matter some thought, and then use the -cutoff- option to specify a more meaningful value.

    -help estat classification-

    Concerning the pseudo-R2, that is the McFadden pseudo-R2. It is defined as 1 - ll/ll0, where ll is the log-likelihood of the fitted model, and ll0 is the log-likelihood of a constant-only model. As I don't make use of this myself, I can't tell you much about its strengths and weaknesses as a fit statistic, but maybe you can find something by looking it up by name.

    Comment


    • #3
      A few additional suggestions for assessing goodness-of-fit for logit regression:
      1. Evaluate the area under the receiver operating characteristic (ROC) curve using the lroc command
      2. Calculate Hosmer-Lemeshow goodness-of-fit statistics using the estat gof command
      3. Run a residuals-versus-fitted plot using the rvfplot2 command

      Comment

      Working...
      X