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."
Nobody have a response ? It's for my internship . Thanks !
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Early bird rate extended! Save $200 when you sign up by March 31.
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.