BookmarkSubscribeRSS Feed
tinghlin
Fluorite | Level 6

i have a data s follows: there are only 2 variables, age group (age) and survival time (time). there is no censoring observations. 

 input age $ time ;
cards;
"<=40" 2
"<=40" 3
"<=40" 6
"<=40" 6
"<=40" 7
"<=40" 10
"<=40" 15
"<=40" 15
"<=40" 16
"<=40" 27
"<=40" 30
"<=40" 32
">40" 1
">40" 1
">40" 1
">40" 1
">40" 2
">40" 3
">40" 3
">40" 9
">40" 22
;

 

i have two questions:

1) did i enter the data correctly?

2)  how do i conduct a log-rank test to compare survival curves between 2 age groups?

1 REPLY 1
FreelanceReinh
Jade | Level 19

Hello  @tinghlin,

 


@tinghlin wrote:

1) did i enter the data correctly?


You can work with the data as shown, but it is more common to store character values without enclosing quotation marks:

data have;
input age $ time;
cards;
<=40 2
<=40 3
...

 


2)  how do i conduct a log-rank test to compare survival curves between 2 age groups?


This is typically done with PROC LIFETEST. In the absence of censored observations (as in your example) this step looks like this:

proc lifetest data=have;
time time;
strata age;
run;

where you would replace "have" with the name of your input dataset containing variables time and age.

 

You find the result under "Test of Equality over Strata" in the PROC LIFETEST output:

       Test of Equality over Strata

                                   Pr >
Test      Chi-Square      DF    Chi-Square

Log-Rank      6.1690       1      0.0130
Wilcoxon      7.8000       1      0.0052
-2Log(LR)     5.4753       1      0.0193

So the log-rank test detects a significant difference between the survival curves of the two age groups (assuming a significance level a=0.05).

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 1 reply
  • 283 views
  • 0 likes
  • 2 in conversation