I am currently learning how to compare two survival distributions using non-parametric methods. I am trying to apply the Cox's F-Test to an example in the book using either SAS or R. I tried researching the topic, but most of the results are about how to do it by hand. Is it possible to perform the test using SAS or R? If so, how? Or do I need to create my own function to perform the computations for me?
R Code:
time = c(23, 16, 18, 20, 24, 15, 18, 19, 19, 20)
censor = c(1, rep(0,4), rep(1,5))
treat = factor(c(rep(1,5), rep(2,5)))
eg5.1 = data.frame(time, censor, treat)
SAS Code:
data eg5_1;
input time censor treat;
output;
cards;
23 0 1
16 1 1
18 1 1
20 1 1
24 1 1
15 0 2
18 0 2
19 0 2
19 0 2
20 0 2
;
proc print; run;
proc lifetest data=eg5_1;* plots=(s);
time time*censor(1);
*survival stderr out=stat;
strata treat / test = all;
run;