David, Thank you very much for your response.
I fitted the model as factor instead of numeric. coxfit1 <- coxph(Surv(sdat$time, sdat$cens)~factor(y1)+factor(x2) coef exp(coef) se(coef) z Pr(>|z|) factor(y1)2 0.036161 1.036822 0.083921 0.431 0.6665 factor(y1)3 -0.510124 0.600421 0.088901 -5.738 9.57e-09 *** factor(x2)2 -0.510124 0.600421 0.088901 -5.738 9.57e-09 *** What are those values? Is it comparing in reference to the first class of each covariate? Thanks again. On Thu, Dec 10, 2009 at 8:33 AM, Ashta <sewa...@gmail.com> wrote: > Hi all, > > I want to calculate hazard ratio within each covariate > > > Example, one covariate has 3 classes (1,2 and 3) and x2 has 2 classes > > I want to compare the relative risk ratio within each class of the covariate. > How do I get this result ? . > > > The other question is that how do I interpret the second column in > the second panel (i.e., exp(-coef)) > > I used the model > coxfit1 <- coxph(Surv(sdat$time, sdat$cens)~ y1+x2) > > coef exp(coef) se(coef) z Pr(>|z|) > y1 -0.024084 0.976204 0.003077 -7.828 5.00e-15 *** > x2 0.036161 1.036822 0.083921 0.431 0.6665 > > exp(coef) exp(-coef) lower .95 upper .95 > y1 0.9762 1.0244 0.9703 0.9821 > x2 1.0368 0.9645 0.8796 1.2222 > > > Thanks in advance > ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.