BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
SSimonov
Fluorite | Level 6

Hi everyone, hopefully someone can help me out with this puzzle.

I'm using a Proc Lifetest with the following setup:

proc lifetest data =getdata(where=(aval^=.)) timelist = (3 6 9 12 18) alpha = 0.05;
    time aval * CNSR(1);
    by TRTGRPN;
    survival out = atrisk conftype = loglog reduceout;
run;

For whatever reason the number of survivors at each timepoint from the list (the LEFT column) is being suppressed, even though NOLEFT option is not specified. I'm confused why this is happening, since the survival % is calculated just fine.

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
Interesting, probably a leftover from an older version of SAS.

If you can see it in the ODS output, use this method to capture that table:
https://blogs.sas.com/content/iml/2017/01/09/ods-output-any-statistic.html

View solution in original post

5 REPLIES 5
Reeza
Super User

Which output, the displayed output or a table?

 

Your code appears to have some syntax errors, survival isn't a valid statement.

    survival out = atrisk conftype = loglog reduceout;

Can you post the log?

 

Documentation for lifetest:

https://documentation.sas.com/doc/en/statug/15.2/statug_lifetest_syntax.htm

 


@SSimonov wrote:

Hi everyone, hopefully someone can help me out with this puzzle.

I'm using a Proc Lifetest with the following setup:

proc lifetest data =getdata(where=(aval^=.)) timelist = (3 6 9 12 18) alpha = 0.05;
    time aval * CNSR(1);
    by TRTGRPN;
    survival out = atrisk conftype = loglog reduceout;
run;

For whatever reason the number of survivors at each timepoint from the list (the LEFT column) is being suppressed, even though NOLEFT option is not specified. I'm confused why this is happening, since the survival % is calculated just fine.


 

SSimonov
Fluorite | Level 6

The Survival statement is what was left by previous programmer, the idea behind it's use is unclear to me.

Here's the log after the procedure's execution:

2023      +proc lifetest data =getdata(where=(aval^=.)) timelist = (3 6 9 12 18) alpha = 0.05;
MPRINT(SCSM):   proc lifetest data =getdata(where=(aval^=.)) timelist = (3 6 9 12 18) alpha = 0.05;
2024      +   time aval * CNSR(1);
MPRINT(SCSM):   time aval * CNSR(1);
2025      +   by TRTGRPN;
MPRINT(SCSM):   by TRTGRPN;
2026      +   survival out = atrisk conftype = loglog reduceout;
MPRINT(SCSM):   survival out = atrisk conftype = loglog reduceout;
2027      +run;
MPRINT(SCSM):   run;

NOTE: The data set WORK.ATRISK has 35 observations and 8 variables.
NOTE: The PROCEDURE LIFETEST printed pages 26-32.

The ODS output contains Left and Failed numbers, but I need them in the dataset.

Reeza
Super User
Interesting, probably a leftover from an older version of SAS.

If you can see it in the ODS output, use this method to capture that table:
https://blogs.sas.com/content/iml/2017/01/09/ods-output-any-statistic.html
FreelanceReinh
Jade | Level 19

@Reeza wrote:
Interesting, probably a leftover from an older version of SAS.

Exactly. The SURVIVAL statement appears to have been introduced in SAS 9.0 (cf. SAS/STAT® 9.1 User’s Guide linked in SAS 9.1.3 Documentation), but in version 9.2 its options were moved to the PROC LIFETEST statement (with OUT= renamed to OUTSURV=, alias: OUTS=), of course leaving the old statement valid. This change, although 15 years old, is still mentioned even in the latest SAS Viya documentation (see penultimate paragraph of Overview: LIFETEST Procedure).

SSimonov
Fluorite | Level 6

Totally forgot about this and it worked perfectly.

Thank you.

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 5 replies
  • 1041 views
  • 8 likes
  • 3 in conversation