How I can transfer SAS code to R for cox hazard model

Hello all,
I would like to ask you, how I can write phreg model in SAS with R for the follwoing code. I tried with cph() model but I did not get the same results, really I did not know what dose the argument id and by corresponded to.
I hope you can help me and thanks in advance.

proc phreg data=base covs(aggregate);

class var1(ref='1') var2(ref='0') var3(ref='1') var4(ref='0') var5(ref='0')

var6(ref='0') var7(ref='0-1') var8(ref='0') var9(ref='0') / param = ref;

model (delai, delai2) * event(0, 2) = var1 var2 var12 var4 var5

var6 var7 var8 var9 height/ rl;                      

id ID;

by var10;

ods output ParameterEstimates=param;

output out=obs xbeta=score_beta;


This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.