I want to get the same results of implementing cox-box by R for this SAS code,
model (time1, time2) * event(0, 2) = Age / rl; id ID; by Imputation; ods output ParameterEstimates=param; output out=obs xbeta=score_beta; run;
I would like to ask how I can perform the cox-model in R and taking into account two group variables, the variable ID and the Imputation variable in the below data.
Frankly, I did this by cph() and coxph() functions and I got different results thans SAS.
f = cph(Surv(time1, time2, event%in%c(1,2))~ Age, data = dat, x=T, y=T, na.action=na.omit, surv=TRUE, stratum(ID), cluster(Imputation) ) f = coxph(Surv(time1, time2, event%in%c(1,2))~ Age, data = dat, id = ID, cluster(Imputation))
is it true? the reference event is 0. Thanks in advance.