我已经附上了用R的rms软件包生成的样条曲线的图片。 它显示了与给定累积剂量的药物有关的危险比(死亡)之间的关联。
请在下面找到我的数据和脚本。
我使用了rms软件包。我希望找到属于危险比= y = 1的x值(w $ total.mbq)。我尝试了summary(model)
的不同组合,但不起作用。
library(ggplot2)
library(rms)
d <- datadist(w)
options(datadist="d")
model <- cph(Surv(Follow.up.death,Death)~rcs(total.mbq),data=w)
ggplot(Predict(model, fun=exp)) + scale_y_continuous(breaks=c(1:10))
我的数据
w <- structure(list(Follow.up.death = c(18, 2, 14, 17, 31, 4, 20,
15, 12, 19, 10, 17, 27, 22, 3, 43, 24, 14, 13, 5, 12, 137, 22,
87, 48, 24, 72, 32, 14, 83, 68, 56, 57, 18, 16, 70, 1.9, 69.2,
126.3, 41.6, 17.9, 1.3, 87.4, 4.4, 137.4, 17.5, 95.8, 65.2, 14.8,
98.5, 16.6, 74.9, 10.3, 43.4, 32.5, 4.8, 7.3, 107.8, 6.8, 18.3,
33, 25.2, 49.2, 15.9, 1.2, 42.7, 1, 9, 1.8, 15.6, 8.9, 15, 16.4,
7.7, 75.5, 12.2, 54.8, 22.2, 9.7, 14.3, 5.2, 64.5, 21.8, 0.2,
7.3, 18.7, 5.1, 17.3, 27.4, 16, 24.2, 9.7, 8.2, 5.7, 41.8, 10.6,
22.8, 4.8, 6, 4, 50, 21, 30, 5, 11, 12), Death = c(0L, 1L, 1L,
0L, 0L, 1L, 0L, 0L, 0L, 1L, 1L, 1L, 0L, 0L, 1L, 0L, 0L, 0L, 0L,
0L, 1L, 0L, 1L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 1L, 1L, 1L,
0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 1L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 1L, 0L, 1L, 0L,
1L, 1L, 1L, 1L, 0L, 0L, 1L, 0L, 1L, 0L, 0L, 1L, 0L, 1L, 0L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 0L, 1L, 1L, 1L, 0L,
1L, 0L, 0L, 0L, 0L, 0L, 0L), total.mbq = c(29354L, 7445L, 22309L,
29699L, 29711L, 14765L, 22257L, 29715L, 29772L, 13320L, 20905L,
12950L, 3400L, 14800L, 7400L, 21890L, 19400L, 14800L, 14700L,
22200L, 1688L, 4500L, 8438L, 13500L, 14800L, 12580L, 12950L,
13320L, 11840L, 13320L, 14800L, 13690L, 11250L, 12210L, 13320L,
13320L, 14800L, 12580L, 20720L, 11840L, 14800L, 7030L, 14800L,
14800L, 8325L, 11100L, 10730L, 13690L, 12210L, 14800L, 13320L,
14800L, 12950L, 22200L, 17945L, 22200L, 8140L, 13690L, 11581L,
14430L, 13320L, 13320L, 21090L, 11100L, 3885L, 6475L, 6660L,
6660L, 5920L, 7500L, 5000L, 12500L, 12500L, 10000L, 12500L, 7500L,
15000L, 10000L, 5000L, 7500L, 5000L, 15000L, 12500L, 7500L, 7500L,
7500L, 5000L, 10000L, 10000L, 10000L, 12500L, 5000L, 5000L, 10000L,
12500L, 5000L, 10000L, 10000L, 22200L, 14800L, 29000L, 14000L,
4800L, 21600L, 28800L, 11400L)), .Names = c("Follow.up.death",
"Death", "total.mbq"), class = "data.frame", row.names = c(NA,
-106L))
答案 0 :(得分:0)
f <- Function(model) # create an R function for X*beta hat = log relative hazard
这是total.mbq
的功能。使用R根求解器求解f(x)=0。我认为结果是中位数total.mbq
。另一方面,我可能已经解决了对中常数,因此所有对象的平均对数风险为零。希望我现在记得这些细节。