3

在尝试将 Weibull 比例风险模型拟合到gehanR 中的数据时,我注意到更改gehan数据的顺序会更改输出。

library(MASS)
library(survival)
attach(gehan)

survreg(Surv(time, cens) ~ treat, gehan, dist = "weibull")

产生以下输出:

Call:
survreg(formula = Surv(time, cens) ~ treat, data = gehan, dist = "weibull")

Coefficients:
 (Intercept) treatcontrol 
 3.515687    -1.267335 

Scale= 0.7321944 

Loglik(model)= -106.6   Loglik(intercept only)= -116.4
Chisq= 19.65 on 1 degrees of freedom, p= 9.3e-06 
n= 42 

但是,当我手动将数据输入 R 时,

control <- c(1,1,2,2,3,4,4,5,5,8,8,8,8,11,11,12,12,15,17,22,23)
control.status <- c(rep(1,21))
treatment <- c(6,6,6,6,7,9,10,10,11,13,16,17,19,20,22,23,25,32,32,34,35)
treatment.status <- c(1,1,1,0,1,0,1,0,0,1,1,0,0,0,1,1,0,0,0,0,0)

new.time <- c(control,treatment)
new.status <- c(control.status,treatment.status)
group <- as.factor(c(rep("control",21),rep("treatment",21)))
parametrik.surv <- Surv(new.time, new.status)
parametrik.fit <- survreg( parametrik.surv  ~ group, dist="w")

这是一个稍微不同的输出:

 Call:
survreg(formula = parametrik.surv ~ group, dist = "w")

Coefficients:
(Intercept) grouptreatment 
  2.248352       1.267335 

Scale= 0.7321944 

Loglik(model)= -106.6   Loglik(intercept only)= -116.4
Chisq= 19.65 on 1 degrees of freedom, p= 9.3e-06 
n= 42 

此外,在一本书 beta_0 中,beta_1 和 scale 分别给出为 0.98 、 1.27 和 1.37 。知道是什么原因造成的吗?

4

1 回答 1

2

您重命名了治疗,因此它在一个模型中使用“控制”作为参考组,在另一个模型中使用“6-MP”作为参考组。

于 2015-04-06T16:21:03.817 回答