BookmarkSubscribeRSS Feed
Tiny_Kane
Obsidian | Level 7

Hi there,

 

I am trying to fit a cox regression with time dependent covariate. I am pretty new to this method. I looked related paper and the SAS PHREG guide, however none of them fit my case. the measurement X was repeatedly taken and it is time dependent. I want to estimate the effect of X on the death. However, the follow-up for this study is very long, it can be up to 10 years. The unit of the time to death is days. I cannot use any array function when preparing the dataset  for the PHREG. The array is always out of range. Does any body have any recommendation? Thank you very much in advance. 

Data example. 

ID  X X_date death time to death
1 23 1/1/2003 1 1880
1 15 2/1/2007 1 1880
1 27 1 1880
1 28 1 1880
1 20 1 1880
2 0 2990
2 0 2990
2 0 2990
2 0 2990
2 0 2990
2 0 2990
2 0 2990
2 0 2990
3 REPLIES 3
SteveDenham
Jade | Level 19

How large are the arrays?  If you are getting "out of range" errors, test your code in a DATA step, and if it still occurs, share the pertinent section of the log.  I don't know what the maximum dimension of an array can be, but I don't think it is less than 3650 (ten years counting by day).  Therefore, I suspect that there is something unusual in your situation that is causing the out of range error.

 

SteveDenham.

Tiny_Kane
Obsidian | Level 7

Please see the error log below. Thank you. 

Tiny_Kane_0-1595348542428.png

 

SteveDenham
Jade | Level 19

Here is a link to someone who had a very similar problem, and the answers they received:

https://communities.sas.com/t5/SAS-Procedures/ERROR-Array-subscript-out-of-range-at-line/td-p/478927 

 

SteveDenham

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
  • 3 replies
  • 621 views
  • 0 likes
  • 2 in conversation