[R] Survival: pyears and ratetable: expected events

Terry Therneau therneau at mayo.edu
Tue May 31 14:07:30 CEST 2011


> Should the following syntax work getting the expected number of
> deaths? I am
> having no luck getting the thing to work.

> pyears(Surv(fu,ev)~ratetable(sex=sex, age=age,year=yearofsurgery),
> ratetable=expsurv.us, scale=365.25)$expected

Your syntax is fine.  It looks like you built your own rate table, and
I'm guessing that something was done incorrectly at that step.  The
dimensions etc are fussy for a rate table, and it is easy to get them
wrong.

Terry Therneau



More information about the R-help mailing list