Statalist


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

Re: st: Different results using stdes and stsum


From   moleps islon <[email protected]>
To   [email protected]
Subject   Re: st: Different results using stdes and stsum
Date   Thu, 8 Oct 2009 11:42:56 +0200

Unfortunately I cannot send the data. However, after scrutinizing the
data I found that the SPSS file given to my had automatically divided
by 30.5 instead of 30 when creating the time_variable (month) like I
had done in stata. I get equivalent results between SPSS and stata
using stsum now. Thanks a lot for the information provided, Theresa.

Regards,
M


On Wed, Oct 7, 2009 at 5:44 PM, Theresa Boswell, StataCorp LP
<[email protected]> wrote:
> Moleps Islon <[email protected]> obtained different median survival times from
> the commands -stsum- and -stdescribe-.
>
>>>What is the difference in median time at risk per subject and median
>>>survival time? Which one to report?
>
> From the manual entry for -stdescribe-, we have the following statement:
>
>  "stdescribe produces a summary of the st data in a computer or data-based
> sense rather than in an analytical or statistical sense."
>
> The values obtained from -stdescribe- are the same as simply summarizing the
> time variable with the -summarize- command. Here is an example showing that the
> median time from -stdescribe- matches the median obtained from -summarize-.
>
> . webuse page2, clear
> . stdescribe
>
>         failure _d:  dead
>   analysis time _t:  time
>
>                                   |-------------- per subject --------------|
> Category                   total        mean         min     median        max
> ------------------------------------------------------------------------------
> no. of subjects               40
> no. of records                40           1           1          1          1
>
> (first) entry time                         0           0          0          0
> (final) exit time                     227.95         142        231        344
>
> subjects with gap              0
> time on gap if gap             0
> time at risk                9118      227.95         142        231        344
>
> failures                      36          .9           0          1          1
> ------------------------------------------------------------------------------
>
> . summarize time, detail
>
>                            time
> -------------------------------------------------------------
>      Percentiles      Smallest
>  1%          142            142
>  5%        149.5            143
> 10%        163.5            156       Obs                  40
> 25%          201            163       Sum of Wgt.          40
>
> 50%          231                      Mean             227.95
>                        Largest       Std. Dev.      46.37691
> 75%          245            296
> 90%          296            304       Variance       2150.818
> 95%        313.5            323       Skewness       .3677894
> 99%          344            344       Kurtosis       3.047023
>
> . /* stdescribe matches the median from summarize: 231 */
>
> The command -stsum- reports the median survival time based on analytical
> methods that take into account censoring, delayed entry, and gaps in history.
> This can be reproduced by estimating the survival function and finding the
> time corresponding to median survival. Here is an example:
>
> . sts generate s = s
>
> . summarize s, detail
>
>                           S(t+0)
> -------------------------------------------------------------
>      Percentiles      Smallest
>  1%     .0296852       .0296852
>  5%     .0445277       .0296852
> 10%     .0890555       .0593703       Obs                  40
> 25%      .282009       .0890555       Sum of Wgt.          40
>
> 50%     .5127436                      Mean           .5022545
>                        Largest       Std. Dev.      .2874161
> 75%          .75             .9
> 90%        .8875           .925       Variance        .082608
> 95%        .9375            .95       Skewness      -.0635524
> 99%         .975           .975       Kurtosis       1.788548
>
> . sort s
>
> . list time s if s<= `r(p50)' & s>= `r(p50)'-.1
>
>     +------------------+
>     | time           s |
>     |------------------|
>  19. |  232   .48575712 |
>  20. |  232   .48575712 |
>     +------------------+
>
> . /*stsum  matches the value of time where the median survival time occurs :
>    232*/
>
> Thus, the median reported survival time is not the same for the commands
> -stsum- and -stdescribe-.  The values from -stsum- are probably what you
> want to use.
>
> As for Moleps' question regarding results obtained from SPSS, we were not able
> to reproduce a difference in reported medians. We ask that Moleps send his
> dataset and commands to our technical support staff at [email protected]
> so that we can look into this issue further.
>
> --Theresa
> [email protected]
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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