Announcement

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

  • Difference between "fracreg" and "glm family(binomial) link(logit)"

    Hello everyone,

    I would be eager to know the difference between commands for fractional logistic regression. When I run "fracreg" or "glm family(binomial) link(logit)" in Stata 14.2, the coefficient size remains the same but several other values like number of observations or confidence intervals change.

    You will find below the models and an example of the dependent variable data.

    1)
    Click image for larger version

Name:	1.png
Views:	1
Size:	16.0 KB
ID:	1492835




    2)
    Click image for larger version

Name:	2.png
Views:	1
Size:	20.8 KB
ID:	1492836



    The dependent variable is called "dvfrac_year" and takes form of fractions (originally 0,1 values) and is weigted in the models [fweight=cnt_total_year].

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input float dvfrac_year
             0
     .08333334
             1
           .75
           .75
             1
      .9333333
            .8
             0
     .14285715
           .25
     .16666667
             0
      .4285714
             0
             1
      .3333333
             0
            .5
          .375
      .9230769
      .8666667
             1
             1
          .125
             0
             0
      .4285714
             1
             0
            .2
      .8888889
             1
             1
            .2
             1
             1
             1
           .25
             1
           .05
     .44444445
      .2857143
             0
             0
             0
      .3333333
    .071428575
             1
      .8888889
             1
            .8
          .875
      .8333333
             1
           .75
      .3333333
             0
             0
             1
      .6666667
             1
      .3636364
            .3
             0
             1
            .8
           .25
             0
             0
             0
       .968254
      .9565217
      .8333333
          .875
      .3214286
          .125
     .15384616
      .2857143
             0
     .06896552
           .25
      .6666667
      .8666667
             1
             1
             0
             0
             0
            .8
      .7692308
     .27272728
            .3
            .5
      .4285714
             1
             1
             1
      .6666667
             1
    end
    Thank you and have a good one!

  • #2
    Regarding the number of observation reported. The update February 20, 2019 reported:
    Code:
        5.  fracreg with frequency weights reported the wrong number of observations.  This has been fixed.
             The reported coefficients, standard errors, test statistics, and confidence intervals were
             correct.
    If you want the same standard errors and CI then you need to use the same estimate of the variance-covariance matrix. In particular, under glm use the vce(robust) option:

    Code:
    . webuse 401k,clear
    
    . fracreg logit prate mrate [fw = age] , nolog
    
    
    Fractional logistic regression                  Number of obs     =     33,360
                                                    Wald chi2(1)      =    2009.30
                                                    Prob > chi2       =     0.0000
    Log pseudolikelihood = -11719.937               Pseudo R2         =     0.0221
    
    ------------------------------------------------------------------------------
                 |               Robust
           prate |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
           mrate |   1.005281   .0224267    44.83   0.000     .9613253    1.049236
           _cons |   1.535889   .0130905   117.33   0.000     1.510232    1.561546
    ------------------------------------------------------------------------------
    
    . glm  prate mrate [fw = age], family(binomial) link(logit) vce(robust) nolog
    note: prate has noninteger values
    
    Generalized linear models                         No. of obs      =     33,360
    Optimization     : ML                             Residual df     =     33,358
                                                      Scale parameter =          1
    Deviance         =  6550.649419                   (1/df) Deviance =   .1963742
    Pearson          =  6781.513586                   (1/df) Pearson  =    .203295
    
    Variance function: V(u) = u*(1-u/1)               [Binomial]
    Link function    : g(u) = ln(u/(1-u))             [Logit]
    
                                                      AIC             =    .546216
    Log pseudolikelihood = -9108.883702               BIC             =  -340876.7
    
    ------------------------------------------------------------------------------
                 |               Robust
           prate |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
           mrate |   1.005281   .0224267    44.83   0.000     .9613253    1.049236
           _cons |   1.535889   .0130905   117.33   0.000     1.510232    1.561546
    ------------------------------------------------------------------------------

    Comment


    • #3
      Dear Scott,

      Thank you very much! When you reffer to an update from Feb. 20, do you mean an update of STATA or just the command which I could obtain by "ssc install"? Is there a web page to follow updates of specific commands or is "update query" the only way? Like setting a watchdog for a webpage would be more convenient than regulary checking "update query".

      I forgot that fracreg computes robust standard errors by default. This shall be actually reported even in the short help info, not only in the PDF version.

      Enjoy the day!

      Comment


      • #4
        Code:
        help whatsnew
        will show the Stata updates you have on your machine. This fracreg update occurred under the current release Stata 15.

        Comment


        • #5
          Well then, it is time for me to upgrade to Stata 15.

          Comment

          Working...
          X