fitstat -- Scalar measures of fit for regression models
General syntax
fitstat, [ save diff saving(name) using(name) force ic ]
Overview
fitstat is a post-estimation command that computes measures of fit for the following regression models:
clogit, cloglog, intreg, logistic, logit, mlogit, nbreg, ocratio, ologit, oprobit, poisson, probit, regress,
tnbreg, tpoisson, zinb, zip, ztnb, ztp. With the save and diff options (or saving() and using()), fitstat
compares fit measures for two models.
For all models, fitstat reports the log-likelihoods of the full and intercept-only models, the deviance (D),
the likelihood ratio or Wald chi-square, Akaike's Information Criterion (AIC), AIC/N, and the Bayesian
Information Criterion (BIC).
Except for regress, fitstat reports McFadden's R2, McFadden's adjusted R2, the maximum likelihood R2, and
Cragg & Uhler's R2. These measures equal R2 for OLS regression. fitstat reports R2 and the adjusted R2 after
regress. fitstat reports the regular and adjusted count R2 for models with categorical outcomes. For ordered
or binary logit or probit models, as well as models for censored data (tobit, cnreg, or intreg), it reports
McKelvey and Zavoina's R2. In addition, it reports Efron's R2 for logit or probit, and reports Tjur's
Coefficient of Discrimination for binary outcome models.
Not all measures are provided for models estimated with pweights or iweights.
Options
save saves the computed measures in a matrix for subsequent comparisons.
saving(name) is equivalent to save but allows you to save the current model with a name of 16 characters of
less.
diff compares the fit measures for the current model (i.e., the model in memory) with those saved using
save. If a likelihood-ratio test comparing the two models is permitted by Stata's lrtest command,
the results will be presented in the row labeled "p-value".
using(name) is equivalent to diff but allow you to refer to saved results by name used with saving().
force will provide comparisons and likelihood-ratio test results even if number of observations differs
or other differences suggest the comparison is invalid.
ic only presents information measures.
Examples
Compute fit statistics for a single model
. use mroz,clear
. logit lfp k5 k618 age wc hc lwg inc
. fitstat
Obtain AIC and BIC measures only
. fitstat, ic
Compare fit statistics for models
. logit lfp k5 k618 age wc hc lwg inc
. fitstat, save
. logit lfp k5 k618 age age2 wc hc lwg inc
. fitstat, diff
Compare fit statistics with named models
. logit lfp k5 k618 age age2 wc hc lwg inc
. fitstat, saving(agesq)
. logit lfp k5 k618 age wc hc lwg inc
. fitstat, using(agesq)
Citing SPost commands
When using these commands, we would appreciate it if you would cite:
J. Scott Long & Jeremy Freese. 2014. Regression Models for Categorical Dependent Variables Using
Stata, 3rd Edition. College Station, TX: Stata Press