我如何 bootstrap 和 "randomForestSRC" 中的权重?

How can I bootstrap with weights in "randomForestSRC"?

我想 bootstrap 在随机生存森林(randomForestSRC 包)中使用权重,因为我有一个案例队列研究设计。

请告诉我如何在此分析中添加 "weights" 选项。

谢谢。

下面是我的代码。 (使用示例数据实现)

install.packages("randomForestSRC")
library(randomForestSRC)
data(pbc, package="randomForestSRC")
data <- na.omit(pbc)

rsf <- rfsrc(Surv(days, status)~., 
             data=data, 
             ntree=500, 
             tree.err=T,
             importance=T,
             proximity=T)

您应该查看 CRAN 上 rfsrc() 手册页中的 bootstrap 相关选项。在 CRAN 包中,选项 "samp" 允许您为每棵树明确指定 bootstrap。因此,您将根据您的权重填充索引的 n x ntree 矩阵。我们的 GitHub 页面上给出了 ntree、bootstrap 选项、样本类型、样本大小和样本如何相互作用的更形象的描述:

https://kogalur.github.io/randomForestSRC/javadoc/index.html