有谁知道 survobject 中的 n 和 strata 有什么区别?

Does anyone know what the difference between n and strata in a survobject?

每当我在 R 中使用 survfit 时,我都会得到不同的 n 和 strata 值: 例如 我得到 n: 150、167(加起来是 317,这是总输入) 阶层: 149, 163

来自帮助页面 ?survival::survfit.object:

n = total number of subjects in each curve.

strata = if there are multiple curves, this component gives the number of elements of the time etc. vectors corresponding to the first curve, the second curve, and so on. The names of the elements are labels for the curves.

我不明白为什么数字不同。

编辑: 我确实考虑过重复时间数据点的问题,正如您在示例数据库中看到的那样,有 9 个重复值实例(总共 18 个)。这意味着仅使用 317 - 9 = 308 个值。 但是 strata 加起来是:149+163=312,不是 308。 使用的代码是:

library(survival)
library(survminer)
survival <- surv_fit(Surv(time = Time,event = Event)~Group,data=x, conf.int=0.95)

更新: 它与每个组内的重复次数有关。 如果我将 A 组和 B 组中的数据分开,A 组中有 1 个重复事件,B 组中有 4 个重复事件。因此图中将有 317 - 1 - 4 = 312 个时间点。

并且在每组中将是: 答:150 - 1 = 149 B: 167 - 4 = 163

如地层所示。

感谢@kath 的帮助。

n refers to how many samples are in each group.

strata refers to the number distinct time elements in each group, i.e. removing duplicates within each group.