Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

survtab: age standardisation #141

Open
kseppa opened this issue Nov 15, 2017 · 0 comments
Open

survtab: age standardisation #141

kseppa opened this issue Nov 15, 2017 · 0 comments
Assignees

Comments

@kseppa
Copy link
Collaborator

kseppa commented Nov 15, 2017

In survtab(..., surv.method="lifetable") age-standardised estimate should be calculated, although an age-specific survival estimate would be 0. An example: age-standardised 5-year survival is missing, if patients in the oldest age group died within the first 1 year after diagnosis:

data("sire", package = "popEpi")
library(Epi)
library(survival)
library(data.table)

#include patients over 70 years of age who died within the first 1 year
sire <- sire[dg_age<70 | (dg_age>=70 & (ex_date-dg_date)<365 & status==1)]

x <- Lexis(entry = list(FUT = 0, AGE = dg_age, CAL = get.yrs(dg_date)), 
           exit = list(CAL = get.yrs(ex_date)), 
           data = sire[sire$dg_date < sire$ex_date, ],
           exit.status = factor(status, levels = 0:2, 
                                labels = c("alive", "canD", "othD")), 
           merge = TRUE)

data("popmort", package = "popEpi")
pm <- data.frame(popmort)
names(pm) <- c("sex", "CAL", "AGE", "haz")
## ICSS weights usage
data("ICSS", package = "popEpi")
cut <- c(0, 30, 50, 70, Inf)
agegr <- cut(ICSS$age, cut, right = FALSE)
w <- aggregate(ICSS1~agegr, data = ICSS, FUN = sum)
x$agegr <- cut(x$dg_age, cut, right = FALSE)

st <- survtab(FUT ~ 1, data = x, subset=dg_age>=70,
              surv.type = "surv.rel",
              pophaz = pm, weights = w$ICSS1,surv.method = "lifetable",
              breaks = list(FUT = seq(0, 5, 1/12)))
summary(st,t=5) ##survival=0 in 70+ age group

st <- survtab(FUT ~ adjust(agegr), data = x, 
              surv.type = "surv.rel",
              pophaz = pm, weights = w$ICSS1,surv.method = "lifetable",
              breaks = list(FUT = seq(0, 5, 1/12)))
summary(st,t=5) ##This should be calculated, too.
@WetRobot WetRobot self-assigned this Jan 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants