BookmarkSubscribeRSS Feed
Haemoglobin17
Obsidian | Level 7

Dear all,

 

I have been trying to calculate survival estimates probabilities and standard error from a dataset where I performed multiple imputation.

I wrote the following code, because, for each dataset imputed, I would like to obtain a survival curve for treated and another for untreated. Of course, Have is sorted by group.

The problem is that, every time I run the code, SAS is not responding and I have to restart the software... Have you ever run something similar? I think that the problem is with the statement strata because, without it works fine.

Thanks!!

 

 

proc lifetest data= Have outsurv=Want;

    time followup*event(0);

    by group;

    strata _Imputation;

   weight sw;

run;

 

6 REPLIES 6
OsoGris
SAS Employee

Have you tried "strata _imputation_" ?  

Haemoglobin17
Obsidian | Level 7
Hi @OsoGris, yes , this is just a typo!
SAS_Rob
SAS Employee

You should not put the _IMPUTATION_ variable on the STRATA statement.  It should appear on the BY statement so that each data set gets an independent analysis.

Haemoglobin17
Obsidian | Level 7

Hi @SAS_Rob ,

If I put _Imputation_ in the by statement I will obtain five (in my case) survival curves, one for each imputed dataset, while I would like to obtain two curves for each imputed dataset, one for treated and the other for untreated, for each imputed dataset.

I can divide the imputed dataset in 5 sub-dataset based on the value on _Imputation_ and apply the previous script without the strata statement.

However, I was wondering if there is a faster way to obtain the same result without running 5 different proc lifetest..

OsoGris
SAS Employee

If you want curves for treated (events?) and untreated (censored?) separately then it seems you would have to run two PROC LIFETEST steps for each imputed data set.   That would mean 10 PROC LIFETEST steps. I don't see any other way around this. 

SAS_Rob
SAS Employee

If you want two separate curves per imputed data set then you should place both variables on the BY statement.

 

BY _IMPUTATION_ GROUP;

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