Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Out-of-sample predictions after streg


From   "Steinar Fossedal" <[email protected]>
To   <[email protected]>
Subject   st: Out-of-sample predictions after streg
Date   Tue, 14 Feb 2006 23:47:42 +0100

Hi, I'm (still) having problems getting out-of-sample predictions after
fitting a model using -streg-. I've attached a dump showing how no
cumulative predictions of survival and cox-snell are calculated when
using my validation data. (Notice how the number of missing observations
equal the total observations in the dataset.) If I need to direct this
problem elsewhere, please let me know where to turn to.

Thank you,
Steinar



. tab validering if time==1 & !outlier

 validering |      Freq.     Percent        Cum.
------------+-----------------------------------
          0 |     19,097       66.67       66.67
          1 |      9,546       33.33      100.00
------------+-----------------------------------
      Total |     28,643      100.00

. stset time if !validering & !outlier, id(contract) failure(default)

                id:  contract
     failure event:  default != 0 & default < .
obs. time interval:  (time[_n-1], time]
 exit on or before:  failure
            if exp:  !validering & !outlier

------------------------------------------------------------------------
----
   573134  total obs.
   216170  ignored at outset due to -if <exp>-
    28308  obs. begin on or after (first) failure
------------------------------------------------------------------------
----
   328656  obs. remaining, representing
    19097  subjects
     2020  failures in single failure-per-subject data
 431774.1  total analysis time at risk, at risk from t =         0
                             earliest observed entry t =         0
                                  last observed exit t =     63.01

. quietly streg x1-x7, d(lognorm) frailty(invgauss)

. predict s, surv
(option unconditional assumed)
(244478 missing values generated)

. predict h, haz
(option unconditional assumed)
(244478 missing values generated)

. predict cs, csurv
(option unconditional assumed)
(244478 missing values generated)

. predict ccsnell, ccsnell
(option unconditional assumed)
(554037 missing values generated)

. stset time if validering & !outlier, id(contract) failure(default)

                id:  contract
     failure event:  default != 0 & default < .
obs. time interval:  (time[_n-1], time]
 exit on or before:  failure
            if exp:  validering & !outlier

------------------------------------------------------------------------
----
   573134  total obs.
   392461  ignored at outset due to -if <exp>-
    13729  obs. begin on or after (first) failure
------------------------------------------------------------------------
----
   166944  obs. remaining, representing
     9546  subjects
     1004  failures in single failure-per-subject data
 217923.7  total analysis time at risk, at risk from t =         0
                             earliest observed entry t =         0
                                  last observed exit t =        65

. predict sv, surv
(option unconditional assumed)
(406190 missing values generated)

. predict hv, haz
(option unconditional assumed)
(406190 missing values generated)

. predict csv, csurv
(option unconditional assumed)
(573134 missing values generated)

. predict ccsnellv, ccsnell
(option unconditional assumed)
(573134 missing values generated)

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index