Statistical Procedures

Programming the statistical procedures from SAS
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-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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