# Re: st: predict cs, csnell: missings

 From Verena Schoenleber To statalist@hsphsun2.harvard.edu Subject Re: st: predict cs, csnell: missings Date Tue, 15 Feb 2005 20:57:24 +0100

```thank you. i think that's the explanation!
verena

--
University of Konstanz
Germany

> Date: Mon, 14 Feb 2005 05:33:50 -0800 (PST)
> From: Ricardo Ovaldia <ovaldia@yahoo.com>
> Subject: Re: st: predict cs, csnell: missings
>
> - --- Verena Schoenleber
> <verena.schoenleber@uni-konstanz.de> wrote:
>
> > i am trying to test the overall model fit of my cox
> > model, using
> > cox-snell residuals.
>
> > the command predict cs, csnell
> > seems to work, but it generates a large amount of
> > missings.
> >
> > can anyone explain me what is going on? what can i
> > do solve the
> > problem?
>
> - -predict, csnell- will only compute the residual for
> observations without missing data. For example:
>
> . sysuse auto, clear
> (1978 Automobile Data)
>
> . stset   mpg foreign
>
>      failure event:  foreign != 0 & foreign < .
> obs. time interval:  (0, mpg]
>  exit on or before:  failure
>
> -
>
------------------------------------------------------------------------------
>        74  total obs.
>         0  exclusions
> -
>
------------------------------------------------------------------------------
>        74  obs. remaining, representing
>        22  failures in single record/single failure
> data
>      1576  total analysis time at risk, at risk from t
> =         0
>                              earliest observed entry t
> =         0
>                                   last observed exit t
> =        41
>
> . stcox  rep78 price, mgale(mg)
>
>          failure _d:  foreign
>    analysis time _t:  mpg
>
> Iteration 0:   log likelihood = -57.493118
> Iteration 1:   log likelihood = -53.497231
> Iteration 2:   log likelihood = -53.220366
> Iteration 3:   log likelihood = -53.218995
> Iteration 4:   log likelihood = -53.218995
> Refining estimates:
> Iteration 0:   log likelihood = -53.218995
>
> Cox regression -- Breslow method for ties
>
> No. of subjects =           69
> Number of obs   =        69
> No. of failures =           21
> Time at risk    =         1469
>                                                    LR
> chi2(2)      =      8.55
> Log likelihood  =   -53.218995
> Prob > chi2     =    0.0139
>
> -
>
------------------------------------------------------------------------------
>           _t | Haz. Ratio   Std. Err.      z    P>|z|
>    [95% Conf. Interval]
> -
>
-------------+----------------------------------------------------------------
>        rep78 |   1.342636   .4218106     0.94   0.348
>    .7253372    2.485289
>        price |   1.000263   .0000816     3.22   0.001
>    1.000103    1.000423
> -

>
> . predict cs, csnell
> (5 missing values generated)
>
> There are 5 observation that have missing rep78
> values, therefore there are 5 missing residuals.
>
> Hope this helps,
> Ricardo.
>
> =====
> Ricardo Ovaldia, MS
> Statistician
> Oklahoma City, OK
>

*
*   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/
```