首页 > 解决方案 > R 生存包 - survreg 在使用大间隔时报告奇点

问题描述

我在尝试使用生存包进行区间回归时遇到了一个问题。目标仅仅是使用区间删失数据来估计常数。

> library(survival)
> y = with(data, Surv(lb, ub, type = "interval2"))
> model_y = survreg(y ~ 1, dist = "gaussian")
> model_y
Call:
survreg(formula = y ~ 1, dist = "gaussian")

Coefficients: (1 not defined because of singularities)
(Intercept) 
         NA 

Scale= 256178.4 

Loglik(model)= -6186.5   Loglik(intercept only)= -6186.5
n=2556 (132 observations deleted due to missingness)

对于截距报告 NA。此外,显示“(1未定义,因为奇异性)”的备注。

但是,一旦我将区间的范围缩小一个常数因子,就会得到正确的结果(适用于整数 > 3):

> library(survival)
> y = with(data, Surv(lb/4, ub/4, type = "interval2"))
> model_y = survreg(y ~ 1, dist = "gaussian")
> model_y
Call:
survreg(formula = y ~ 1, dist = "gaussian")

Coefficients:
(Intercept) 
    567.184 

Scale= 64000.89 

Loglik(model)= -6186   Loglik(intercept only)= -6186
n=2556 (132 observations deleted due to missingness)

有没有人知道为什么会这样?

数据

亲切的问候

标签: r

解决方案


推荐阅读