Announcement

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

  • estat and fitstat show different BIC

    I want to get the AIC and BIC after fitting a model, but recently I found that estat and fitstat show very different results for BIC, see the log file below:

    Code:
    sysuse auto.dta, clear
    qui reg price weight length
    fitstat
    
    qui reg price weight length
    estat ic
    Click image for larger version

Name:	ICs.jpg
Views:	1
Size:	116.5 KB
ID:	1575259


    AIC is identical, but BIC is different. Which one should I use for AIC and BIC? Thanks.








  • #2
    I can't reproduce the problem you have. Please note that -fitstat- is not a part of Stata, and you are asked in the FAQ to identify its source. Fitstat is a user contributed command by Long and Freese (package -fitstat-), but is also included in their -spost13_ado- package.

    You may wish to check that you have the most updated package (see -adoupdate-).

    These are the results I get and BIC matches:

    Code:
    . which fitstat
    c:\Stata16\ado\plus\f\fitstat.ado
    *! 4.1.10 | 2017-01-05 | freese long | fixed bug in tobit (for v <14 and 15+)
    
    . sysuse auto.dta, clear
    (1978 Automobile Data)
    
    . qui reg price weight length
    
    . fitstat
    
                             |     regress
    -------------------------+-------------
    Log-likelihood           |            
                       Model |    -679.912
              Intercept-only |    -695.713
    -------------------------+-------------
    Chi-square               |            
             Deviance(df=71) |    1359.825
    -------------------------+-------------
    R2                       |            
                          R2 |       0.348
                 Adjusted R2 |       0.329
                    McFadden |       0.023
          McFadden(adjusted) |       0.018
                Cox-Snell/ML |       0.348
      Cragg-Uhler/Nagelkerke |       0.348
    -------------------------+-------------
    IC                       |            
                         AIC |    1365.825
            AIC divided by N |      18.457
                   BIC(df=3) |    1372.737
    
    . estat ic
    
    Akaike's information criterion and Bayesian information criterion
    
    -----------------------------------------------------------------------------
           Model |          N   ll(null)  ll(model)      df        AIC        BIC
    -------------+---------------------------------------------------------------
               . |         74  -695.7129  -679.9124       3   1365.825   1372.737
    -----------------------------------------------------------------------------
    Note: BIC uses N = number of observations. See [R] BIC note.

    Comment


    • #3
      looking at the differences in the results, my guess is that Neo Zhou has an old version of fitstat; try this and see if you get the same result (ignoring the /Users line of course)
      Code:
      . which fitstat
      /Users/rich/Library/Application Support/Stata/ado/plus/f/fitstat.ado
      *! 4.1.10 | 2017-01-05 | freese long | fixed bug in tobit (for v <14 and 15+)

      Comment


      • #4
        Ah, I see the problem. I do have an outdated fitstat. But when I was trying to use adoupdate to update all the packages, Stata did not find an updated version of fitstat.
        I uninstall fitstat, and reinstall it using ssc install fitstat, still, I got the version 1.6.4 installed. How you guys updated your fitstat?

        By the way, I was using Stata 16 on a Windows machine

        Comment


        • #5
          Try installing -spost13_ado- which will include, among other things, -fitstat-.

          Comment


          • #6
            Thanks. much appreciated.

            Comment

            Working...
            X