BookmarkSubscribeRSS Feed
littleka
Calcite | Level 5

Hi all,

I am performing survival analysis with time-dependent covariates.

 

Essentially, the values for methadone_1-methadone_12 are either OTP, OBOT, both, or none. Same for otp_methadone_bup_1-otp_methadone_bup_12. Non_med_1-non_med_12 are either 0 or 1. There were no missing values when I ran frequency tables for all of these!

 

I continue getting the note that 606 event observations have missing values in the time-dependent covariates. 

 

Here is my proc phreg 

 

proc phreg data = outlib.EXAMPLE;
class age (ref='25-34') sex (ref='F') race (ref='White') ethnicity (ref='Not Hispanic')
         rural (ref='Urban')
         
         cancer (ref='0') chronic_kidney_disease (ref='0') chronic_lung_disease (ref='0')
         chronic_liver_disease (ref='0') diabetes_mellitus (ref='0') heart_disease (ref='0')
         obesity (ref='0') smoking (ref='0') meth_use_disorder (ref='0')
         cocaine_use_disorder (ref='0');
        
model dx_survival_months*covid_dx(0)=
/*demographics*/
age race ethnicity rural
/*comorbidities/predisposing conditions*/
cancer chronic_kidney_disease chronic_lung_disease chronic_liver_disease diabetes_mellitus
heart_disease obesity smoking meth_use_disorder cocaine_use_disorder
/*time dependent vars*/
m otp non

/ ties=efron risklimits;

ARRAY methadone_(*) methadone_1-methadone_12;
m = methadone_[dx_survival_months];

ARRAY otp_methadone_bup_(*) otp_methadone_bup_1-otp_methadone_bup_12;
otp = otp_methadone_bup_[dx_survival_months];

ARRAY non_med_(*) non_med_1-non_med_12;
non = non_med_[dx_survival_months];

format age age.;
run;

 

Any help is appreciated, and I can try to share more if this it is not clear. I'm not sure if it's an issue with how the time-dependent covariates are formatted in the data set, or what. Thanks!

4 REPLIES 4
Rick_SAS
SAS Super FREQ

I suspect there are 606  missing values for dx_survival_months. (Or maybe 202 missing values?) You are using that as an index into the 0/1 variables 

methadone_1-methadone_12
otp_methadone_bup_1-otp_methadone_bup_12
non_med_1-non_med_12

I think an array lookup such as methadone_[dx_survival_months] is resulting in a missing value when the index value (dx_survival_months) is missing.

littleka
Calcite | Level 5
Thank you for the response. Unfortunately in running a frequency table on the dx_survival_months variable, there are no missing values.
Rick_SAS
SAS Super FREQ

Interesting. Well, they are coming from somewhere, so I suggest you write a DATA step to manufacture the m, otp, and non variables. This will give you complete control over the variables and the ability to inspect them and, optionally, track down where the missing values are coming from.

 

On the other hand, PROC PHREG will drop the observations that have missing covariates, so maybe the problem will go away when you create the variables outside of the procedure.

littleka
Calcite | Level 5
I will definitely try that out, 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 ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 728 views
  • 0 likes
  • 2 in conversation