BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
lady8506
Quartz | Level 8

When I run proc lifetest, nearly all of my observations are deleted with the following message, "169 observations with invalid time, censoring, or strata values were deleted." I can't figure out why it's doing this. Below is my data after I create the censoring variable from the code I pasted below. I apologize if it's long, but I figured you want to see the whole thing. This survival analysis is supposed to model recurrence of breast cancer where LastFUStatus1 can = 4 meaning Alive, with recurrence and everything else does != alive with recurrence. DateFirstRecur1 is self-explanatory, it is the date the patient had their first recurrence of their cancer. Insurance status ( 0 = uninsured, 1 = insured): 

SAS Output
Duration in Months InsuranceStatus1 LastFUStatus1 DateFirstRecur1 censored_disease
.12.0
.0..0
241420JUN2016:00:00:001
.12.0
.0..0
.11.0
160706SEP2013:00:00:001
.12.0
.0..0
.12.0
.02.0
.1..0
.0..0
291425FEB2013:00:00:001
.12.0
.12.0
.12.0
.12.0
.12.0
.12.0
.12.0
.17.0
.12.0
.12.0
.02.0
.12.0
.1..0
.0..0
.0..0
.0..0
.12.0
.1..0
.12.0
.11.0
.12.0
.12.0
.12.0
.12.0
.12.0
.12.0
.12.0
.12.0
.1..0
.12.0
71.10NOV2008:00:00:001
.0..0
.12.0
.1..0
.12.0
.12.0
.12.0
.12.0
.0..0
181219NOV2014:00:00:001
111411MAY2010:00:00:001
.12.0
481808APR2013:00:00:001
.12.0
.12.0
.12.0
.12.0
471223FEB2011:00:00:001
.12.0
.12.0
.12.0
.12.0
.0..0
.12.0
.12.0
.1..0
131113NOV2009:00:00:001
.12.0
.12.0
.1..0
.1..0
.12.0
.12.0
.12.0
.12.0
.12.0
.0..0
.1..0
.12.0
.1..0
.02.0
.12.0
.12.0
.12.0
.1..0
.12.0
.1..0
.18.0
.12.0
.12.0
1011823MAR2010:00:00:001
.02.0
.1..0
.1..0
.12.0
.02.0
.12.0
.12.0
.02.0
.12.0
.12.0
.12.0
.15.0
.0..0
111805MAY2016:00:00:001
.12.0
.12.0
.12.0
.12.0
.12.0
.0..0
.12.0
.1..0
.1..0
.0..0
.18.0
.12.0
.12.0
.12.0
.12.0
.1..0
.12.0
.12.0
.12.0
.12.0
.12.0
.11.0
.12.0
.1..0
11.06MAR2001:00:00:001
.1..0
.12.0
391823JAN2015:00:00:001
.02.0
.18.0
.12.0
.12.0
.12.0
401216OCT2012:00:00:001
.02.0
.12.0
.0..0
121.21MAR2007:00:00:001
121.21MAR2007:00:00:001
.12.0
.0..0
.1..0
.12.0
.12.0
.02.0
.12.0
.1..0
.11.0
.12.0
.1..0
241702DEC2004:00:00:001
201714NOV2012:00:00:001
.1..0
.12.0
661404MAR2016:00:00:001
.11.0
.1..0
.0..0
331804NOV2011:00:00:001
.12.0
.1..0
.12.0
.1..0
.1..0
.1..0
.0..0
.12.0
.0..0
131.02APR2002:00:00:001
.01.0
.1..0
.12.0
391830NOV2010:00:00:001
.0..0
.12.0
.12.0
.12.0
.0..0
.05.0
.12.0
.12.0
.0..0


 

And here is my code: 

DATA disease_interval; SET trends_temp5;

months = intck("dtmonth", DateOfInitDx1, DateFirstRecur1);
put months =;

	IF LastFUStatus1 = 4 or not missing(DateFirstRecur1) then censored_disease = 1;
	ELSE IF LastFUStatus1 ne 4 or missing(DateFirstRecur1) then censored_disease = 0;

*Delete ****** due to inconsistent data;
IF Lname = "HO*****" and Fname = "K******" then DELETE;
LABEL months = "Duration in Months";

RUN;

PROC LIFETEST DATA = disease_interval plots = survival(cb=hw test atrisk(outside(0.10))) graphics;
FORMAT InsuranceStatus1 InsuranceType.;
strata InsuranceStatus1;
time months*censored_disease(0);
symbol1 v=none;
RUN;
And my output: 
SAS Output
Summary of the Number of Censored and Uncensored ValuesStratum InsuranceStatus1 Total Failed Censored PercentCensored1 Insured2 UninsuredTotal  
212100.00
1100.00
222200.00

Note:169 observations with invalid time, censoring, or strata values were deleted.
1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

@lady8506 wrote:

So it appears the records were deleted due to missing their date of first recurrence.


The censored cases do not miss a date of first recurrence because apparently they did not have a recurrence. But nevertheless variable months needs to contain valid values for these cases, too. From your definition I guessed this should be the number of months from DateOfInitDx1 to the date when they were censored. So, the final definition of months might have the form

months = intck("dtmonth", DateOfInitDx1, coalesce(DateFirstRecur1, DateOfLastFU));

where DateOfLastFU  contains the datetime values of the last follow-up visit or whatever the censoring datetime is in your data. For missing values of DateFirstRecur1 the COALESCE function would return the value of DateOfLastFU  (assuming that only the censored cases have missing DateFirstRecur1).

View solution in original post

4 REPLIES 4
FreelanceReinh
Jade | Level 19

@lady8506 wrote:

When I run proc lifetest, nearly all of my observations are deleted with the following message, "169 observations with invalid time, censoring, or strata values were deleted." I can't figure out why it's doing this. (...) 

months = intck("dtmonth", DateOfInitDx1, DateFirstRecur1);
(...)

PROC LIFETEST DATA = disease_interval ...;
strata InsuranceStatus1;
time months*censored_disease(0);

 

 

Hello @lady8506,

 

Just look through the three types of values mentioned in the log message:

  1. time: You didn't tell what DateOfInitDx1 is, but regardless of its values it's clear from the definition that time variable months will have missing (hence invalid) values for all observations with missing DateFirstRecur1. I see 169 missings of DateFirstRecur1 in your table.
  2. censoring: Variable censored_disease is 0 or 1 for each observation, which are valid values.
  3. strata: Variable InsuranceStatus1 is 0 or 1 for each observation, which are valid values.

So, the issue is that you didn't supply valid time values for the censored cases. I guess these should be the number of months from DateOfInitDx1 to the censoring date.

lady8506
Quartz | Level 8

Thank you Freelance. So it appears the records were deleted due to missing their date of first recurrence. Hmmm. Is there a way to get them back into the analysis or is that not an option?

 

FreelanceReinh
Jade | Level 19

@lady8506 wrote:

So it appears the records were deleted due to missing their date of first recurrence.


The censored cases do not miss a date of first recurrence because apparently they did not have a recurrence. But nevertheless variable months needs to contain valid values for these cases, too. From your definition I guessed this should be the number of months from DateOfInitDx1 to the date when they were censored. So, the final definition of months might have the form

months = intck("dtmonth", DateOfInitDx1, coalesce(DateFirstRecur1, DateOfLastFU));

where DateOfLastFU  contains the datetime values of the last follow-up visit or whatever the censoring datetime is in your data. For missing values of DateFirstRecur1 the COALESCE function would return the value of DateOfLastFU  (assuming that only the censored cases have missing DateFirstRecur1).

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 3336 views
  • 2 likes
  • 2 in conversation