我正在使用flexsurv软件包中的 gompertz 发行版运行 flexsurvreg 函数。以下是我的样本叫tmp。
tmp <- structure(list(time = c(9157, 9157, 9157, 9157, 9157, 9157, 9157,
9157, 9157, 9157, 9157, 9157, 9157, 9157, 9157, 9157, 9157, 9157,
9157, 9157, 3138, 3138, 3138, 3138, 9157, 9157, 9157, 9157, 2553,
2553, 2553, 2553, 1418, 9157, 9157, 9157, 9157, 9157, 9157, 9157,
9157, 9157, 9157, 9157, 9157, 9156, 9156, 9156, 9156, 8394, 8394,
8394, 8394, 762, 9156, 9156, 9156, 9156, 8079, 8079, 8079, 8079,
8933, 8933, 8933, 8933, 70, 8430, 8430, 8430, 8430, 2868, 2868,
2868, 2868, 6288, 9156, 9156, 9156, 9156, 2011, 2011, 2011, 2011,
9156, 9156, 9156, 9156, 9156, 9156, 9156, 9156, 9156, 9156, 9156,
9156, 9156, 9156, 9156, 9156, 9156, 9156, 9156, 9156, 9156, 9156,
9156, 9156, 2015, 2015, 2015, 2015, 9149, 9149, 9149, 9149, 9149,
9149, 9149, 9149, 9149, 9149, 9149, 9149, 9149, 9149, 9149, 9149,
9149, 9149, 9149, 9149, 2868, 2868, 2868, 2868, 5067, 5067, 5067,
5067, 57, 9149, 9149, 9149, 9149, 4021, 4021, 4021, 4021, 9149,
9149, 9149, 9149, 9149, 9149, 9149, 9149, 7447, 7447, 7447, 7447,
7255, 7255, 7255, 7255, 1894, 9149, 9149, 9149, 9149, 8611, 8611,
8611, 8611, 9149, 9149, 9149, 9149, 9149, 9149, 9149, 9149, 9149,
9149, 9149, 9149, 2013, 2013, 2013, 2013, 9148, 9148, 9148, 9148,
2054, 2054, 2054, 2054, 7094, 9148, 9148, 9148, 9148, 899, 899,
899, 899, 8249, 9123, 9123, 9123, 9123, 3872, 3872, 3872, 3872,
4922, 9122, 9122, 9122, 9122, 6272, 6272, 6272, 6272, 2850, 9121,
9121, 9121, 9121, 9121, 9121, 9121, 9121, 5910, 5910, 5910, 5910,
9121, 9121, 9121, 9121, 9114, 9114, 9114, 9114, 9114, 9114, 9114,
9114, 9114, 9114, 9114, 9114, 9114, 9114, 9114, 9114, 9114, 9114,
9114, 9114, 9114, 9114, 9114, 9114, 9114, 9114, 9114, 9114, 9114,
9114, 9114, 9114, 9114, 9114, 9114, 9114, 9114, 9114, 9114, 9114,
9114, 9114, 9114, 9114, 5325, 5325, 5325, 5325, 9114, 9114, 9114,
9114, 8018, 8018, 8018, 8018, 5922, 5922, 5922, 5922, 7662, 7662,
7662, 7662, 9114, 9114, 9114, 9114, 9109, 9109, 9109, 9109, 3467,
3467, 3467, 3467, 9109, 9109, 9109, 9109, 9109, 9109, 9109, 9109,
9109, 9109, 9109, 9109, 5147, 5147, 5147, 5147, 3962, 9109, 9109,
9109, 9109, 9109, 9109, 9109, 9109, 9109, 9109, 9109, 9109, 9109,
9109, 9109, 9109, 9109, 9109, 9109, 9109, 9109, 9109, 9109, 9109,
743, 743, 743, 743, 1011, 6378, 6378, 6378, 6378, 2731, 1491,
1491, 1491, 1491, 8848, 8848, 8848, 8848, 4864, 4864, 4864, 4864,
9109, 9109, 9109, 9109, 7681, 7681, 7681, 7681, 1428, 9109, 9109,
9109, 9109, 9108, 9108, 9108, 9108, 9108, 9108, 9108, 9108, 4279,
4279, 4279, 4279, 4829, 8829, 8829, 8829, 8829, 279, 9108, 9108,
9108, 9108, 9107, 9107, 9107, 9107, 8462, 8462, 8462, 8462, 645,
9107, 9107, 9107, 9107, 9107, 9107, 9107, 9107, 9107, 9107, 9107,
9107, 9106, 9106, 9106, 9106, 9106, 9106, 9106, 9106, 7033, 7033,
7033, 7033, 9106, 9106, 9106, 9106, 9106, 9106, 9106, 9106, 9106,
9106, 9106, 9106, 9106, 9106, 9106, 9106, 7683, 7683, 7683, 7683,
8560, 8560, 8560, 8560, 546, 9106, 9106, 9106, 9106, 9106, 9106,
9106, 9106, 9106, 9106, 9106, 9106, 6428, 6428, 6428, 6428, 6081,
6081, 6081, 6081, 3025, 9106, 9106, 9106, 9106, 9106, 9106, 9106,
9106, 3198, 3198, 3198, 3198, 6384, 6384, 6384, 6384, 2722, 9106,
9106, 9106, 9106, 7841, 7841, 7841, 7841, 9106, 9106, 9106, 9106,
9106, 9106, 9106, 9106, 8967, 8967, 8967, 8967, 3965, 3965, 3965,
3965, 5141, 9103, 9103, 9103, 9103, 9103, 9103, 9103, 9103, 9103,
9103, 9103, 9103, 9103, 9103, 9103, 9103, 9103, 9103, 9103, 9103,
9103, 9103, 9103, 9103, 9103, 9103, 9103, 9103, 9103, 9103, 9103,
9103, 9103, 9103, 9103, 9103, 8396, 8396, 8396, 8396, 9103, 9103,
9103, 9103, 9103, 9103, 9103, 9103, 5327, 5327, 5327, 5327, 74,
9103, 9103, 9103, 9103, 9103, 9103, 9103, 9103, 9103, 9103, 9103,
9103, 9103, 9103, 9103, 9103, 3110, 3110, 3110, 3110, 5990, 9100,
9100, 9100, 9100, 9099, 9099, 9099, 9099, 5076, 5076, 5076, 5076,
9099, 9099, 9099, 9099, 9099, 9099, 9099, 9099, 9099, 9099, 9099,
9099, 5430, 5430, 5430, 5430, 9092, 9092, 9092, 9092, 9092, 9092,
9092, 9092, 8083, 8083, 8083, 8083, 1009, 9092, 9092, 9092, 9092,
9092, 9092, 9092, 9092, 9092, 9092, 9092, 9092, 9092, 9092, 9092,
9092, 9092, 9092, 9092, 9092, 9092, 9092, 9092, 9092, 6247, 6247,
6247, 6247, 7303, 7303, 7303, 7303, 9088, 9088, 9088, 9088, 8846,
8846, 8846, 8846, 48, 9087, 9087, 9087, 9087, 8635, 8635, 8635,
8635, 5265, 5265, 5265, 5265, 1314, 9086, 9086, 9086, 9086, 9086,
9086, 9086, 9086, 8514, 8514, 8514, 8514, 572, 5275, 5275, 5275,
5275, 9086, 9086, 9086, 9086, 2805, 2805, 2805, 2805, 5614, 5614,
5614, 5614, 3472, 5376, 5376, 5376, 5376, 3710, 9086, 9086, 9086,
9086, 5119, 5119, 5119, 5119, 3967, 9086, 9086, 9086, 9086, 3035,
3035, 3035, 3035, 6051, 8357, 8357, 8357, 8357, 9086, 9086, 9086,
9086, 5179, 5179, 5179, 5179, 9086, 9086, 9086, 9086, 9086, 9086,
9086, 9086, 9086, 9086, 9086, 9086, 9086, 9086, 9086, 9086, 5824,
5824, 5824, 5824, 3262, 9086, 9086, 9086, 9086, 9086, 9086, 9086,
9086, 9081, 9081, 9081, 9081, 9081, 9081, 9081, 9081, 7232, 7232,
7232, 7232, 1849, 9081, 9081, 9081, 9081, 9081, 9081, 9081, 9081,
9081, 9081, 9081, 9081, 9081, 9081, 9081, 9081, 7324, 7324, 7324,
7324, 9081, 9081, 9081, 9081, 9081, 9081, 9081, 9081, 9081, 9081,
9081, 9081, 7724, 7724, 7724, 7724, 9081, 9081), status = c(0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1,
0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0,
0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
0, 0, 1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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0,
0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1,
0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0,
0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 1, 0, 0)), row.names = 150:1000, class = "data.frame")
运行命令flexsurvreg:
gompfit <- flexsurvreg(Surv(time, status) ~ 1, data = tmp, dist = "gompertz")
给我一个错误:
优化时出错(方法=“ BFGS”,par = c(形状= 0.001,比率= -8.95838425724751: vmmin中的初始值不是有限的
我在R Forum中搜索了此错误,但没有找到解决我问题的方法。我从搜索中发现的唯一提示是,数据中的零可能会导致问题。但是,数据中的变量 status 不可避免地为0,并且1不能更改为任何其他值。另外,当我拟合Weibull分布时,它运作良好,并且没有出现任何错误,而该错误与拟合Gompertz分布有关。每个人都知道如何解决问题/错误吗?
任何提示/帮助将不胜感激。