Machine learning models based on XGBoost algorithm to predict prognosis of lung cancer brain metastases.
The 5 matches
- [1] § Results › Benefits of surgical treatment in LCBM patients ↔ psm&km.R, lines 1–88 · score 0.71 · squamous cell carcinoma, liver metastases, bone metastases, N1, N2, N3
- [2] § Results › Benefits of surgical treatment in LCBM patients ↔ data_processing.R, lines 1–49 · score 0.57 · squamous cell carcinoma, N1, N2, N3, females, N0
- [3] § Methods › Feature selection and model validation ↔ md_24_36.R, lines 194–216 · score 0.54 · cross validation, confusion matrix, ROC, training, AUC, model
- [4] § Methods › Feature selection and model validation ↔ md_6_12.R, lines 192–214 · score 0.54 · cross validation, confusion matrix, ROC, training, AUC, model
- [5] § Results › Clinical characteristics of LCBM patients ↔ psm&km.R, lines 1–88 · score 0.53 · household income, NX, N3, lobe, female, N0
Paper
Loaded from Europe PMC by your browser, not stored by OSCR: doi.org · Europe PMC
The paper is loaded when this pane is shown.
The authors' code
R · 1,367 lines · 64 KB · no license · 2 matches
- library("MatchIt")
- library(tableone)
- library(dplyr)
- library("survival")
- library("survminer")
- set.seed(12345)
- data<-read.csv("C:/Users/12184/Desktop/脑转移/LCBM.csv")
- data=subset(data,select=-X)
- ## 保存为 CSV 格式文件
- #write.csv(tabMat, file = "C:/Users/Billy/Desktop/脑转移/合并table_test.csv",fileEncoding="gbk")
- data$Age=factor(data$Age,levels=c('15-54','55-64','65-74','75+'))
- data$Sex=factor(data$Sex,levels=c('Female','Male'))
- data$Race=factor(data$Race,levels=c('White','Black','Others'))
- data$Primary.Site=factor(data$Primary.Site,levels=c('Upper lobe, lung','Lower lobe, lung','Lung, NOS','Others'))
- data$Histologic.Type=factor(data$Histologic.Type,levels=c('Adenocarcinoma','Squamous cell carcinoma','Others'))
- data$Household.income=factor(data$Household.income,levels=c('<$50,000','$50,000-$59,999','$60,000-$69,999','$70,000-$79,999','>$80,000'))
- data$T_stage=factor(data$T_stage,levels=c('T1','T2','T3','T4','Others'))
- data$N_stage=factor(data$N_stage,levels=c('N0','N1','N2','N3','NX'))
- data$Chemotherapy=factor(data$Chemotherapy,levels=c('No/Unknown','Yes'))
- data$Radiotherapy=factor(data$Radiotherapy,levels=c('No/Unknown','Yes'))
- data$Surgery=factor(data$Surgery,levels=c('No/Unknown','Yes'))
- data$Bone.metastases=factor(data$Bone.metastases,levels=c('No/Unknown','Yes'))
- data$Liver.metastases=factor(data$Liver.metastases,levels=c('No/Unknown','Yes'))
- data$Lung.metastases=factor(data$Lung.metastases,levels=c('No/Unknown','Yes'))
- data$Laterality=factor(data$Laterality,levels=c('Right','Left','Others'))
- data$Marital.status=factor(data$Marital.status,levels=c('Married','Divorced','No/Unknown'))
- data$CS_size=factor(data$CS_size,levels=c('1-30','31-60','61-100','>100','No/Unknown'))
- data=subset(data,select=-Lung.metastases)
- data=subset(data,select=-Laterality)
- data=subset(data,select=-CS_size)
- data=subset(data,select=-Marital.status)
- #data=data[data$Year.of.diagnosis<=2014,]
- ##手术治疗
- #########################################################
- psm_matchit <- matchit(Surgery ~ Age+Sex+Race+Primary.Site+Histologic.Type+Household.income+T_stage
- +N_stage+Chemotherapy+Radiotherapy+Bone.metastases+Liver.metastases,
- method='nearest', distance = 'glm', ratio=1, replace=F, caliper=0.2, data=data)
- psm_matchit_data = get_matches(psm_matchit)
- tabmatched <- CreateTableOne(vars = c("Age","Sex","Race","Primary.Site","Histologic.Type","Household.income",
- "T_stage","N_stage","Chemotherapy","Radiotherapy","Bone.metastases","Liver.metastases"),
- strata = "Surgery", data = psm_matchit_data, addOverall = TRUE)
- a=print(tabmatched, smd = TRUE)## Show table with SMD
- tab_before_matched <- CreateTableOne(vars = c("Age","Sex","Race","Primary.Site","Histologic.Type","Household.income",
- "T_stage","N_stage","Chemotherapy","Radiotherapy","Bone.metastases","Liver.metastases"),
- strata = "Surgery", data = data, addOverall = TRUE)
- b=print(tab_before_matched, smd = TRUE)
- write.csv(a,"C:/Users/12184/Desktop/脑转移/0513/after_psm_mached.csv", row.names = TRUE)
- write.csv(b,"C:/Users/12184/Desktop/脑转移/0513/before_psm_mached.csv", row.names = TRUE)
- matched_data<- data[psm_matchit_data$id, ]
- fit <- survfit(Surv(Months, Status) ~ Surgery, data = matched_data)
- sur_cox<-coxph(Surv(Months,Status) ~ Surgery, data = matched_data)
- sum_cox<-summary(sur_cox)
- hr <- exp(sum_cox$coefficients[, "coef"]) # 回归系数
- p_value <- sum_cox$coefficients[, "Pr(>|z|)"] # P值
- if(p_value<0.0001){
- p="P<0.0001"
- }else if(p_value<0.001){
- p="P<0.001"
- }else if(p_value<0.01){
- p="P<0.01"
- }else if(p_value<0.05){
- p="P<0.05"
- }else{
- p=paste("P=",sprintf("%.3f", p_value))
- }
- ci <- confint(sur_cox) # 95%置信区间
- ci_lower <- exp(ci[, 1]) # 置信区间下限
- ci_upper <- exp(ci[, 2])
- g<-ggsurvplot(fit, # 创建的拟合对象
- #conf.int = TRUE, # 显示置信区间
- surv.median.line = "hv", # 添加中位生存时间线
- xlab = "Time(months)", # 指定x轴标签
- legend = c(0.8,0.75), # 指定图例位置
- legend.title = "Surgery", # 设置图例标题
- legend.labs = c("No/Unknown", "Yes"), # 指定图例分组标签
- title="After PSM-adjusted" # 指定图例分组标签
- )
- g$plot <- g$plot + annotate("text", x = 60, y = 0.55,
- label = paste("HR:", sprintf("%.3f", hr), "\n(95% CI:", sprintf("%.3f", ci_lower), "-", sprintf("%.3f", ci_upper),")","\n",p),
- color = "Black", size = 5)
- print(g)
- ##化疗
- #########################################################
- psm_matchit <- matchit(Chemotherapy ~ Age+Sex+Race+Primary.Site+Histologic.Type+Household.income+T_stage
- +N_stage+Surgery+Radiotherapy+Bone.metastases+Liver.metastases,
- method='nearest', distance = 'glm', ratio=1, replace=F, caliper=0.2, data=data)
- psm_matchit_data = get_matches(psm_matchit)
- tabmatched <- CreateTableOne(vars = c("Age","Sex","Race","Primary.Site","Histologic.Type","Household.income",
- "T_stage","N_stage","Surgery","Radiotherapy","Bone.metastases","Liver.metastases"),
- strata = "Chemotherapy", data = psm_matchit_data, addOverall = TRUE)
- print(tabmatched, smd = TRUE)## Show table with SMD
- matched_data<- data[psm_matchit_data$id, ]
- fit <- survfit(Surv(Months, Status) ~ Chemotherapy, data = matched_data)
- sur_cox<-coxph(Surv(Months,Status) ~ Chemotherapy, data = matched_data)
- sum_cox<-summary(sur_cox)
- hr <- exp(sum_cox$coefficients[, "coef"]) # 回归系数
- p_value <- sum_cox$coefficients[, "Pr(>|z|)"] # P值
- if(p_value<0.0001){
- p="P<0.0001"
- }else if(p_value<0.001){
- p="P<0.001"
- }else if(p_value<0.01){
- p="P<0.01"
- }else if(p_value<0.05){
- p="P<0.05"
- }else{
- p=paste("P=",sprintf("%.3f", p_value))
- }
- ci <- confint(sur_cox) # 95%置信区间
- ci_lower <- exp(ci[, 1]) # 置信区间下限
- ci_upper <- exp(ci[, 2])
- g<-ggsurvplot(fit, # 创建的拟合对象
- #conf.int = TRUE, # 显示置信区间
- surv.median.line = "hv", # 添加中位生存时间线
- xlab = "Time(months)", # 指定x轴标签
- legend = c(0.8,0.75), # 指定图例位置
- legend.title = "Chemotherapy", # 设置图例标题
- legend.labs = c("No/Unknown", "Yes"), # 指定图例分组标签
- )
- g$plot <- g$plot + annotate("text", x = 60, y = 0.55,
- label = paste("HR:", sprintf("%.3f", hr), "\n(95% CI:", sprintf("%.3f", ci_lower), "-", sprintf("%.3f", ci_upper),")","\n",p),
- color = "Black", size = 5)
- print(g)
- ##放疗
- #########################################################
- psm_matchit <- matchit(Radiotherapy ~ Age+Sex+Race+Primary.Site+Histologic.Type+Household.income+T_stage
- +N_stage+Surgery+Chemotherapy+Bone.metastases+Liver.metastases,
- method='nearest', distance = 'glm', ratio=1, replace=F, caliper=0.2, data=data)
- psm_matchit_data = get_matches(psm_matchit)
- tabmatched <- CreateTableOne(vars = c("Age","Sex","Race","Primary.Site","Histologic.Type","Household.income",
- "T_stage","N_stage","Surgery","Chemotherapy","Bone.metastases","Liver.metastases"),
- strata = "Radiotherapy", data = psm_matchit_data, addOverall = TRUE)
- print(tabmatched, smd = TRUE)## Show table with SMD
- matched_data<- data[psm_matchit_data$id, ]
- fit <- survfit(Surv(Months, Status) ~ Radiotherapy, data = matched_data)
- sur_cox<-coxph(Surv(Months,Status) ~ Radiotherapy, data = matched_data)
- sum_cox<-summary(sur_cox)
- hr <- exp(sum_cox$coefficients[, "coef"]) # 回归系数
- p_value <- sum_cox$coefficients[, "Pr(>|z|)"] # P值
- if(p_value<0.0001){
- p="P<0.0001"
- }else if(p_value<0.001){
- p="P<0.001"
- }else if(p_value<0.01){
- p="P<0.01"
- }else if(p_value<0.05){
- p="P<0.05"
- }else{
- p=paste("P=",sprintf("%.3f", p_value))
- }
- ci <- confint(sur_cox) # 95%置信区间
- ci_lower <- exp(ci[, 1]) # 置信区间下限
- ci_upper <- exp(ci[, 2])
- g<-ggsurvplot(fit, # 创建的拟合对象
- #conf.int = TRUE, # 显示置信区间
- surv.median.line = "hv", # 添加中位生存时间线
- xlab = "Time(months)", # 指定x轴标签
- legend = c(0.8,0.75), # 指定图例位置
- legend.title = "Radiotherapy", # 设置图例标题
- legend.labs = c("No/Unknown", "Yes"), # 指定图例分组标签
- )
- g$plot <- g$plot + annotate("text", x = 60, y = 0.55,
- label = paste("HR:", sprintf("%.3f", hr), "\n(95% CI:", sprintf("%.3f", ci_lower), "-", sprintf("%.3f", ci_upper),")","\n",p),
- color = "Black", size = 5)
- print(g)
- ##组织学类型
- #########################################################################################################################################
- temp=data[data$Histologic.Type=="Adenocarcinoma",]
- psm_matchit <- matchit(Surgery ~ Age+Sex+Race+Primary.Site+Household.income+T_stage
- +N_stage+Chemotherapy+Radiotherapy+Bone.metastases+Liver.metastases,
- method='nearest', distance = 'glm', ratio=1, replace=F, caliper=0.2, data=temp)
- psm_matchit_data = get_matches(psm_matchit)
- H0<- temp[psm_matchit_data$id, ]
- fit <- survfit(Surv(Months, Status) ~ Surgery, data = H0)
- sur_cox<-coxph(Surv(Months,Status) ~ Surgery, data = H0)
- summary(sur_cox)
- sum_cox<-summary(sur_cox)
- hr <- exp(sum_cox$coefficients[, "coef"]) # 回归系数
- p_value <- sum_cox$coefficients[, "Pr(>|z|)"] # P值
- if(p_value<0.0001){
- p="P<0.0001"
- }else if(p_value<0.001){
- p="P<0.001"
- }else if(p_value<0.01){
- p="P<0.01"
- }else if(p_value<0.05){
- p="P<0.05"
- }else{
- p=paste("P=",sprintf("%.3f", p_value))
- }
- ci <- confint(sur_cox) # 95%置信区间
- ci_lower <- exp(ci[, 1]) # 置信区间下限
- ci_upper <- exp(ci[, 2])
- g<-ggsurvplot(fit, # 创建的拟合对象
- surv.median.line = "hv", # 添加中位生存时间线
- xlab = "Time(months)", # 指定x轴标签
- legend = c(0.8,0.75), # 指定图例位置
- legend.title = "Surgery", # 设置图例标题
- legend.labs = c("No/Unknown", "Yes"),
- title="Histologic Type:Adenocarcinoma" # 指定图例分组标签
- )
- g$plot <- g$plot + annotate("text", x = 60, y = 0.55,
- label = paste("HR:", sprintf("%.3f", hr), "\n(95% CI:", sprintf("%.3f", ci_lower), "-", sprintf("%.3f", ci_upper),")","\n",p),
- color = "Black", size = 5)
- print(g)
- ###############################################################################
- temp=data[data$Histologic.Type=="Squamous cell carcinoma",]
- psm_matchit <- matchit(Surgery ~ Age+Sex+Race+Primary.Site+Household.income+T_stage
- +N_stage+Chemotherapy+Radiotherapy+Bone.metastases+Liver.metastases,
- method='nearest', distance = 'glm', ratio=1, replace=F, caliper=0.2, data=temp)
- psm_matchit_data = get_matches(psm_matchit)
- H0<- temp[psm_matchit_data$id, ]
- fit <- survfit(Surv(Months, Status) ~ Surgery, data = H0)
- sur_cox<-coxph(Surv(Months,Status) ~ Surgery, data = H0)
- summary(sur_cox)
- sum_cox<-summary(sur_cox)
- hr <- exp(sum_cox$coefficients[, "coef"]) # 回归系数
- p_value <- sum_cox$coefficients[, "Pr(>|z|)"] # P值
- if(p_value<0.0001){
- p="P<0.0001"
- }else if(p_value<0.001){
- p="P<0.001"
- }else if(p_value<0.01){
- p="P<0.01"
- }else if(p_value<0.05){
- p="P<0.05"
- }else{
- p=paste("P=",sprintf("%.3f", p_value))
- }
- ci <- confint(sur_cox) # 95%置信区间
- ci_lower <- exp(ci[, 1]) # 置信区间下限
- ci_upper <- exp(ci[, 2])
- g<-ggsurvplot(fit, # 创建的拟合对象
- surv.median.line = "hv", # 添加中位生存时间线
- xlab = "Time(months)", # 指定x轴标签
- legend = c(0.8,0.75), # 指定图例位置
- legend.title = "Surgery", # 设置图例标题
- legend.labs = c("No/Unknown", "Yes"),
- title="Histologic Type:Squamous cell carcinoma" # 指定图例分组标签
- )
- g$plot <- g$plot + annotate("text", x = 60, y = 0.55,
- label = paste("HR:", sprintf("%.3f", hr), "\n(95% CI:", sprintf("%.3f", ci_lower), "-", sprintf("%.3f", ci_upper),")","\n",p),
- color = "Black", size = 5)
- print(g)
- ##############################################################################
- temp=data[data$Histologic.Type=="Others",]
- psm_matchit <- matchit(Surgery ~ Age+Sex+Race+Primary.Site+Household.income+T_stage
- +N_stage+Chemotherapy+Radiotherapy+Bone.metastases+Liver.metastases,
- method='nearest', distance = 'glm', ratio=1, replace=F, caliper=0.2, data=temp)
- psm_matchit_data = get_matches(psm_matchit)
- H0<- temp[psm_matchit_data$id, ]
- fit <- survfit(Surv(Months, Status) ~ Surgery, data = H0)
- sur_cox<-coxph(Surv(Months,Status) ~ Surgery, data = H0)
- sum_cox<-summary(sur_cox)
- hr <- exp(sum_cox$coefficients[, "coef"]) # 回归系数
- p_value <- sum_cox$coefficients[, "Pr(>|z|)"] # P值
- if(p_value<0.0001){
- p="P<0.0001"
- }else if(p_value<0.001){
- p="P<0.001"
- }else if(p_value<0.01){
- p="P<0.01"
- }else if(p_value<0.05){
- p="P<0.05"
- }else{
- p=paste("P=",sprintf("%.3f", p_value))
- }
- ci <- confint(sur_cox) # 95%置信区间
- ci_lower <- exp(ci[, 1]) # 置信区间下限
- ci_upper <- exp(ci[, 2])
- g<-ggsurvplot(fit, # 创建的拟合对象
- surv.median.line = "hv", # 添加中位生存时间线
- xlab = "Time(months)", # 指定x轴标签
- legend = c(0.8,0.75), # 指定图例位置
- legend.title = "Surgery", # 设置图例标题
- legend.labs = c("No/Unknown", "Yes"),
- title="Histologic Type:Others" # 指定图例分组标签
- )
- g$plot <- g$plot + annotate("text", x = 60, y = 0.55,
- label = paste("HR:", sprintf("%.3f", hr), "\n(95% CI:", sprintf("%.3f", ci_lower), "-", sprintf("%.3f", ci_upper),")","\n",p),
- color = "Black", size = 5)
- print(g)
- ##T分期
- ######################################################################################################################################################
- temp=data[data$T_stage=="T1",]
- psm_matchit <- matchit(Surgery ~ Age+Sex+Race+Primary.Site+Histologic.Type+Household.income
- +N_stage+Chemotherapy+Radiotherapy+Bone.metastases+Liver.metastases,
- method='nearest', distance = 'glm', ratio=1, replace=F, caliper=0.2, data=temp)
- psm_matchit_data = get_matches(psm_matchit)
- T0<- temp[psm_matchit_data$id, ]
- fit <- survfit(Surv(Months, Status) ~ Surgery, data = T0)
- sur_cox<-coxph(Surv(Months,Status) ~ Surgery, data = T0)
- sum_cox<-summary(sur_cox)
- hr <- exp(sum_cox$coefficients[, "coef"]) # 回归系数
- p_value <- sum_cox$coefficients[, "Pr(>|z|)"] # P值
- if(p_value<0.0001){
- p="P<0.0001"
- }else if(p_value<0.001){
- p="P<0.001"
- }else if(p_value<0.01){
- p="P<0.01"
- }else if(p_value<0.05){
- p="P<0.05"
- }else{
- p=paste("P=",sprintf("%.3f", p_value))
- }
- ci <- confint(sur_cox) # 95%置信区间
- ci_lower <- exp(ci[, 1]) # 置信区间下限
- ci_upper <- exp(ci[, 2])
- g<-ggsurvplot(fit, # 创建的拟合对象
- surv.median.line = "hv", # 添加中位生存时间线
- xlab = "Time(months)", # 指定x轴标签
- legend = c(0.8,0.75), # 指定图例位置
- legend.title = "Surgery", # 设置图例标题
- legend.labs = c("No/Unknown", "Yes"),
- title="T-stage:T1" # 指定图例分组标签
- )
- g <- g$plot + annotate("text", x = 60, y = 0.55,
- label = paste("HR:", sprintf("%.3f", hr), "\n(95% CI:", sprintf("%.3f", ci_lower), "-", sprintf("%.3f", ci_upper),")","\n",p),
- color = "Black", size = 5)
- print(g)
- ###########################################################################
- temp=data[data$T_stage=="T2",]
- psm_matchit <- matchit(Surgery ~ Age+Sex+Race+Primary.Site+Histologic.Type+Household.income
- +N_stage+Chemotherapy+Radiotherapy+Bone.metastases+Liver.metastases,
- method='nearest', distance = 'glm', ratio=1, replace=F, caliper=0.2, data=temp)
- psm_matchit_data = get_matches(psm_matchit)
- T0<- temp[psm_matchit_data$id, ]
- fit <- survfit(Surv(Months, Status) ~ Surgery, data = T0)
- sur_cox<-coxph(Surv(Months,Status) ~ Surgery, data = T0)
- sum_cox<-summary(sur_cox)
- hr <- exp(sum_cox$coefficients[, "coef"]) # 回归系数
- p_value <- sum_cox$coefficients[, "Pr(>|z|)"] # P值
- if(p_value<0.0001){
- p="P<0.0001"
- }else if(p_value<0.001){
- p="P<0.001"
- }else if(p_value<0.01){
- p="P<0.01"
- }else if(p_value<0.05){
- p="P<0.05"
- }else{
- p=paste("P=",sprintf("%.3f", p_value))
- }
- ci <- confint(sur_cox) # 95%置信区间
- ci_lower <- exp(ci[, 1]) # 置信区间下限
- ci_upper <- exp(ci[, 2])
- g<-ggsurvplot(fit, # 创建的拟合对象
- surv.median.line = "hv", # 添加中位生存时间线
- xlab = "Time(months)", # 指定x轴标签
- legend = c(0.8,0.75), # 指定图例位置
- legend.title = "Surgery", # 设置图例标题
- legend.labs = c("No/Unknown", "Yes"),
- title="T-stage:T2" # 指定图例分组标签
- )
- g <- g$plot + annotate("text", x = 60, y = 0.55,
- label = paste("HR:", sprintf("%.3f", hr), "\n(95% CI:", sprintf("%.3f", ci_lower), "-", sprintf("%.3f", ci_upper),")","\n",p),
- color = "Black", size = 5)
- print(g)
- ###########################################################################
- temp=data[data$T_stage=="T3",]
- psm_matchit <- matchit(Surgery ~ Age+Sex+Race+Primary.Site+Histologic.Type+Household.income
- +N_stage+Chemotherapy+Radiotherapy+Bone.metastases+Liver.metastases,
- method='nearest', distance = 'glm', ratio=1, replace=F, caliper=0.2, data=temp)
- psm_matchit_data = get_matches(psm_matchit)
- T0<- temp[psm_matchit_data$id, ]
- fit <- survfit(Surv(Months, Status) ~ Surgery, data = T0)
- sur_cox<-coxph(Surv(Months,Status) ~ Surgery, data = T0)
- sum_cox<-summary(sur_cox)
- hr <- exp(sum_cox$coefficients[, "coef"]) # 回归系数
- p_value <- sum_cox$coefficients[, "Pr(>|z|)"] # P值
- if(p_value<0.0001){
- p="P<0.0001"
- }else if(p_value<0.001){
- p="P<0.001"
- }else if(p_value<0.01){
- p="P<0.01"
- }else if(p_value<0.05){
- p="P<0.05"
- }else{
- p=paste("P=",sprintf("%.3f", p_value))
- }
- ci <- confint(sur_cox) # 95%置信区间
- ci_lower <- exp(ci[, 1]) # 置信区间下限
- ci_upper <- exp(ci[, 2])
- g<-ggsurvplot(fit, # 创建的拟合对象
- surv.median.line = "hv", # 添加中位生存时间线
- xlab = "Time(months)", # 指定x轴标签
- legend = c(0.8,0.75), # 指定图例位置
- legend.title = "Surgery", # 设置图例标题
- legend.labs = c("No/Unknown", "Yes"),
- title="T-stage:T3" # 指定图例分组标签
- )
- g <- g$plot + annotate("text", x = 60, y = 0.55,
- label = paste("HR:", sprintf("%.3f", hr), "\n(95% CI:", sprintf("%.3f", ci_lower), "-", sprintf("%.3f", ci_upper),")","\n",p),
- color = "Black", size = 5)
- print(g)
- ###########################################################################
- temp=data[data$T_stage=="T4",]
- psm_matchit <- matchit(Surgery ~ Age+Sex+Race+Primary.Site+Histologic.Type+Household.income
- +N_stage+Chemotherapy+Radiotherapy+Bone.metastases+Liver.metastases,
- method='nearest', distance = 'glm', ratio=1, replace=F, caliper=0.2, data=temp)
- psm_matchit_data = get_matches(psm_matchit)
- T0<- temp[psm_matchit_data$id, ]
- fit <- survfit(Surv(Months, Status) ~ Surgery, data = T0)
- sur_cox<-coxph(Surv(Months,Status) ~ Surgery, data = T0)
- sum_cox<-summary(sur_cox)
- hr <- exp(sum_cox$coefficients[, "coef"]) # 回归系数
- p_value <- sum_cox$coefficients[, "Pr(>|z|)"] # P值
- if(p_value<0.0001){
- p="P<0.0001"
- }else if(p_value<0.001){
- p="P<0.001"
- }else if(p_value<0.01){
- p="P<0.01"
- }else if(p_value<0.05){
- p="P<0.05"
- }else{
- p=paste("P=",sprintf("%.3f", p_value))
- }
- ci <- confint(sur_cox) # 95%置信区间
- ci_lower <- exp(ci[, 1]) # 置信区间下限
- ci_upper <- exp(ci[, 2])
- g<-ggsurvplot(fit, # 创建的拟合对象
- surv.median.line = "hv", # 添加中位生存时间线
- xlab = "Time(months)", # 指定x轴标签
- legend = c(0.8,0.75), # 指定图例位置
- legend.title = "Surgery", # 设置图例标题
- legend.labs = c("No/Unknown", "Yes"),
- title="T-stage:T4" # 指定图例分组标签
- )
- g<- g$plot + annotate("text", x = 60, y = 0.55,
- label = paste("HR:", sprintf("%.3f", hr), "\n(95% CI:", sprintf("%.3f", ci_lower), "-", sprintf("%.3f", ci_upper),")","\n",p),
- color = "Black", size = 5)
- print(g)
- #################################################################################
- temp=data[data$T_stage=="Others",]
- psm_matchit <- matchit(Surgery ~ Age+Sex+Race+Primary.Site+Histologic.Type+Household.income
- +N_stage+Chemotherapy+Radiotherapy+Bone.metastases+Liver.metastases,
- method='nearest', distance = 'glm', ratio=1, replace=F, caliper=0.2, data=temp)
- psm_matchit_data = get_matches(psm_matchit)
- T0<- temp[psm_matchit_data$id, ]
- fit <- survfit(Surv(Months, Status) ~ Surgery, data = T0)
- sur_cox<-coxph(Surv(Months,Status) ~ Surgery, data = T0)
- sum_cox<-summary(sur_cox)
- hr <- exp(sum_cox$coefficients[, "coef"]) # 回归系数
- p_value <- sum_cox$coefficients[, "Pr(>|z|)"] # P值
- if(p_value<0.0001){
- p="P<0.0001"
- }else if(p_value<0.001){
- p="P<0.001"
- }else if(p_value<0.01){
- p="P<0.01"
- }else if(p_value<0.05){
- p="P<0.05"
- }else{
- p=paste("P=",sprintf("%.3f", p_value))
- }
- ci <- confint(sur_cox) # 95%置信区间
- ci_lower <- exp(ci[, 1]) # 置信区间下限
- ci_upper <- exp(ci[, 2])
- g<-ggsurvplot(fit, # 创建的拟合对象
- surv.median.line = "hv", # 添加中位生存时间线
- xlab = "Time(months)", # 指定x轴标签
- legend = c(0.8,0.75), # 指定图例位置
- legend.title = "Surgery", # 设置图例标题
- legend.labs = c("No/Unknown", "Yes"),
- title="T-stage:Others" # 指定图例分组标签
- )
- g <- g$plot + annotate("text", x = 60, y = 0.55,
- label = paste("HR:", sprintf("%.3f", hr), "\n(95% CI:", sprintf("%.3f", ci_lower), "-", sprintf("%.3f", ci_upper),")","\n",p),
- color = "Black", size = 5)
- print(g)
- ##N分期
- ######################################################################################################################################################
- temp=data[data$N_stage=="N0",]
- psm_matchit <- matchit(Surgery ~ Age+Sex+Race+Primary.Site+Histologic.Type+Household.income
- +T_stage+Chemotherapy+Radiotherapy+Bone.metastases+Liver.metastases,
- method='nearest', distance = 'glm', ratio=1, replace=F, caliper=0.2, data=temp)
- psm_matchit_data = get_matches(psm_matchit)
- N0<- temp[psm_matchit_data$id, ]
- fit <- survfit(Surv(Months, Status) ~ Surgery, data = N0)
- sur_cox<-coxph(Surv(Months,Status) ~ Surgery, data = N0)
- sum_cox<-summary(sur_cox)
- hr <- exp(sum_cox$coefficients[, "coef"]) # 回归系数
- p_value <- sum_cox$coefficients[, "Pr(>|z|)"] # P值
- if(p_value<0.0001){
- p="P<0.0001"
- }else if(p_value<0.001){
- p="P<0.001"
- }else if(p_value<0.01){
- p="P<0.01"
- }else if(p_value<0.05){
- p="P<0.05"
- }else{
- p=paste("P=",sprintf("%.3f", p_value))
- }
- ci <- confint(sur_cox) # 95%置信区间
- ci_lower <- exp(ci[, 1]) # 置信区间下限
- ci_upper <- exp(ci[, 2])
- g<-ggsurvplot(fit, # 创建的拟合对象
- surv.median.line = "hv", # 添加中位生存时间线
- xlab = "Time(months)", # 指定x轴标签
- legend = c(0.8,0.75), # 指定图例位置
- legend.title = "Surgery", # 设置图例标题
- legend.labs = c("No/Unknown", "Yes"),
- title="N-stage:N0" # 指定图例分组标签
- )
- g$plot <- g$plot + annotate("text", x = 60, y = 0.55,
- label = paste("HR:", sprintf("%.3f", hr), "\n(95% CI:", sprintf("%.3f", ci_lower), "-", sprintf("%.3f", ci_upper),")","\n",p),
- color = "Black", size = 5)
- print(g)
- ###########################################################################
- temp=data[data$N_stage=="N1",]
- psm_matchit <- matchit(Surgery ~ Age+Sex+Race+Primary.Site+Histologic.Type+Household.income
- +T_stage+Chemotherapy+Radiotherapy+Bone.metastases+Liver.metastases,
- method='nearest', distance = 'glm', ratio=1, replace=F, caliper=0.2, data=temp)
- psm_matchit_data = get_matches(psm_matchit)
- N0<- temp[psm_matchit_data$id, ]
- fit <- survfit(Surv(Months, Status) ~ Surgery, data = N0)
- sur_cox<-coxph(Surv(Months,Status) ~ Surgery, data = N0)
- sum_cox<-summary(sur_cox)
- hr <- exp(sum_cox$coefficients[, "coef"]) # 回归系数
- p_value <- sum_cox$coefficients[, "Pr(>|z|)"] # P值
- if(p_value<0.0001){
- p="P<0.0001"
- }else if(p_value<0.001){
- p="P<0.001"
- }else if(p_value<0.01){
- p="P<0.01"
- }else if(p_value<0.05){
- p="P<0.05"
- }else{
- p=paste("P=",sprintf("%.3f", p_value))
- }
- ci <- confint(sur_cox) # 95%置信区间
- ci_lower <- exp(ci[, 1]) # 置信区间下限
- ci_upper <- exp(ci[, 2])
- g<-ggsurvplot(fit, # 创建的拟合对象
- surv.median.line = "hv", # 添加中位生存时间线
- xlab = "Time(months)", # 指定x轴标签
- legend = c(0.8,0.75), # 指定图例位置
- legend.title = "Surgery", # 设置图例标题
- legend.labs = c("No/Unknown", "Yes"),
- title="N-stage:N1" # 指定图例分组标签
- )
- g$plot <- g$plot + annotate("text", x = 60, y = 0.55,
- label = paste("HR:", sprintf("%.3f", hr), "\n(95% CI:", sprintf("%.3f", ci_lower), "-", sprintf("%.3f", ci_upper),")","\n",p),
- color = "Black", size = 5)
- print(g)
- ###########################################################################
- temp=data[data$N_stage=="N2",]
- psm_matchit <- matchit(Surgery ~ Age+Sex+Race+Primary.Site+Histologic.Type+Household.income
- +T_stage+Chemotherapy+Radiotherapy+Bone.metastases+Liver.metastases,
- method='nearest', distance = 'glm', ratio=1, replace=F, caliper=0.2, data=temp)
- psm_matchit_data = get_matches(psm_matchit)
- N0<- temp[psm_matchit_data$id, ]
- fit <- survfit(Surv(Months, Status) ~ Surgery, data = N0)
- sur_cox<-coxph(Surv(Months,Status) ~ Surgery, data = N0)
- sum_cox<-summary(sur_cox)
- hr <- exp(sum_cox$coefficients[, "coef"]) # 回归系数
- p_value <- sum_cox$coefficients[, "Pr(>|z|)"] # P值
- if(p_value<0.0001){
- p="P<0.0001"
- }else if(p_value<0.001){
- p="P<0.001"
- }else if(p_value<0.01){
- p="P<0.01"
- }else if(p_value<0.05){
- p="P<0.05"
- }else{
- p=paste("P=",sprintf("%.3f", p_value))
- }
- ci <- confint(sur_cox) # 95%置信区间
- ci_lower <- exp(ci[, 1]) # 置信区间下限
- ci_upper <- exp(ci[, 2])
- g<-ggsurvplot(fit, # 创建的拟合对象
- surv.median.line = "hv", # 添加中位生存时间线
- xlab = "Time(months)", # 指定x轴标签
- legend = c(0.8,0.75), # 指定图例位置
- legend.title = "Surgery", # 设置图例标题
- legend.labs = c("No/Unknown", "Yes"),
- title="N-stage:N2" # 指定图例分组标签
- )
- g$plot <- g$plot + annotate("text", x = 60, y = 0.55,
- label = paste("HR:", sprintf("%.3f", hr), "\n(95% CI:", sprintf("%.3f", ci_lower), "-", sprintf("%.3f", ci_upper),")","\n",p),
- color = "Black", size = 5)
- print(g)
- ###########################################################################
- temp=data[data$N_stage=="N3",]
- psm_matchit <- matchit(Surgery ~ Age+Sex+Race+Primary.Site+Histologic.Type+Household.income
- +T_stage+Chemotherapy+Radiotherapy+Bone.metastases+Liver.metastases,
- method='nearest', distance = 'glm', ratio=1, replace=F, caliper=0.2, data=temp)
- psm_matchit_data = get_matches(psm_matchit)
- N0<- temp[psm_matchit_data$id, ]
- fit <- survfit(Surv(Months, Status) ~ Surgery, data = N0)
- sur_cox<-coxph(Surv(Months,Status) ~ Surgery, data = N0)
- sum_cox<-summary(sur_cox)
- hr <- exp(sum_cox$coefficients[, "coef"]) # 回归系数
- p_value <- sum_cox$coefficients[, "Pr(>|z|)"] # P值
- if(p_value<0.0001){
- p="P<0.0001"
- }else if(p_value<0.001){
- p="P<0.001"
- }else if(p_value<0.01){
- p="P<0.01"
- }else if(p_value<0.05){
- p="P<0.05"
- }else{
- p=paste("P=",sprintf("%.3f", p_value))
- }
- ci <- confint(sur_cox) # 95%置信区间
- ci_lower <- exp(ci[, 1]) # 置信区间下限
- ci_upper <- exp(ci[, 2])
- g<-ggsurvplot(fit, # 创建的拟合对象
- surv.median.line = "hv", # 添加中位生存时间线
- xlab = "Time(months)", # 指定x轴标签
- legend = c(0.8,0.75), # 指定图例位置
- legend.title = "Surgery", # 设置图例标题
- legend.labs = c("No/Unknown", "Yes"),
- title="N-stage:N3" # 指定图例分组标签
- )
- g$plot <- g$plot + annotate("text", x = 60, y = 0.55,
- label = paste("HR:", sprintf("%.3f", hr), "\n(95% CI:", sprintf("%.3f", ci_lower), "-", sprintf("%.3f", ci_upper),")","\n",p),
- color = "Black", size = 5)
- print(g)
- #################################################################################
- temp=data[data$N_stage=="NX",]
- psm_matchit <- matchit(Surgery ~ Age+Sex+Race+Primary.Site+Histologic.Type+Household.income
- +T_stage+Chemotherapy+Radiotherapy+Bone.metastases+Liver.metastases,
- method='nearest', distance = 'glm', ratio=1, replace=F, caliper=0.2, data=temp)
- psm_matchit_data = get_matches(psm_matchit)
- N0<- temp[psm_matchit_data$id, ]
- fit <- survfit(Surv(Months, Status) ~ Surgery, data = N0)
- sur_cox<-coxph(Surv(Months,Status) ~ Surgery, data = N0)
- sum_cox<-summary(sur_cox)
- hr <- exp(sum_cox$coefficients[, "coef"]) # 回归系数
- p_value <- sum_cox$coefficients[, "Pr(>|z|)"] # P值
- if(p_value<0.0001){
- p="P<0.0001"
- }else if(p_value<0.001){
- p="P<0.001"
- }else if(p_value<0.01){
- p="P<0.01"
- }else if(p_value<0.05){
- p="P<0.05"
- }else{
- p=paste("P=",sprintf("%.3f", p_value))
- }
- ci <- confint(sur_cox) # 95%置信区间
- ci_lower <- exp(ci[, 1]) # 置信区间下限
- ci_upper <- exp(ci[, 2])
- g<-ggsurvplot(fit, # 创建的拟合对象
- surv.median.line = "hv", # 添加中位生存时间线
- xlab = "Time(months)", # 指定x轴标签
- legend = c(0.8,0.75), # 指定图例位置
- legend.title = "Surgery", # 设置图例标题
- legend.labs = c("No/Unknown", "Yes"),
- title="N-stage:NX" # 指定图例分组标签
- )
- g$plot <- g$plot + annotate("text", x = 60, y = 0.55,
- label = paste("HR:", sprintf("%.3f", hr), "\n(95% CI:", sprintf("%.3f", ci_lower), "-", sprintf("%.3f", ci_upper),")","\n",p),
- color = "Black", size = 5)
- print(g)
- ##肝转移
- ######################################################################################################################################################
- temp=data[data$Liver.metastases=="Yes",]
- psm_matchit <- matchit(Surgery ~ Age+Sex+Race+Primary.Site+Histologic.Type+Household.income
- +T_stage+N_stage+Chemotherapy+Radiotherapy+Bone.metastases,
- method='nearest', distance = 'glm', ratio=1, replace=F, caliper=0.2, data=temp)
- psm_matchit_data = get_matches(psm_matchit)
- T0<- temp[psm_matchit_data$id, ]
- fit <- survfit(Surv(Months, Status) ~ Surgery, data = T0)
- sur_cox<-coxph(Surv(Months,Status) ~ Surgery, data = T0)
- sum_cox<-summary(sur_cox)
- hr <- exp(sum_cox$coefficients[, "coef"]) # 回归系数
- p_value <- sum_cox$coefficients[, "Pr(>|z|)"] # P值
- if(p_value<0.0001){
- p="P<0.0001"
- }else if(p_value<0.001){
- p="P<0.001"
- }else if(p_value<0.01){
- p="P<0.01"
- }else if(p_value<0.05){
- p="P<0.05"
- }else{
- p=paste("P=",sprintf("%.3f", p_value))
- }
- ci <- confint(sur_cox) # 95%置信区间
- ci_lower <- exp(ci[, 1]) # 置信区间下限
- ci_upper <- exp(ci[, 2])
- g<-ggsurvplot(fit, # 创建的拟合对象
- surv.median.line = "hv", # 添加中位生存时间线
- xlab = "Time(months)", # 指定x轴标签
- legend = c(0.8,0.75), # 指定图例位置
- legend.title = "Surgery", # 设置图例标题
- legend.labs = c("No/Unknown", "Yes"),
- title="Liver metastases:Yes" # 指定图例分组标签
- )
- g$plot <- g$plot + annotate("text", x = 60, y = 0.55,
- label = paste("HR:", sprintf("%.3f", hr), "\n(95% CI:", sprintf("%.3f", ci_lower), "-", sprintf("%.3f", ci_upper),")","\n",p),
- color = "Black", size = 5)
- print(g)
- ######################################################################################################################################################
- temp=data[data$Liver.metastases=="No/Unknown",]
- psm_matchit <- matchit(Surgery ~ Age+Sex+Race+Primary.Site+Histologic.Type+Household.income
- +T_stage+N_stage+Chemotherapy+Radiotherapy+Bone.metastases,
- method='nearest', distance = 'glm', ratio=1, replace=F, caliper=0.2, data=temp)
- psm_matchit_data = get_matches(psm_matchit)
- T0<- temp[psm_matchit_data$id, ]
- fit <- survfit(Surv(Months, Status) ~ Surgery, data = T0)
- sur_cox<-coxph(Surv(Months,Status) ~ Surgery, data = T0)
- sum_cox<-summary(sur_cox)
- hr <- exp(sum_cox$coefficients[, "coef"]) # 回归系数
- p_value <- sum_cox$coefficients[, "Pr(>|z|)"] # P值
- if(p_value<0.0001){
- p="P<0.0001"
- }else if(p_value<0.001){
- p="P<0.001"
- }else if(p_value<0.01){
- p="P<0.01"
- }else if(p_value<0.05){
- p="P<0.05"
- }else{
- p=paste("P=",sprintf("%.3f", p_value))
- }
- ci <- confint(sur_cox) # 95%置信区间
- ci_lower <- exp(ci[, 1]) # 置信区间下限
- ci_upper <- exp(ci[, 2])
- g<-ggsurvplot(fit, # 创建的拟合对象
- surv.median.line = "hv", # 添加中位生存时间线
- xlab = "Time(months)", # 指定x轴标签
- legend = c(0.8,0.75), # 指定图例位置
- legend.title = "Surgery", # 设置图例标题
- legend.labs = c("No/Unknown", "Yes"),
- title="Liver metastases:No/Unknown" # 指定图例分组标签
- )
- g$plot <- g$plot + annotate("text", x = 60, y = 0.55,
- label = paste("HR:", sprintf("%.3f", hr), "\n(95% CI:", sprintf("%.3f", ci_lower), "-", sprintf("%.3f", ci_upper),")","\n",p),
- color = "Black", size = 5)
- print(g)
- ##骨转移
- ######################################################################################################################################################
- temp=data[data$Bone.metastases=="Yes",]
- psm_matchit <- matchit(Surgery ~ Age+Sex+Race+Primary.Site+Histologic.Type+Household.income
- +T_stage+N_stage+Chemotherapy+Radiotherapy+Liver.metastases,
- method='nearest', distance = 'glm', ratio=1, replace=F, caliper=0.2, data=temp)
- psm_matchit_data = get_matches(psm_matchit)
- T0<- temp[psm_matchit_data$id, ]
- fit <- survfit(Surv(Months, Status) ~ Surgery, data = T0)
- sur_cox<-coxph(Surv(Months,Status) ~ Surgery, data = T0)
- sum_cox<-summary(sur_cox)
- hr <- exp(sum_cox$coefficients[, "coef"]) # 回归系数
- p_value <- sum_cox$coefficients[, "Pr(>|z|)"] # P值
- if(p_value<0.0001){
- p="P<0.0001"
- }else if(p_value<0.001){
- p="P<0.001"
- }else if(p_value<0.01){
- p="P<0.01"
- }else if(p_value<0.05){
- p="P<0.05"
- }else{
- p=paste("P=",sprintf("%.3f", p_value))
- }
- ci <- confint(sur_cox) # 95%置信区间
- ci_lower <- exp(ci[, 1]) # 置信区间下限
- ci_upper <- exp(ci[, 2])
- g<-ggsurvplot(fit, # 创建的拟合对象
- surv.median.line = "hv", # 添加中位生存时间线
- xlab = "Time(months)", # 指定x轴标签
- legend = c(0.8,0.75), # 指定图例位置
- legend.title = "Surgery", # 设置图例标题
- legend.labs = c("No/Unknown", "Yes"),
- title="Bone metastases:Yes" # 指定图例分组标签
- )
- g$plot <- g$plot + annotate("text", x = 60, y = 0.55,
- label = paste("HR:", sprintf("%.3f", hr), "\n(95% CI:", sprintf("%.3f", ci_lower), "-", sprintf("%.3f", ci_upper),")","\n",p),
- color = "Black", size = 5)
- print(g)
- ######################################################################################################################################################
- temp=data[data$Bone.metastases=="No/Unknown",]
- psm_matchit <- matchit(Surgery ~ Age+Sex+Race+Primary.Site+Histologic.Type+Household.income
- +T_stage+N_stage+Chemotherapy+Radiotherapy+Liver.metastases,
- method='nearest', distance = 'glm', ratio=1, replace=F, caliper=0.2, data=temp)
- psm_matchit_data = get_matches(psm_matchit)
- T0<- temp[psm_matchit_data$id, ]
- fit <- survfit(Surv(Months, Status) ~ Surgery, data = T0)
- sur_cox<-coxph(Surv(Months,Status) ~ Surgery, data = T0)
- sum_cox<-summary(sur_cox)
- hr <- exp(sum_cox$coefficients[, "coef"]) # 回归系数
- p_value <- sum_cox$coefficients[, "Pr(>|z|)"] # P值
- if(p_value<0.0001){
- p="P<0.0001"
- }else if(p_value<0.001){
- p="P<0.001"
- }else if(p_value<0.01){
- p="P<0.01"
- }else if(p_value<0.05){
- p="P<0.05"
- }else{
- p=paste("P=",sprintf("%.3f", p_value))
- }
- ci <- confint(sur_cox) # 95%置信区间
- ci_lower <- exp(ci[, 1]) # 置信区间下限
- ci_upper <- exp(ci[, 2])
- g<-ggsurvplot(fit, # 创建的拟合对象
- surv.median.line = "hv", # 添加中位生存时间线
- xlab = "Time(months)", # 指定x轴标签
- legend = c(0.8,0.75), # 指定图例位置
- legend.title = "Surgery", # 设置图例标题
- legend.labs = c("No/Unknown", "Yes"),
- title="Bone metastases:No/Unknown" # 指定图例分组标签
- )
- g$plot <- g$plot + annotate("text", x = 60, y = 0.55,
- label = paste("HR:", sprintf("%.3f", hr), "\n(95% CI:", sprintf("%.3f", ci_lower), "-", sprintf("%.3f", ci_upper),")","\n",p),
- color = "Black", size = 5)
- print(g)
- ##原发位点
- ######################################################################################################################################################
- temp=data[data$Primary.Site=="Upper lobe, lung",]
- psm_matchit <- matchit(Surgery ~ Age+Sex+Race+Histologic.Type+Household.income
- +T_stage+N_stage+Chemotherapy+Radiotherapy+Liver.metastases+Bone.metastases,
- method='nearest', distance = 'glm', ratio=1, replace=F, caliper=0.2, data=temp)
- psm_matchit_data = get_matches(psm_matchit)
- T0<- temp[psm_matchit_data$id, ]
- fit <- survfit(Surv(Months, Status) ~ Surgery, data = T0)
- sur_cox<-coxph(Surv(Months,Status) ~ Surgery, data = T0)
- sum_cox<-summary(sur_cox)
- hr <- exp(sum_cox$coefficients[, "coef"]) # 回归系数
- p_value <- sum_cox$coefficients[, "Pr(>|z|)"] # P值
- if(p_value<0.0001){
- p="P<0.0001"
- }else if(p_value<0.001){
- p="P<0.001"
- }else if(p_value<0.01){
- p="P<0.01"
- }else if(p_value<0.05){
- p="P<0.05"
- }else{
- p=paste("P=",sprintf("%.3f", p_value))
- }
- ci <- confint(sur_cox) # 95%置信区间
- ci_lower <- exp(ci[, 1]) # 置信区间下限
- ci_upper <- exp(ci[, 2])
- g<-ggsurvplot(fit, # 创建的拟合对象
- surv.median.line = "hv", # 添加中位生存时间线
- xlab = "Time(months)", # 指定x轴标签
- legend = c(0.8,0.75), # 指定图例位置
- legend.title = "Surgery", # 设置图例标题
- legend.labs = c("No/Unknown", "Yes"),
- title="Primary.Site:Upper lobe, lung" # 指定图例分组标签
- )
- g$plot <- g$plot + annotate("text", x = 60, y = 0.55,
- label = paste("HR:", sprintf("%.3f", hr), "\n(95% CI:", sprintf("%.3f", ci_lower), "-", sprintf("%.3f", ci_upper),")","\n",p),
- color = "Black", size = 5)
- print(g)
- ######################################################################################################################################################
- temp=data[data$Primary.Site=="Lower lobe, lung",]
- psm_matchit <- matchit(Surgery ~ Age+Sex+Race+Histologic.Type+Household.income
- +T_stage+N_stage+Chemotherapy+Radiotherapy+Liver.metastases+Bone.metastases,
- method='nearest', distance = 'glm', ratio=1, replace=F, caliper=0.2, data=temp)
- psm_matchit_data = get_matches(psm_matchit)
- T0<- temp[psm_matchit_data$id, ]
- fit <- survfit(Surv(Months, Status) ~ Surgery, data = T0)
- sur_cox<-coxph(Surv(Months,Status) ~ Surgery, data = T0)
- sum_cox<-summary(sur_cox)
- hr <- exp(sum_cox$coefficients[, "coef"]) # 回归系数
- p_value <- sum_cox$coefficients[, "Pr(>|z|)"] # P值
- if(p_value<0.0001){
- p="P<0.0001"
- }else if(p_value<0.001){
- p="P<0.001"
- }else if(p_value<0.01){
- p="P<0.01"
- }else if(p_value<0.05){
- p="P<0.05"
- }else{
- p=paste("P=",sprintf("%.3f", p_value))
- }
- ci <- confint(sur_cox) # 95%置信区间
- ci_lower <- exp(ci[, 1]) # 置信区间下限
- ci_upper <- exp(ci[, 2])
- g<-ggsurvplot(fit, # 创建的拟合对象
- surv.median.line = "hv", # 添加中位生存时间线
- xlab = "Time(months)", # 指定x轴标签
- legend = c(0.8,0.75), # 指定图例位置
- legend.title = "Surgery", # 设置图例标题
- legend.labs = c("No/Unknown", "Yes"),
- title="Primary.Site:Lower lobe, lung" # 指定图例分组标签
- )
- g$plot <- g$plot + annotate("text", x = 60, y = 0.55,
- label = paste("HR:", sprintf("%.3f", hr), "\n(95% CI:", sprintf("%.3f", ci_lower), "-", sprintf("%.3f", ci_upper),")","\n",p),
- color = "Black", size = 5)
- print(g)
- ######################################################################################################################################################
- temp=data[data$Primary.Site=="Lung, NOS",]
- psm_matchit <- matchit(Surgery ~ Age+Sex+Race+Histologic.Type+Household.income
- +T_stage+N_stage+Chemotherapy+Radiotherapy+Liver.metastases+Bone.metastases,
- method='nearest', distance = 'glm', ratio=1, replace=F, caliper=0.2, data=temp)
- psm_matchit_data = get_matches(psm_matchit)
- T0<- temp[psm_matchit_data$id, ]
- fit <- survfit(Surv(Months, Status) ~ Surgery, data = T0)
- sur_cox<-coxph(Surv(Months,Status) ~ Surgery, data = T0)
- sum_cox<-summary(sur_cox)
- hr <- exp(sum_cox$coefficients[, "coef"]) # 回归系数
- p_value <- sum_cox$coefficients[, "Pr(>|z|)"] # P值
- if(p_value<0.0001){
- p="P<0.0001"
- }else if(p_value<0.001){
- p="P<0.001"
- }else if(p_value<0.01){
- p="P<0.01"
- }else if(p_value<0.05){
- p="P<0.05"
- }else{
- p=paste("P=",sprintf("%.3f", p_value))
- }
- ci <- confint(sur_cox) # 95%置信区间
- ci_lower <- exp(ci[, 1]) # 置信区间下限
- ci_upper <- exp(ci[, 2])
- g<-ggsurvplot(fit, # 创建的拟合对象
- surv.median.line = "hv", # 添加中位生存时间线
- xlab = "Time(months)", # 指定x轴标签
- legend = c(0.8,0.75), # 指定图例位置
- legend.title = "Surgery", # 设置图例标题
- legend.labs = c("No/Unknown", "Yes"),
- title="Primary.Site:Lung, NOS" # 指定图例分组标签
- )
- g$plot <- g$plot + annotate("text", x = 60, y = 0.55,
- label = paste("HR:", sprintf("%.3f", hr), "\n(95% CI:", sprintf("%.3f", ci_lower), "-", sprintf("%.3f", ci_upper),")","\n",p),
- color = "Black", size = 5)
- print(g)
- ######################################################################################################################################################
- temp=data[data$Primary.Site=="Others",]
- psm_matchit <- matchit(Surgery ~ Age+Sex+Race+Histologic.Type+Household.income
- +T_stage+N_stage+Chemotherapy+Radiotherapy+Liver.metastases+Bone.metastases,
- method='nearest', distance = 'glm', ratio=1, replace=F, caliper=0.2, data=temp)
- psm_matchit_data = get_matches(psm_matchit)
- T0<- temp[psm_matchit_data$id, ]
- fit <- survfit(Surv(Months, Status) ~ Surgery, data = T0)
- sur_cox<-coxph(Surv(Months,Status) ~ Surgery, data = T0)
- sum_cox<-summary(sur_cox)
- hr <- exp(sum_cox$coefficients[, "coef"]) # 回归系数
- p_value <- sum_cox$coefficients[, "Pr(>|z|)"] # P值
- if(p_value<0.0001){
- p="P<0.0001"
- }else if(p_value<0.001){
- p="P<0.001"
- }else if(p_value<0.01){
- p="P<0.01"
- }else if(p_value<0.05){
- p="P<0.05"
- }else{
- p=paste("P=",sprintf("%.3f", p_value))
- }
- ci <- confint(sur_cox) # 95%置信区间
- ci_lower <- exp(ci[, 1]) # 置信区间下限
- ci_upper <- exp(ci[, 2])
- g<-ggsurvplot(fit, # 创建的拟合对象
- surv.median.line = "hv", # 添加中位生存时间线
- xlab = "Time(months)", # 指定x轴标签
- legend = c(0.8,0.75), # 指定图例位置
- legend.title = "Surgery", # 设置图例标题
- legend.labs = c("No/Unknown", "Yes"),
- title="Primary.Site:Others" # 指定图例分组标签
- )
- g$plot <- g$plot + annotate("text", x = 60, y = 0.55,
- label = paste("HR:", sprintf("%.3f", hr), "\n(95% CI:", sprintf("%.3f", ci_lower), "-", sprintf("%.3f", ci_upper),")","\n",p),
- color = "Black", size = 5)
- print(g)
- ##性别
- ######################################################################################################################################################
- temp=data[data$Sex=="Female",]
- psm_matchit <- matchit(Surgery ~ Age+Race+Primary.Site+Histologic.Type+Household.income
- +T_stage+N_stage+Chemotherapy+Radiotherapy+Liver.metastases+Bone.metastases,
- method='nearest', distance = 'glm', ratio=1, replace=F, caliper=0.2, data=temp)
- psm_matchit_data = get_matches(psm_matchit)
- T0<- temp[psm_matchit_data$id, ]
- fit <- survfit(Surv(Months, Status) ~ Surgery, data = T0)
- sur_cox<-coxph(Surv(Months,Status) ~ Surgery, data = T0)
- sum_cox<-summary(sur_cox)
- hr <- exp(sum_cox$coefficients[, "coef"]) # 回归系数
- p_value <- sum_cox$coefficients[, "Pr(>|z|)"] # P值
- if(p_value<0.0001){
- p="P<0.0001"
- }else if(p_value<0.001){
- p="P<0.001"
- }else if(p_value<0.01){
- p="P<0.01"
- }else if(p_value<0.05){
- p="P<0.05"
- }else{
- p=paste("P=",sprintf("%.3f", p_value))
- }
- ci <- confint(sur_cox) # 95%置信区间
- ci_lower <- exp(ci[, 1]) # 置信区间下限
- ci_upper <- exp(ci[, 2])
- g<-ggsurvplot(fit, # 创建的拟合对象
- surv.median.line = "hv", # 添加中位生存时间线
- xlab = "Time(months)", # 指定x轴标签
- legend = c(0.8,0.75), # 指定图例位置
- legend.title = "Surgery", # 设置图例标题
- legend.labs = c("No/Unknown", "Yes"),
- title="Sex:Female" # 指定图例分组标签
- )
- g$plot <- g$plot + annotate("text", x = 60, y = 0.55,
- label = paste("HR:", sprintf("%.3f", hr), "\n(95% CI:", sprintf("%.3f", ci_lower), "-", sprintf("%.3f", ci_upper),")","\n",p),
- color = "Black", size = 5)
- print(g)
- ######################################################################################################################################################
- temp=data[data$Sex=="Male",]
- psm_matchit <- matchit(Surgery ~ Age+Race+Primary.Site+Histologic.Type+Household.income
- +T_stage+N_stage+Chemotherapy+Radiotherapy+Liver.metastases+Bone.metastases,
- method='nearest', distance = 'glm', ratio=1, replace=F, caliper=0.2, data=temp)
- psm_matchit_data = get_matches(psm_matchit)
- T0<- temp[psm_matchit_data$id, ]
- fit <- survfit(Surv(Months, Status) ~ Surgery, data = T0)
- sur_cox<-coxph(Surv(Months,Status) ~ Surgery, data = T0)
- sum_cox<-summary(sur_cox)
- hr <- exp(sum_cox$coefficients[, "coef"]) # 回归系数
- p_value <- sum_cox$coefficients[, "Pr(>|z|)"] # P值
- if(p_value<0.0001){
- p="P<0.0001"
- }else if(p_value<0.001){
- p="P<0.001"
- }else if(p_value<0.01){
- p="P<0.01"
- }else if(p_value<0.05){
- p="P<0.05"
- }else{
- p=paste("P=",sprintf("%.3f", p_value))
- }
- ci <- confint(sur_cox) # 95%置信区间
- ci_lower <- exp(ci[, 1]) # 置信区间下限
- ci_upper <- exp(ci[, 2])
- g<-ggsurvplot(fit, # 创建的拟合对象
- surv.median.line = "hv", # 添加中位生存时间线
- xlab = "Time(months)", # 指定x轴标签
- legend = c(0.8,0.75), # 指定图例位置
- legend.title = "Surgery", # 设置图例标题
- legend.labs = c("No/Unknown", "Yes"),
- title="Sex:Male" # 指定图例分组标签
- )
- g$plot <- g$plot + annotate("text", x = 60, y = 0.55,
- label = paste("HR:", sprintf("%.3f", hr), "\n(95% CI:", sprintf("%.3f", ci_lower), "-", sprintf("%.3f", ci_upper),")","\n",p),
- color = "Black", size = 5)
- print(g)
- ##种族
- ######################################################################################################################################################
- temp=data[data$Race=="White",]
- psm_matchit <- matchit(Surgery ~ Age+Sex+Primary.Site+Histologic.Type+Household.income
- +T_stage+N_stage+Chemotherapy+Radiotherapy+Liver.metastases+Bone.metastases,
- method='nearest', distance = 'glm', ratio=1, replace=F, caliper=0.2, data=temp)
- psm_matchit_data = get_matches(psm_matchit)
- T0<- temp[psm_matchit_data$id, ]
- fit <- survfit(Surv(Months, Status) ~ Surgery, data = T0)
- sur_cox<-coxph(Surv(Months,Status) ~ Surgery, data = T0)
- sum_cox<-summary(sur_cox)
- hr <- exp(sum_cox$coefficients[, "coef"]) # 回归系数
- p_value <- sum_cox$coefficients[, "Pr(>|z|)"] # P值
- if(p_value<0.0001){
- p="P<0.0001"
- }else if(p_value<0.001){
- p="P<0.001"
- }else if(p_value<0.01){
- p="P<0.01"
- }else if(p_value<0.05){
- p="P<0.05"
- }else{
- p=paste("P=",sprintf("%.3f", p_value))
- }
- ci <- confint(sur_cox) # 95%置信区间
- ci_lower <- exp(ci[, 1]) # 置信区间下限
- ci_upper <- exp(ci[, 2])
- g<-ggsurvplot(fit, # 创建的拟合对象
- surv.median.line = "hv", # 添加中位生存时间线
- xlab = "Time(months)", # 指定x轴标签
- legend = c(0.8,0.75), # 指定图例位置
- legend.title = "Surgery", # 设置图例标题
- legend.labs = c("No/Unknown", "Yes"),
- title="Race:White" # 指定图例分组标签
- )
- g$plot <- g$plot + annotate("text", x = 60, y = 0.55,
- label = paste("HR:", sprintf("%.3f", hr), "\n(95% CI:", sprintf("%.3f", ci_lower), "-", sprintf("%.3f", ci_upper),")","\n",p),
- color = "Black", size = 5)
- print(g)
- ######################################################################################################################################################
- temp=data[data$Race=="Black",]
- psm_matchit <- matchit(Surgery ~ Age+Sex+Primary.Site+Histologic.Type+Household.income
- +T_stage+N_stage+Chemotherapy+Radiotherapy+Liver.metastases+Bone.metastases,
- method='nearest', distance = 'glm', ratio=1, replace=F, caliper=0.2, data=temp)
- psm_matchit_data = get_matches(psm_matchit)
- T0<- temp[psm_matchit_data$id, ]
- fit <- survfit(Surv(Months, Status) ~ Surgery, data = T0)
- sur_cox<-coxph(Surv(Months,Status) ~ Surgery, data = T0)
- sum_cox<-summary(sur_cox)
- hr <- exp(sum_cox$coefficients[, "coef"]) # 回归系数
- p_value <- sum_cox$coefficients[, "Pr(>|z|)"] # P值
- if(p_value<0.0001){
- p="P<0.0001"
- }else if(p_value<0.001){
- p="P<0.001"
- }else if(p_value<0.01){
- p="P<0.01"
- }else if(p_value<0.05){
- p="P<0.05"
- }else{
- p=paste("P=",sprintf("%.3f", p_value))
- }
- ci <- confint(sur_cox) # 95%置信区间
- ci_lower <- exp(ci[, 1]) # 置信区间下限
- ci_upper <- exp(ci[, 2])
- g<-ggsurvplot(fit, # 创建的拟合对象
- surv.median.line = "hv", # 添加中位生存时间线
- xlab = "Time(months)", # 指定x轴标签
- legend = c(0.8,0.75), # 指定图例位置
- legend.title = "Surgery", # 设置图例标题
- legend.labs = c("No/Unknown", "Yes"),
- title="Race:Black" # 指定图例分组标签
- )
- g$plot <- g$plot + annotate("text", x = 60, y = 0.55,
- label = paste("HR:", sprintf("%.3f", hr), "\n(95% CI:", sprintf("%.3f", ci_lower), "-", sprintf("%.3f", ci_upper),")","\n",p),
- color = "Black", size = 5)
- print(g)
- ######################################################################################################################################################
- temp=data[data$Race=="Others",]
- psm_matchit <- matchit(Surgery ~ Age+Sex+Primary.Site+Histologic.Type+Household.income
- +T_stage+N_stage+Chemotherapy+Radiotherapy+Liver.metastases+Bone.metastases,
- method='nearest', distance = 'glm', ratio=1, replace=F, caliper=0.2, data=temp)
- psm_matchit_data = get_matches(psm_matchit)
- T0<- temp[psm_matchit_data$id, ]
- fit <- survfit(Surv(Months, Status) ~ Surgery, data = T0)
- sur_cox<-coxph(Surv(Months,Status) ~ Surgery, data = T0)
- sum_cox<-summary(sur_cox)
- hr <- exp(sum_cox$coefficients[, "coef"]) # 回归系数
- p_value <- sum_cox$coefficients[, "Pr(>|z|)"] # P值
- if(p_value<0.0001){
- p="P<0.0001"
- }else if(p_value<0.001){
- p="P<0.001"
- }else if(p_value<0.01){
- p="P<0.01"
- }else if(p_value<0.05){
- p="P<0.05"
- }else{
- p=paste("P=",sprintf("%.3f", p_value))
- }
- ci <- confint(sur_cox) # 95%置信区间
- ci_lower <- exp(ci[, 1]) # 置信区间下限
- ci_upper <- exp(ci[, 2])
- g<-ggsurvplot(fit, # 创建的拟合对象
- surv.median.line = "hv", # 添加中位生存时间线
- xlab = "Time(months)", # 指定x轴标签
- legend = c(0.8,0.75), # 指定图例位置
- legend.title = "Surgery", # 设置图例标题
- legend.labs = c("No/Unknown", "Yes"),
- title="Race:Others" # 指定图例分组标签
- )
- g$plot <- g$plot + annotate("text", x = 60, y = 0.55,
- label = paste("HR:", sprintf("%.3f", hr), "\n(95% CI:", sprintf("%.3f", ci_lower), "-", sprintf("%.3f", ci_upper),")","\n",p),
- color = "Black", size = 5)
- print(g)
- ##年龄
- ######################################################################################################################################################
- temp=data[data$Age=="15-54",]
- psm_matchit <- matchit(Surgery ~ Race+Sex+Primary.Site+Histologic.Type+Household.income
- +T_stage+N_stage+Chemotherapy+Radiotherapy+Liver.metastases+Bone.metastases,
- method='nearest', distance = 'glm', ratio=1, replace=F, caliper=0.2, data=temp)
- psm_matchit_data = get_matches(psm_matchit)
- T0<- temp[psm_matchit_data$id, ]
- fit <- survfit(Surv(Months, Status) ~ Surgery, data = T0)
- sur_cox<-coxph(Surv(Months,Status) ~ Surgery, data = T0)
- sum_cox<-summary(sur_cox)
- hr <- exp(sum_cox$coefficients[, "coef"]) # 回归系数
- p_value <- sum_cox$coefficients[, "Pr(>|z|)"] # P值
- if(p_value<0.0001){
- p="P<0.0001"
- }else if(p_value<0.001){
- p="P<0.001"
- }else if(p_value<0.01){
- p="P<0.01"
- }else if(p_value<0.05){
- p="P<0.05"
- }else{
- p=paste("P=",sprintf("%.3f", p_value))
- }
- ci <- confint(sur_cox) # 95%置信区间
- ci_lower <- exp(ci[, 1]) # 置信区间下限
- ci_upper <- exp(ci[, 2])
- g<-ggsurvplot(fit, # 创建的拟合对象
- surv.median.line = "hv", # 添加中位生存时间线
- xlab = "Time(months)", # 指定x轴标签
- legend = c(0.8,0.75), # 指定图例位置
- legend.title = "Surgery", # 设置图例标题
- legend.labs = c("No/Unknown", "Yes"),
- title="Age:15-54" # 指定图例分组标签
- )
- g$plot <- g$plot + annotate("text", x = 60, y = 0.55,
- label = paste("HR:", sprintf("%.3f", hr), "\n(95% CI:", sprintf("%.3f", ci_lower), "-", sprintf("%.3f", ci_upper),")","\n",p),
- color = "Black", size = 5)
- print(g)
- ######################################################################################################################################################
- temp=data[data$Age=="55-64",]
- psm_matchit <- matchit(Surgery ~ Race+Sex+Primary.Site+Histologic.Type+Household.income
- +T_stage+N_stage+Chemotherapy+Radiotherapy+Liver.metastases+Bone.metastases,
- method='nearest', distance = 'glm', ratio=1, replace=F, caliper=0.2, data=temp)
- psm_matchit_data = get_matches(psm_matchit)
- T0<- temp[psm_matchit_data$id, ]
- fit <- survfit(Surv(Months, Status) ~ Surgery, data = T0)
- sur_cox<-coxph(Surv(Months,Status) ~ Surgery, data = T0)
- sum_cox<-summary(sur_cox)
- hr <- exp(sum_cox$coefficients[, "coef"]) # 回归系数
- p_value <- sum_cox$coefficients[, "Pr(>|z|)"] # P值
- if(p_value<0.0001){
- p="P<0.0001"
- }else if(p_value<0.001){
- p="P<0.001"
- }else if(p_value<0.01){
- p="P<0.01"
- }else if(p_value<0.05){
- p="P<0.05"
- }else{
- p=paste("P=",sprintf("%.3f", p_value))
- }
- ci <- confint(sur_cox) # 95%置信区间
- ci_lower <- exp(ci[, 1]) # 置信区间下限
- ci_upper <- exp(ci[, 2])
- g<-ggsurvplot(fit, # 创建的拟合对象
- surv.median.line = "hv", # 添加中位生存时间线
- xlab = "Time(months)", # 指定x轴标签
- legend = c(0.8,0.75), # 指定图例位置
- legend.title = "Surgery", # 设置图例标题
- legend.labs = c("No/Unknown", "Yes"),
- title="Age:55-64" # 指定图例分组标签
- )
- g$plot <- g$plot + annotate("text", x = 60, y = 0.55,
- label = paste("HR:", sprintf("%.3f", hr), "\n(95% CI:", sprintf("%.3f", ci_lower), "-", sprintf("%.3f", ci_upper),")","\n",p),
- color = "Black", size = 5)
- print(g)
- ######################################################################################################################################################
- temp=data[data$Age=="65-74",]
- psm_matchit <- matchit(Surgery ~ Race+Sex+Primary.Site+Histologic.Type+Household.income
- +T_stage+N_stage+Chemotherapy+Radiotherapy+Liver.metastases+Bone.metastases,
- method='nearest', distance = 'glm', ratio=1, replace=F, caliper=0.2, data=temp)
- psm_matchit_data = get_matches(psm_matchit)
- T0<- temp[psm_matchit_data$id, ]
- fit <- survfit(Surv(Months, Status) ~ Surgery, data = T0)
- sur_cox<-coxph(Surv(Months,Status) ~ Surgery, data = T0)
- sum_cox<-summary(sur_cox)
- hr <- exp(sum_cox$coefficients[, "coef"]) # 回归系数
- p_value <- sum_cox$coefficients[, "Pr(>|z|)"] # P值
- if(p_value<0.0001){
- p="P<0.0001"
- }else if(p_value<0.001){
- p="P<0.001"
- }else if(p_value<0.01){
- p="P<0.01"
- }else if(p_value<0.05){
- p="P<0.05"
- }else{
- p=paste("P=",sprintf("%.3f", p_value))
- }
- ci <- confint(sur_cox) # 95%置信区间
- ci_lower <- exp(ci[, 1]) # 置信区间下限
- ci_upper <- exp(ci[, 2])
- g<-ggsurvplot(fit, # 创建的拟合对象
- surv.median.line = "hv", # 添加中位生存时间线
- xlab = "Time(months)", # 指定x轴标签
- legend = c(0.8,0.75), # 指定图例位置
- legend.title = "Surgery", # 设置图例标题
- legend.labs = c("No/Unknown", "Yes"),
- title="Age:65-74" # 指定图例分组标签
- )
- g$plot <- g$plot + annotate("text", x = 60, y = 0.55,
- label = paste("HR:", sprintf("%.3f", hr), "\n(95% CI:", sprintf("%.3f", ci_lower), "-", sprintf("%.3f", ci_upper),")","\n",p),
- color = "Black", size = 5)
- print(g)
- ######################################################################################################################################################
- temp=data[data$Age=="75+",]
- psm_matchit <- matchit(Surgery ~ Race+Sex+Primary.Site+Histologic.Type+Household.income
- +T_stage+N_stage+Chemotherapy+Radiotherapy+Liver.metastases+Bone.metastases,
- method='nearest', distance = 'glm', ratio=1, replace=F, caliper=0.2, data=temp)
- psm_matchit_data = get_matches(psm_matchit)
- T0<- temp[psm_matchit_data$id, ]
- fit <- survfit(Surv(Months, Status) ~ Surgery, data = T0)
- sur_cox<-coxph(Surv(Months,Status) ~ Surgery, data = T0)
- sum_cox<-summary(sur_cox)
- hr <- exp(sum_cox$coefficients[, "coef"]) # 回归系数
- p_value <- sum_cox$coefficients[, "Pr(>|z|)"] # P值
- if(p_value<0.0001){
- p="P<0.0001"
- }else if(p_value<0.001){
- p="P<0.001"
- }else if(p_value<0.01){
- p="P<0.01"
- }else if(p_value<0.05){
- p="P<0.05"
- }else{
- p=paste("P=",sprintf("%.3f", p_value))
- }
- ci <- confint(sur_cox) # 95%置信区间
- ci_lower <- exp(ci[, 1]) # 置信区间下限
- ci_upper <- exp(ci[, 2])
- g<-ggsurvplot(fit, # 创建的拟合对象
- surv.median.line = "hv", # 添加中位生存时间线
- xlab = "Time(months)", # 指定x轴标签
- legend = c(0.8,0.75), # 指定图例位置
- legend.title = "Surgery", # 设置图例标题
- legend.labs = c("No/Unknown", "Yes"),
- title="Age:75+" # 指定图例分组标签
- )
- g$plot <- g$plot + annotate("text", x = 60, y = 0.55,
- label = paste("HR:", sprintf("%.3f", hr), "\n(95% CI:", sprintf("%.3f", ci_lower), "-", sprintf("%.3f", ci_upper),")","\n",p),
- color = "Black", size = 5)
- print(g)
psm&km.R at commit b02b9bd, no license · at the source
Overview
- Thoracic Surgery Department, Peking University Third Hospital, Beijing, China
- School of Management, University of Science and Technology of China, Hefei, China
- Academy of Mathematics and Systems Science, Chinese Academy of Sciences, Beijing, China
- Thoracic Surgery Department, China-Japan Friendship Institute of Clinical Medicine Research, Beijing, China
Abstract
The abstract is not reproduced here: the paper's license (CC BY-NC-ND) does not allow it. Read it in the paper, at the publisher or on Europe PMC.
Repository
Its files are read in the Code ↔ Paper reader above, with 5 matches between paragraphs and lines of code.
linastro/machine-learning-models-based-on-xgboost
b02b9bda0082f1ae3acbd6f8bc0f55ba8fe8ac2b, 29 May 2025Availability: 1 check, the latest on 27 September 2026: the link answers
- 27 September 2026: the link answers
6 files
- data_preprocessing.R, R, 227 lines
- data_processing.R, R, 107 lines, 1 match
- md_24_36.R, R, 291 lines, 1 match
- md_6_12.R, R, 287 lines, 1 match
- psm&
km.R , R, 1,367 lines, 2 matches - validation.R, R, 150 lines
Code availability statement
The paper has a code availability statement. Its license (CC BY-NC-ND) does not allow reproducing it here; in short, from what the harvester recognized in it:
- it points to the authors' code: linastro/
machine-learning-models- based-on-xgboost - it says that the code is available on request
Read it in the paper: doi.org/10.21037/jtd-2026-0997.
Tracing map
Proposed by the machine: these links were found in the paper and verified at the source, without human review. The map will receive a Zenodo DOI once one of the paper's authors has validated it with their ORCID.
What the map holds:
- 1 repository of the authors' code, each at its verified commit, with its license and how the link was found in the paper;
- 6 scripts, each with its path and the digest of its content;
- 5 matches between paragraphs of the paper and lines of the code (method lexical-v1);
- neither the text of the paper nor the code itself.
Its JSON (tracing-map.json) is deposited on Zenodo with its DOI once the map is validated.
Data
No dataset and no data link were found in the paper.
Versions
The history of this record: each version stored by the harvester or made by a correction of its authors or of the maintainers of its code, and what changed in its facts. The texts of the paper (its abstract, its availability statements) are not part of it; versions that changed only those are not listed.
Version 1, 27 September 2026: the first record
Recorded: type, language, journal, volume, issue, pages, dates, 5 authors, 5 keywords, 1 funder, 44 references.
Cite
This paper
Lin, C., Gong, Z., Zhang, X., Chen, F., & Qiang, G. (2026). Machine learning models based on XGBoost algorithm to predict prognosis of lung cancer brain metastases. Journal of thoracic disease, 18(7), 767. https://
BibTeX
@article{lin2026machine,
author = {Lin, Chutong and Gong, Zhijie and Zhang, Xinyu and Chen, Fangjun and Qiang, Guangliang},
title = {{Machine learning models based on XGBoost algorithm to predict prognosis of lung cancer brain metastases}},
journal = {Journal of thoracic disease},
year = {2026},
month = jun,
volume = {18},
number = {7},
pages = {767},
publisher = {AME Publications},
issn = {2072-1439},
doi = {10.21037/
url = {https://
pmid = {42583236},
pmcid = {PMC13460187}
}
RIS
TY - JOUR
AU - Lin, Chutong
AU - Gong, Zhijie
AU - Zhang, Xinyu
AU - Chen, Fangjun
AU - Qiang, Guangliang
TI - Machine learning models based on XGBoost algorithm to predict prognosis of lung cancer brain metastases
T2 - Journal of thoracic disease
J2 - J Thorac Dis
PY - 2026
DA - 2026/
VL - 18
IS - 7
SP - 767
SN - 2072-1439
PB - AME Publications
DO - 10.21037/
UR - https://
LA - en
ER -
CSL-JSON
{
"id": "10.21037/
"type": "article-journal",
"title": "Machine learning models based on XGBoost algorithm to predict prognosis of lung cancer brain metastases",
"container-title": "Journal of thoracic disease",
"author": [
{
"family": "Lin",
"given": "Chutong"
},
{
"family": "Gong",
"given": "Zhijie"
},
{
"family": "Zhang",
"given": "Xinyu"
},
{
"family": "Chen",
"given": "Fangjun"
},
{
"family": "Qiang",
"given": "Guangliang"
}
],
"container-title-short":
"volume": "18",
"issue": "7",
"page": "767",
"DOI": "10.21037/
"PMID": "42583236",
"PMCID": "PMC13460187",
"ISSN": "2072-1439",
"publisher": "AME Publications",
"URL": "https://
"language": "en",
"issued": {
"date-parts": [
[
2026,
6,
10
]
]
}
}
The tracing map gets a citation of its own once an author has validated it and it has a DOI.
Similar papers
The papers with a page that share the most with this one: the tools found in their code, their categories, datasets, cited references and authors, the rarest counting most.
- [1] doi:10.3390/ijms27156925 [code]
- XGBoost-SHAP Interpretable Modeling Identifies and Validates an Eight-Gene Biomarker for Hepatic Encephalopathy Risk Prediction in Cirrhosis.Journal: International journal of molecular sciencesIn common: randomForest, pROC, survival, 4 other tools, other condition
- [2] doi:10.1038/s41467-026-77170-3 [code]
- DNA methylation profiling identifies long-range epigenetic silencing of clustered protocadherins as a key determinant of meningioma progression.Journal: Nature communicationsIn common: randomForest, pROC, survival, 3 other tools, other condition
- [3] doi:10.1038/s42003-026-10957-8 [code]
- Brain defence by the extracellular matrix protein Cochlin.Journal: Communications biologyIn common: randomForest, survival, caret, 3 other tools
- [4] doi:10.3390/ijms27125533 [code]
- Discovery-Driven Plasma Proteomics Identifies a Multi-Protein Signature for Amyloid PET Positivity: A Machine Learning Analysis of the Bio-Hermes Cohort.Journal: International journal of molecular sciencesIn common: randomForest, pROC, caret, 2 other tools
- [5] doi:10.1093/neuonc/noag128 [code]
- Spatially-resolved single-cell imaging of melanoma brain metastases identifies localized immune patterns predictive of immune checkpoint blockade response.Journal: Neuro-oncologyIn common: pROC, survival, caret, 2 other tools, clinical / translational, other condition
- [6] doi:10.1371/journal.pmed.1004868 [code]
- Plasma proteomic signatures of early retinal neurodegeneration in diabetes: A multi-cohort study.Journal: PLoS medicineIn common: pROC, survival, caret, 2 other tools, clinical / translational, other condition
- [7] doi:10.1093/bioinformatics/btag592 [code]
- Network-based stratification of allele-specific expression reveals patient subgroups in Huntington's disease.Journal: Bioinformatics (Oxford, England)In common: randomForest, pROC, survival, 2 other tools, other condition
- [8] doi:10.1177/13872877261471049 [code]
- Predicting future brain atrophy based on longitudinal MRI.Journal: Journal of Alzheimer's disease : JADIn common: randomForest, pROC, caret, 2 other tools, clinical / translational
- [9] doi:10.1073/pnas.2516601123 [code]
- Unveiling the glymphatic system's role in brain aging: A comprehensive biomarker and modifiable intervention target.Journal: Proceedings of the National Academy of Sciences of the United States of AmericaIn common: pROC, survival, XGBoost, 2 other tools, clinical / translational
- [10] doi:10.7717/peerj.21426 [code]
- Integrated transcriptomic identification and validation reveal key autophagy-associated biomarkers in sleep deprivation.Journal: PeerJIn common: randomForest, pROC, caret, 2 other tools
Contribute
The authors of this paper can claim it, correct its record and validate its tracing map, and the maintainers of its code (its owner, or a public member of its organization) correct what it says of their repository; anyone signed in can ask for its removal. Every request goes to OSCR's own machine, which answers it; your account page follows them.
Sign in with ORCID to claim this paper as one of its authors, correct its record or validate its tracing map: when the paper's metadata lists your ORCID iD, you are recognized at once. Maintainers of its code: sign in with GitHub, then claim the repository on your account page.
Claim this paper
Correct its record
Say what each link of this record is, remove the ones that are not the paper's, add the ones that are missing. The correction becomes a new version of the record, in its Versions section.
Validate its tracing map
You validate the map as this page shows it: 1 repository of the authors' code, each at its verified commit and with its license, 6 scripts, and 5 matches between paragraphs and code (see the Code and Map sections). It then receives a DOI on Zenodo, with you (your ORCID iD) and OSCR as its creators; the code itself is not deposited.
The map's fingerprint: sha256:f3c264a49d1461c4…
Add the badge to its README
The badge links the code to this page. Copy one of these into the README of the paper's code: only you decide where it goes, and nothing is changed for you.
Markdown
[, paste the snippet at the top, then “Commit changes…” and, to review it first, “Create a new branch and start a pull request”. You open the pull request; OSCR asks for no permission.
Request its removal
To ask OSCR to remove this record, the copies of its authors' scripts or its tracing map, use the removal request page: signed in, you say who you are, what to remove and why, then review and confirm the request. Published rules decide every request (how).
Discussion, reproductions, activity
Discussion: questions and error reports about this paper and its code, from signed-in readers and its authors. It opens with sign-in.
Reproductions: reports from readers who ran the authors' code: what they reproduced, with which environment, commit and data. It opens with sign-in.
Activity: what happens around this paper: new versions of its record, its map's validation, discussions and reproductions. It opens with sign-in.
