BookmarkSubscribeRSS Feed
Clemence
Calcite | Level 5

Hello,

I study data non detects and different methods for handling these data. I would like obtain the mean using Kaplan Meier method, but my data are left censored and not right censored. So, I found a code to estimate the mean, but when I compare the result of mean with a function in R for non detect data (package NADA, function cenfit), I don't find again the result. Do you think that this code is correct to calculate the mean ? Or, do you know a code to obtain the mean with Kaplan Meier method for left-censored data ?

 

Here is my code :

 

``` 

/**Put data to right censored**/

data KM;
if _N_=1 then set Max (keep = MAXC);
SET data.savona;
value_censure_droite = MAXC - Concentration;
run;

 

/**Estimator KM  : censored=1 if data censored and 0 if data observed**/
proc lifetest data=KM outsurv=out_km method=KM ;
time value_censure_droite*censored(1);
run;

 

proc sort data=out_km;
by SURVIVAL;
run;

 

data out_km1;
if _N_=1 then set MAX;
set out_km;
value_initiale = MAXC-value_censure_droite;

 

if _CENSOR_ IN (0,.);
DENS=DIF(SURVIVAL); 

if _N_ = 1 then DENS = SURVIVAL;

 

XX=LAG(value_initiale);
if _N_ = 1 then XX=0;


MPROD = XX*DENS;
run;

 

PROC MEANS DATA=out_km1 noprint;
VAR MPROD;
OUTPUT OUT=MMM SUM=MEAN; 
RUN;

```

Thanks for your help !


PS : When I run the proc lifetest, I have this note "The mean survival time and its standard error were underestimated because the largest observation was censored and the estimation was restricted to the largest event time."

1 REPLY 1
Clemence
Calcite | Level 5

Nobody have a response ? It's for my internship .  Thanks !

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