Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: -estat gof- / -predict- fails after -svy : logit-


From   Stas Kolenikov <skolenik@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: -estat gof- / -predict- fails after -svy : logit-
Date   Wed, 13 Mar 2013 10:22:50 -0500

... for no apparent reason? I was able to trace the problem down to
-predict- command within -estat gof- that is the ultimate culprit: it
creates an empty variable that subsequent code cannot use. The best I
can think of is that the (continuous? omitted categories?) factor
variable specs throw it off:

. local model i._overseas c._nmage i._missage c.bage2 c.bage3 c.bage4
c.bage5 c.bage6 i.degree

. svy: logit badframe `model' if gender == "M"
(running logit on estimation sample)

note: 0b._missage != 1 predicts success perfectly
      0b._missage dropped and 573 obs not used
note: 1._missage omitted because of collinearity

Survey: Logistic regression

Number of strata   =        14                  Number of obs      =
13321
Number of PSUs     =     13321                  Population size    =
56346.166
                                                Design df          =
13307
                                                F(   9,  13299)    =
265.91
                                                Prob > F           =
0.0000

------------------------------
------------------------------------------------
             |             Linearized
    badframe |      Coef.   Std. Err.      t    P>|t|     [95% Conf.
Interval]
-------------+----------------------------------------------------------------
 1._overseas |   -.380414   .0477849    -7.96   0.000    -.4740793
-.2867487
      _nmage |   .1336642   .0196139     6.81   0.000      .095218
.1721103
  1._missage |          0  (empty)
       bage2 |   2.695409   .9082277     2.97   0.003     .9151534
4.475664
       bage3 |  -.6078499   .5425786    -1.12   0.263    -1.671381
.4556814
       bage4 |   1.608018    .505902     3.18   0.001     .6163786
2.599658
       bage5 |    .296858   .3456852     0.86   0.390    -.3807342
.9744503
       bage6 |   .1095162   .3955149     0.28   0.782    -.6657494
.8847818
             |
      degree |
          2  |    .183486    .361758     0.51   0.612    -.5256112
.8925832
          3  |   .7748747   .0880882     8.80   0.000     .6022093
.9475401
             |
       _cons |  -11.78445   2.041381    -5.77   0.000    -15.78585
-7.783053
------------------------------------------------------------------------------

. estat gof
no observations
r(2000);

. local amodel _overseas _nmage _missage bage2 bage3 bage4 bage5 bage6
i.degree

. svy: logit badframe `amodel' if gender == "M"
(running logit on estimation sample)

note: _missage != 0 predicts success perfectly
      _missage dropped and 573 obs not used

Survey: Logistic regression

Number of strata   =        14                  Number of obs      =
13321
Number of PSUs     =     13321                  Population size    =
56346.166
                                                Design df          =
13307
                                                F(   9,  13299)    =
265.91
                                                Prob > F           =
0.0000

------------------------------------------------------------------------------
             |             Linearized
    badframe |      Coef.   Std. Err.      t    P>|t|     [95% Conf.
Interval]
-------------+----------------------------------------------------------------
   _overseas |   -.380414   .0477849    -7.96   0.000    -.4740793
-.2867487
      _nmage |   .1336642   .0196139     6.81   0.000      .095218
.1721103
    _missage |          0  (omitted)
       bage2 |   2.695409   .9082277     2.97   0.003     .9151534
4.475664
       bage3 |  -.6078499   .5425786    -1.12   0.263    -1.671381
.4556814
       bage4 |   1.608018    .505902     3.18   0.001     .6163786
2.599658
       bage5 |    .296858   .3456852     0.86   0.390    -.3807342
.9744503
       bage6 |   .1095162   .3955149     0.28   0.782    -.6657494
.8847818
             |
      degree |
          2  |    .183486    .361758     0.51   0.612    -.5256112
.8925832
          3  |   .7748747   .0880882     8.80   0.000     .6022093
.9475401
             |
       _cons |  -11.78445   2.041381    -5.77   0.000    -15.78585
-7.783053
------------------------------------------------------------------------------

. estat gof

Logistic model for badframe, goodness-of-fit test

                   F(9,13299) =         6.85
                     Prob > F =         0.0000



-- Stas Kolenikov, PhD, PStat (SSC)
-- Senior Survey Statistician, Abt SRBI
-- Opinions stated in this email are mine only, and do not reflect the
position of my employer
-- http://stas.kolenikov.name
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index