BookmarkSubscribeRSS Feed
tarheel13
Rhodochrosite | Level 12
data toxic;
input time group event;
datalines;
18 0 1
23 0 1
25 0 1
26 0 1
29 0 0
30 0 1
30 0 1
31 0 1
31 0 0
32 0 0
13 1 1
13 1 1
15 1 1
17 1 1
17 1 0
18 1 1
18 1 1
21 1 1
23 1 1
23 1 0
24 1 1
25 1 1
25 1 1
;
run;

ods pdf file='/home/lrackley0/Biostatistical Methods II/lifetest.pdf';
proc lifetest data=toxic;
	time time*event(0);
	strata group;
run;

ods pdf close;

Can someone please run this code and tell me what you get for median survival time for group 1? The 95% CI for median should be (15,25) but I am getting (15,.). Can anyone explain this? Why is it getting the wrong result? 

11 REPLIES 11
mkeintz
PROC Star

Running your program, I do not reproduce your results.  I get a range of 15,25 for median of group=1.  I get this via the ods pdf, using ods html, and in the results window.

 

 

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------
tarheel13
Rhodochrosite | Level 12

@mkeintz Thanks. Do you have any idea what could account for the discrepancy? I swear my output says 15,.

 

Is it a bug in SAS? I've been staring at this a long time. It is driving me insane. I have no idea what is going on. I have a track open with SAS support.

mkeintz
PROC Star

I had at first wondered if it was an ODS PDF problem, which is why I ran it also with ODS HTML.   But that didn't seem to be the case.

 

In your case, I would completely close down the SAS session, delete the PDF file, then reload the program, re-run, and re-view your new PDF file.  If that doesn't make it go away, perhaps someone else can diagnose.

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------
tarheel13
Rhodochrosite | Level 12

It makes no difference if i use pdf or not. I always get 15,. and other people are getting 15,25. I don't get the difference. I will wait for SAS support I guess. 

FreelanceReinh
Jade | Level 19

Hello @tarheel13,

 

Is the missing upper CL for the median the only discrepancy while all other statistics are correct? That would be strange. At least the upper CL for the third quartile should then be missing as well to be "consistent."

The LIFETEST Procedure

Stratum 2: group = 1

                 Product-Limit Survival Estimates

                                     Survival
                                     Standard    Number    Number
    time     Survival    Failure      Error      Failed     Left

  0.0000       1.0000           0           0       0        13
 13.0000            .           .           .       1        12
 13.0000       0.8462      0.1538      0.1001       2        11
 15.0000       0.7692      0.2308      0.1169       3        10
 17.0000       0.6923      0.3077      0.1280       4         9
 17.0000*           .           .           .       4         8
 18.0000            .           .           .       5         7
 18.0000       0.5192      0.4808      0.1430       6         6
 21.0000       0.4327      0.5673      0.1430       7         5
 23.0000       0.3462      0.6538      0.1381       8         4
 23.0000*           .           .           .       8         3
 24.0000       0.2308      0.7692      0.1317       9         2
 25.0000            .           .           .      10         1
 25.0000            0      1.0000           .      11         0

NOTE: The marked survival times are censored observations.


Summary Statistics for Time Variable time

                   Quartile Estimates

              Point         95% Confidence Interval
Percent    Estimate    Transform      [Lower      Upper)

     75     24.0000    LOGLOG        18.0000     25.0000
     50     21.0000    LOGLOG        15.0000     25.0000
     25     17.0000    LOGLOG        13.0000     21.0000


            Standard
    Mean       Error

 19.9231      1.3017


      Summary of the Number of Censored and Uncensored Values

                                                            Percent
Stratum           group       Total  Failed    Censored    Censored

      1               0          10       7           3       30.00
      2               1          13      11           2       15.38
-------------------------------------------------------------------
  Total                          23      18           5       21.74
tarheel13
Rhodochrosite | Level 12

@FreelanceReinh 

I am pasting my output. I am still waiting for someone who would be able to resolve this. I've never seen anything like it and no one I asked has been able to account for the discrepancy. 

 

75 24.0000 LOGLOG 18.0000 .
50 21.0000 LOGLOG 15.0000 .
25 17.0000 LOGLOG 13.0000 21.0000
FreelanceReinh
Jade | Level 19

@tarheel13 wrote:

@FreelanceReinh 

I am pasting my output. I am still waiting for someone who would be able to resolve this. I've never seen anything like it and no one I asked has been able to account for the discrepancy. 

 

75 24.0000 LOGLOG 18.0000 .
50 21.0000 LOGLOG 15.0000 .
25 17.0000 LOGLOG 13.0000 21.0000

How strange. So, at least the upper CL for the third quartile is also missing. But the other parts of the output, i.e. Mean, Standard Error, Survival Estimates and Censored Summary are exactly the same as shown in my output?

For example, your quartile estimates (and CLs) would be correct for a dataset where just the last two values of variable EVENT were changed from 1 to 0. But, of course, this change would affect other statistics as well.

 

Other things one could check in this situation:

  • Does the Kaplan-Meier plot look suspicious?
  • Have the ODS templates been modified?
  • Can examples from the documentation be reproduced?
  • What happens if data and code are simplified step by step? First step: Excluding group 0 and removing the STRATA statement should not change the results for group 1.

 

tarheel13
Rhodochrosite | Level 12

I did not touch any templates. Plot looks good to me. @FreelanceReinh @mkeintz mind telling me what version of SAS you guys are using? I tried SAS OnDemand and DM SAS. I am going to show you the response I got from SAS support. It seems to be something with a hot fix. My question is which one is correct? So I actually work as a statistical programmer and even though this was just for class, it's very important for me to get the right numbers in tables. I wouldn't want to put 25 if it was actually NE (not estimable). 

 

You didn't say what releases of SAS are involved here but one I think must be SAS9.4 TS1M6 =  SAS/STAT 15.1 with a Hot Fix applied for a bug with the quartile upper confidence limits (quartile UCL) or it could be SAS9.4 (TS1M7) = SAS/STAT 15.2 where the bug is fixed.  I think this would be for your system which is showing missing quartile UCL apparently.

 

So, I think I can explain why some quartile upper confidence limits (quartile UCL) may have changed to missing in SAS9.4 (TS1M6) = SAS/STAT 15.1 or in SAS9.4 (TS1M7) = SAS/STAT 15.2.

 

I suspect that your system has had the Hot Fix discussed on the Hot Fix tab in the following SAS Note applied which could cause the quartile UCL to change in 15.1; see the Hot Fix tab in the following SAS Note:

 

Problem Note 64617: The LIFETEST procedure produces incorrect upper confidence limits for the quartiles for certain data

https://support.sas.com/kb/64/617.html

 

Often we see that after the Hot Fix is applied that some  quartile UCL do not exist and are then reported as missing but this does not rule out other changes as well.  Note that the Hot Fix is specific to SAS9.4 (TS1M6) = SAS/STAT 15.1 and your professor should try applying it in that release.  

 

FreelanceReinh
Jade | Level 19

Now that you mention it, I remember that I had heard about this (somewhat alarming) Problem Note 64617, but I haven't applied the hot fix. I'm using SAS 9.4 (TS1M5) with SAS/STAT 14.3, so my printed results might be wrong.

 

Indeed, a manual calculation of the upper CL for the median suggests that it is not estimable and hence should really be missing:

  1. The calculation described in section Breslow, Fleming-Harrington, and Kaplan-Meier Methods of the documentation yields abs(...) values which are <1.95996... for event times t=15 (i.e., this is the lower CL) through t=24 (where abs(...)=1.92...) and not defined for t=25. This might still be regarded consistent with an upper CL of 25, but the definition continues with a peculiar turn: Suddenly, it considers "the curve that represents the upper confidence limits for the survivor function."
  2. This leads us to section Pointwise Confidence Limits in the OUTSURV= Data Set of the documentation. The manual calculation of that upper CL for the survivor function at t=24 yields 0.5047... (as is confirmed by the OUTSURV= dataset, variable SDF_UCL) and "not defined" for t=25 (OUTSURV= dataset has a trivial SDF_UCL=0 there). So, it appears that no non-trivial upper CL (of the SDF) drops below 0.5, which they say prevents the estimation of the upper CL of the median survival time.

Yet, strangely enough, the second condition of Problem Note 64617 is not met: The largest event time, t=25, is not "the first time the survival estimate drops below (1-p) for the 100pth percentile point," i.e., below 0.5. It's t=21 where that happens (0.43...).

tarheel13
Rhodochrosite | Level 12

I actually saved a CSV and ran this in R with survfit and also got NE so I'm inclined to believe that NE is more correct. It is kind of strange though. I don't really know how to apply the hot fix but I think I have a later version of SAS. I think the hot fix is not widely known. I think I will stop worrying about this but wish that it was more reliable and that all 3 of us got the same results. 

mkeintz
PROC Star

I am using SAS 9.4 (TS1M6)  and SAS/STAT 15.1.   I haven't done any hotfixes.

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 11 replies
  • 2236 views
  • 3 likes
  • 3 in conversation