我有一个DataFrame df1
(为了节省空间,它的dput
放在底部),我正在运行DFS分析,如下所示:
require(survival)
require(survminer)
require(ggplot2)
cox_fit <- coxph(Surv(DFS,Relapsed) ~ Gender + Stage + MSI, data=df1)
ggforest(cox_fit, data = df1, refLabel = "Reference Group")
You can see that Gender
and MSI
variables have one level shown as "Reference Group", as expected - but Stage
variable does not have it, and I don't understand why. When I just print cox_fit
object, it looks fine with all three variables:
cox_fit
# Call:
# coxph(formula = Surv(DFS, Relapsed) ~ Gender + Stage + MSI, data = df1)
#
# coef exp(coef) se(coef) z p
# GenderMale 0.7952 2.2149 0.2916 2.727 0.00639
# StageIII 1.8824 6.5693 0.4342 4.335 1.46e-05
# MSIMSI-Hi 0.4551 1.5763 0.3677 1.238 0.21579
#
# Likelihood ratio test=35.43 on 3 df, p=9.872e-08
# n= 337, number of events= 57
我不明白Stage
变量有什么特别之处,让它在森林地块上看起来很奇怪.
df1 <- structure(
list(
DFS = c(474,280,439,468,155,390,484,432,254,453,375,426,540,236,396,315,255,444,336,414,394,362,376,280,366,346,163,363,308,297,253,288,261,111,288,339,274,282,136,213,85,113,35,76,67,75,28,136,1339,1238,1324,117,75,1191,1234,1222,1320,1162,651,1234,1224,270,1233,1266,1071,1149,1159,1140,1224,1071,1174,1056,561,1022,315,1110,1081,1183,1166,1085,1171,689,86,1048,1087,527,539,1199,1106,1102,1113,1108,870,228,1019,89,1056,1140,1063,1082,193,1030,777,231,137,394,1079,408,994,100,805,978,1022,518,36,516,634,930,934,847,904,345,817,852,342,97,663,1031,888,349,684,188,431,114,994,922,1030,743,935,888,287,915,613,927,2,137,842,793,770,94,160,884,892,711,679,676,409,924,806,887,978,855,189,801,518,843,807,944,657,775,988,891,756,1013,892,404,883,738,853,161,496,241,870,704,97,677,865,862,650,722,873,737,851,816,891,603,726,65,833,789,93,787,812,611,505,715,833,756,707,710,149,828,830,678,371,78,210,874,658,564,705,734,648,729,223,440,752,789,863,222,563,540,794,160,651,792,578,781,586,351,623,487,442,807,673,716,369,735,301,255,729,514,701,116,160,654,226,700,751,672,52,728,423,766,627,217,784,161,607,357,606,722,152,631,365,416,590,28,573,590,656,114,166,420,196,538,693,623,676,65,725,626,646,627,681,8,680,65,655,157,613,620,693,153,630,147,645,232,591,494,646,595,291,604,629,424,251,499,513,424,487,592,555,570,543,491,43,501,563,558,469,645,511,453,475,427,314),
Relapsed = c(T,T,F,F,F,F,F,F,F,F,F,F,F,T,F,F,F,F,F,F,F,F,F,F,F,F,F,T,F,F,F,F,F,F,F,F,F,F,F,F,F,F,T,F,F,F,T,T,F,F,F,T,T,F,F,F,F,F,F,F,F,T,F,F,F,F,F,F,F,F,F,F,F,F,T,F,F,F,F,F,F,F,T,F,F,F,F,F,F,F,F,F,T,T,F,F,F,F,F,F,T,F,F,T,F,F,F,F,F,T,F,T,F,F,T,F,F,F,F,F,F,T,T,F,F,T,F,F,F,T,F,F,F,T,F,F,F,F,F,F,F,F,F,F,T,T,F,F,F,T,F,F,F,F,F,F,F,F,F,F,F,F,T,F,F,F,F,F,F,F,F,F,F,F,F,T,F,F,F,F,T,T,T,F,F,F,F,F,F,F,F,F,F,F,F,F,F,T,F,F,T,F,F,F,F,F,F,F,F,F,T,F,F,T,T,T,F,F,F,F,F,F,F,F,T,T,F,F,F,F,F,F,F,F,F,F,F,F,F,T,F,F,F,F,F,F,F,F,T,F,F,F,F,F,F,T,F,F,F,F,F,F,F,F,F,F,F,T,F,F,F,F,T,F,F,F,F,T,F,F,F,F,F,T,F,F,F,F,F,F,F,F,F,F,F,T,F,T,F,T,F,F,F,F,F,F,F,T,F,T,F,F,F,F,F,F,T,T,F,T,F,F,F,F,F,F,F,T,F,F,F,F,F,F,F,F,T),
Gender = structure(
c(2,2,2,1,1,1,2,2,2,1,1,2,1,2,1,1,1,2,2,1,1,1,2,2,2,1,2,1,2,1,2,1,2,1,2,1,1,2,2,2,1,1,2,2,2,1,1,1,2,2,2,2,2,2,1,1,2,2,2,1,1,2,2,2,2,1,1,1,1,1,2,1,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