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

Hi sas users!

I have a question regarding survival analysis.

I am working on the effect of lymphocyte/monocye ratio (which is a binary factor >2 vs <2) on the progression free survival.

I would like to plot this effect within each treatment arm (2 arms) and to use the approprial statistic test?

 

So far, i have created a categorical,  variable "d_groupe" as follow:

0= lmr<2 and treatment arm=1

1=lmr<2 and treatment arm=2

2=lmr>2 and treatment arm=1

3=lmr>2 and treatment arm=2 

 

Then i used proc lifetest to generate the graph:

 

ODS GRAPHICS ON;
PROC LIFETEST DATA=data plots=survival(cl test nocensor atrisk(outside));
TIME D_TIME_PFS_IRC_EMA*D_CENS_PFS_IRC_EMA(1);
STRATA d_groupe;
RUN;
ODS GRAPHICS OFF;

 

Is it the correct way to do it and which statistical test is needed?

 

Thank you in advance for your help

Romain

 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

@Romain69100 wrote:

Thank you for your answer.

 

Graphically i would like to have a red solid line for the "0" group and a blue solid line for the "1" group  and a red dotted line for the "2" group and and a blue dotted line for the "3" group?

 

Do you know how to compute this?

 

Thanks again

 


My generic suggestion for any appearance controls is to extract data from the procedure, modify if needed and use a graphing procedure such as Sgplot to create the graphs. Most of the graphs from analysis procedures are in the nature of exploratory and not designed to create presentation or publication ready graphs. I consider requests for specific colors, line types, axis labels, fonts etc. as "presentation" requirements so the suggestion.

These would be Styleattrs statements as overrides to existing ODS Style defaults or potentially Dattrmap options for Sgplot.

View solution in original post

5 REPLIES 5
tarheel13
Rhodochrosite | Level 12

you can try wilcoxon or log-rank assuming assumptions are met. these are nonparametric tests.

Romain69100
Fluorite | Level 6

Thank you for your answer.

 

Graphically i would like to have a red solid line for the "0" group and a blue solid line for the "1" group  and a red dotted line for the "2" group and and a blue dotted line for the "3" group?

 

Do you know how to compute this?

 

Thanks again

 

ballardw
Super User

@Romain69100 wrote:

Thank you for your answer.

 

Graphically i would like to have a red solid line for the "0" group and a blue solid line for the "1" group  and a red dotted line for the "2" group and and a blue dotted line for the "3" group?

 

Do you know how to compute this?

 

Thanks again

 


My generic suggestion for any appearance controls is to extract data from the procedure, modify if needed and use a graphing procedure such as Sgplot to create the graphs. Most of the graphs from analysis procedures are in the nature of exploratory and not designed to create presentation or publication ready graphs. I consider requests for specific colors, line types, axis labels, fonts etc. as "presentation" requirements so the suggestion.

These would be Styleattrs statements as overrides to existing ODS Style defaults or potentially Dattrmap options for Sgplot.

Romain69100
Fluorite | Level 6

Thank you!

FreelanceReinh
Jade | Level 19

Hello @Romain69100,

 

In the special case of Kaplan-Meier plots there are ample possibilities for customization thanks to the macros SAS provided in Customizing the Kaplan-Meier Survival Plot (direct link to the code: https://support.sas.com/documentation/onlinedoc/stat/ex_code/151/templft.html).

 

You can specify the colors and line patterns as you want in macro variable GraphOpts, as shown in the example below.

/* Create sample data for demonstration */

data have;
set VALung; /* from https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/statug/statug_lifetest_examples01.htm */
d_groupe=mod(rank(char(cell,4))+2,4);
run;

/* Specify colors and line patterns */

%ProvideSurvivalMacros /* from https://support.sas.com/documentation/onlinedoc/stat/ex_code/151/templft.html */

%let GraphOpts = attrpriority=none
                 DataContrastColors = (red   blue  red blue)
                 DataLinePatterns   = (solid solid dot dot );

%CompileSurvivalTemplates

/* Apply the attributes to a Kaplan-Meier plot */

ods graphics on;
proc lifetest data=have plots=(s);
time SurvTime*Censor(1);
strata d_groupe;
run;
ods graphics off;

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
  • 5 replies
  • 615 views
  • 1 like
  • 4 in conversation