# NOT RUN {
## Two-sample test
survdiff(Surv(futime, fustat) ~ rx,data=ovarian)
## Stratified 7-sample test
survdiff(Surv(time, status) ~ pat.karno + strata(inst), data=lung)
## Expected survival for heart transplant patients based on
## US mortality tables
expect <- survexp(futime ~ 1, data=jasa, cohort=FALSE,
rmap= list(age=(accept.dt - birth.dt), sex=1, year=accept.dt),
ratetable=survexp.us)
## actual survival is much worse (no surprise)
survdiff(Surv(jasa$futime, jasa$fustat) ~ offset(expect))
# }
Run the code above in your browser using DataLab