Add.times 在 R 中

Add.times in R relsurv

我是编码和 R 的新手。目前正在使用包 relsurv。为此,我想计算特定时间点的相对存活率。

我使用以下方法评估五年后的 RS:

rcurve2 <- rs.surv(Surv(time_days17/365.241,event_17)~1+
  ratetable(age = age_diagnosis*365.241, sex = sex,
  year = year_diagnosis_days), data = survdata, ratetable = swepop,
  method="ederer1",conf.int=0.95,type="kaplan-meier",
  add.times = 5*365.241)

summary(rcurve2)

但是,无论我在 add.times 之后输入什么数字,我在摘要输出中得到的结果都是一样的,即对于所有 event/cenasoring 点(见下文)

 time  n.risk n.event survival std.err lower 95% CI upper 95% CI
 0.205    177       1   0.9944 0.00562       0.9834        1.005
 0.627    176       1   0.9888 0.00792       0.9734        1.004
 0.742    175       1   0.9831 0.00968       0.9644        1.002
 0.827    174       1   0.9775 0.01114       0.9559        1.000
 0.849    173       1   0.9718 0.01242       0.9478        0.996
 0.947    172       1   0.9662 0.01356       0.9400        0.993
...cont. 

我显然没有做对!将不胜感激您的帮助!

一个很好的问题!

当使用 add.times 添加“虚数”时间时,它们会被自动删减,并且不会与 summary()[=32 一起显示=] 功能。要查看您添加的时间,请设置 censored = TRUE:

summary(rcurve2, censored = TRUE)

您现在应该在下面的列表中找到您添加的时间。

示例

通过 relsurv 包使用内置数据

data(slopop)
data(rdata)

#note the last argument add.times=1000
rcurve2 <- rs.surv(Surv(time,cens)~sex+ratetable(age=age*365.241, sex=sex, 
      year=year), ratetable=slopop, data=rdata, add.times = 1000)

当使用 summary(rcurve2) 时,时间 1000 不会出现:

>summary(rcurve2)
[...]
  973    200       1    0.792 0.03081        0.734        0.855
  994    199       1    0.790 0.03103        0.732        0.854
 1002    198       1    0.783 0.03183        0.723        0.848
[...]

但是使用 summary(rcurve2, censored=TRUE) 它会!

>summary(rcurve2, censored=TRUE)
[...]
  973    200       1    0.792 0.03081        0.734        0.855
  994    199       1    0.790 0.03103        0.732        0.854
 1000    198       0    0.791 0.03106        0.732        0.854
 1002    198       1    0.783 0.03183        0.723        0.848
[...]