Interval2 的不同 Kaplan-Meier 结果
Different Kaplan-Meier Results with Interval2
当我使用“interval2”类型的生存对象时,我注意到 survfit
之间存在细微差别。我首先注意到 interval2 拟合的风险数不是整数。我已经逐步完成了 survfit.formula
和 surviftKM
,但我仍然不清楚到底发生了什么以及为什么。谁能给我解释一下区别?调试时显示 survfitKM
正在使用一些 .05 权重(casewt
变量),但我没有明确设置它。
MRE:
library('survival')
surv_obj <- with(lung, Surv(time = time, event = status == 1))
left <- lung$time
right <- ifelse(lung$status == 1, lung$time, NA)
surv_obj_int <- Surv(time = left, time2 = right, type = 'interval2')
surv_fit <- survfit(surv_obj~1, type = 'kaplan-meier')
surv_fit_int <- survfit(surv_obj_int~1, type = 'kaplan-meier')
回购所有者很友好地解释了。
When there is interval censored data the code uses the Turnbull estimate (survfitTurnbull). In this case the number at risk is not well defined and the code uses a "working" value. In your particular example there are no interval censored observations, and it if twas smarter the code would notice that and use survfitKM: more accurate and a lot faster. But users don't tend to use interval2 style unless they need it.
尽管我将肺视为区间删失,但没有实际区间。如果有右值,它总是等于左值。
当我使用“interval2”类型的生存对象时,我注意到 survfit
之间存在细微差别。我首先注意到 interval2 拟合的风险数不是整数。我已经逐步完成了 survfit.formula
和 surviftKM
,但我仍然不清楚到底发生了什么以及为什么。谁能给我解释一下区别?调试时显示 survfitKM
正在使用一些 .05 权重(casewt
变量),但我没有明确设置它。
MRE:
library('survival')
surv_obj <- with(lung, Surv(time = time, event = status == 1))
left <- lung$time
right <- ifelse(lung$status == 1, lung$time, NA)
surv_obj_int <- Surv(time = left, time2 = right, type = 'interval2')
surv_fit <- survfit(surv_obj~1, type = 'kaplan-meier')
surv_fit_int <- survfit(surv_obj_int~1, type = 'kaplan-meier')
回购所有者很友好地解释了。
When there is interval censored data the code uses the Turnbull estimate (survfitTurnbull). In this case the number at risk is not well defined and the code uses a "working" value. In your particular example there are no interval censored observations, and it if twas smarter the code would notice that and use survfitKM: more accurate and a lot faster. But users don't tend to use interval2 style unless they need it.
尽管我将肺视为区间删失,但没有实际区间。如果有右值,它总是等于左值。