Skip to content
RDocumentation: hr.comp
  • AI Chat
  • Code
  • Report
  • Spinner

    Note that this notebook was automatically generated from an RDocumentation page. It depends on the package and the example code whether this code will run without errors. You may need to edit the code to make things work.

    Run cancelled
    age <- as.numeric(rnorm(100, 50, 10) >= 50)
    size <- as.numeric(rexp(100,1) > 1)
    stime <- rexp(100)
    cens <- runif(100,.5,2)
    sevent <- as.numeric(stime <= cens)
    stime <- pmin(stime, cens)
    hr1 <- hazard.ratio(x=age, surv.time=stime, surv.event=sevent)
    hr2 <- hazard.ratio(x=size, surv.time=stime, surv.event=sevent)
    hr.comp(hr1=hr1, hr2=hr2)