代码拉取完成,页面将自动刷新
# This code is used to plot
if(!require(tidyverse))require(tidyverse)
if(!require(readxl))require(readxl)
if(!require(xlsx))require(xlsx)
if(!require(writexl))require(writexl)
if(require(metafor))require(metafor)
if(!require(lubridate))require(lubridate)
if(!require(meta))library(meta)
if(!require(gridExtra))library(gridExtra)
if(!require(gridGraphics))library(gridGraphics)
if(!require(patchwork))library(patchwork)
setwd('')
###############################################
# Survival combination ######
###############################################
# Load the data
rm(list = ls())
ref = read_excel("./Add_new_column.xlsx", sheet = 1) %>%
select(-1)
# SCT
ref_HR <- ref %>%
fill(`T.Group.N (F/M)`, `C.Group.N (F/M)`, .direction = "down") %>%
mutate(n.T = str_split(`T.Group.N (F/M)`, '/') |>
map(as.numeric) |>
map_dbl(~sum(.x))) %>%
mutate(n.C = str_split(`C.Group.N (F/M)`, '/') |>
map(as.numeric) |>
map_dbl(~sum(.x))) %>%
filter(!is.na(logHR)) %>%
select(PMID, Author, Year, n.T, n.C, Follow.up, Dead.T:SE, Treatment, Control) %>%
mutate(Time = ifelse(str_detect(Follow.up, '(12 months)|(360 days)'), "48 weeks",
ifelse(str_detect(Follow.up, '180 days'), "24 weeks",
ifelse(str_detect(Follow.up, '24 months'), "96 weeks",
ifelse(str_detect(Follow.up, '3 months'), "12 weeks",
ifelse(str_detect(Follow.up, '(30 days)|(1 month)'), "4 weeks",
ifelse(str_detect(Follow.up, '6 months'), "24 weeks",
ifelse(str_detect(Follow.up, '(60 days)'), "8 weeks",
ifelse(str_detect(Follow.up, '90 days'), "12 weeks",
ifelse(str_detect(Follow.up, "2-4weeks"), "4 weeks",
Follow.up)
))))))))) %>%
mutate(Time = as.duration(Time) |> as.numeric('weeks')) %>%
arrange(Time) %>%
mutate(Duration = ifelse(Time <= 12, "short-term",
ifelse(Time >12 & Time <= 24, "medium-term",
"long-term"))) %>%
mutate(Time = paste0(Time, " weeks")) %>%
mutate(Time = ifelse(Time == "4 weeks", paste0("<","4 weeks"), Time)) %>%
mutate(Study_id = paste0(Author," (", Year, ")")) %>%
filter(Treatment == "CT" & Control == "SMT")
meta_HR1 <- metagen(logHR, SE, sm="HR", data = ref_HR, subgroup = Time, studlab = Study_id)
forest(meta_HR1, digits=3,test.effect.subgroup = TRUE,test.overall = TRUE,family="sans",fontsize=9.5,lwd=2,col.diamond.fixed="lightslategray",col.diamond.lines.fixed="lightslategray",
col.diamond.random="maroon",col.diamond.lines.random="maroon",col.square="skyblue",col.study="lightslategray",
lty.fixed=4,plotwidth="8cm",colgap.forest.left="1cm",colgap.forest.right="1cm",just.forest="right",colgap.left="0.5cm",
colgap.right="0.5cm", layout = "RevMan5")
p1 = grid.grab()
# SCT + PE
ref_HR <- ref %>%
fill(`T.Group.N (F/M)`, `C.Group.N (F/M)`, .direction = "down") %>%
mutate(n.T = str_split(`T.Group.N (F/M)`, '/') |>
map(as.numeric) |>
map_dbl(~sum(.x))) %>%
mutate(n.C = str_split(`C.Group.N (F/M)`, '/') |>
map(as.numeric) |>
map_dbl(~sum(.x))) %>%
filter(!is.na(logHR)) %>%
select(PMID, Author, Year, n.T, n.C, Follow.up, Dead.T:SE, Treatment, Control) %>%
mutate(Time = ifelse(str_detect(Follow.up, '(12 months)|(360 days)'), "48 weeks",
ifelse(str_detect(Follow.up, '(180 days)'), "24 weeks",
ifelse(str_detect(Follow.up, '(24 months)'), "96 weeks",
ifelse(str_detect(Follow.up, '(3 months)'), "12 weeks",
ifelse(str_detect(Follow.up, '(30 days)|(1 month)'), "4 weeks",
ifelse(str_detect(Follow.up, '(6 months)'), "24 weeks",
ifelse(str_detect(Follow.up, '(60 days)'), "8 weeks",
ifelse(str_detect(Follow.up, '(90 days)'), "12 weeks",
ifelse(str_detect(Follow.up, "2-4weeks"), "4 weeks",
Follow.up)
))))))))) %>%
mutate(Time = as.duration(Time) |> as.numeric('weeks')) %>%
arrange(Time) %>%
mutate(Duration = ifelse(Time <= 12, "short-term",
ifelse(Time >12 & Time <= 24, "medium-term",
"long-term"))) %>%
mutate(Time = paste0(Time, " weeks")) %>%
mutate(Time = ifelse(Time == "4 weeks", paste0("<","4 weeks"), Time)) %>%
mutate(Study_id = paste0(Author," (", Year, ")")) %>%
filter(Treatment == "CT+PE" & Control == "PE")
meta_HR2 <- metagen(logHR, SE, sm="HR", data = ref_HR, subgroup = Time, studlab = Study_id)
forest(meta_HR2, digits=3,test.effect.subgroup = TRUE,test.overall = TRUE,family="sans",fontsize=9.5,lwd=2,col.diamond.fixed="lightslategray",col.diamond.lines.fixed="lightslategray",
col.diamond.random="maroon",col.diamond.lines.random="maroon",col.square="skyblue",col.study="lightslategray",
lty.fixed=4,plotwidth="8cm",colgap.forest.left="1cm",colgap.forest.right="1cm",just.forest="right",colgap.left="0.5cm",
colgap.right="0.5cm", layout = "RevMan5")
p2 = grid.grab()
# Cell Source
ref_HR <- ref %>%
fill(`T.Group.N (F/M)`, `C.Group.N (F/M)`, .direction = "down") %>%
mutate(n.T = str_split(`T.Group.N (F/M)`, '/') |>
map(as.numeric) |>
map_dbl(~sum(.x))) %>%
mutate(n.C = str_split(`C.Group.N (F/M)`, '/') |>
map(as.numeric) |>
map_dbl(~sum(.x))) %>%
filter(!is.na(logHR)) %>%
select(PMID, Author, Year, n.T, n.C, Follow.up, Dead.T:SE, Treatment, Control, Source, Injection_rout2, Injection_times) %>%
mutate(Time = ifelse(str_detect(Follow.up, '(12 months)|(360 days)'), "48 weeks",
ifelse(str_detect(Follow.up, '(180 days)'), "24 weeks",
ifelse(str_detect(Follow.up, '(24 months)'), "96 weeks",
ifelse(str_detect(Follow.up, '(3 months)'), "12 weeks",
ifelse(str_detect(Follow.up, '(30 days)|(1 month)'), "4 weeks",
ifelse(str_detect(Follow.up, '(6 months)'), "24 weeks",
ifelse(str_detect(Follow.up, '(60 days)'), "8 weeks",
ifelse(str_detect(Follow.up, '(90 days)'), "12 weeks",
ifelse(str_detect(Follow.up, "2-4weeks"), "4 weeks",
Follow.up)
))))))))) %>%
mutate(Time = as.duration(Time) |> as.numeric('weeks')) %>%
arrange(Time) %>%
mutate(Duration = ifelse(Time <= 12, "short-term",
ifelse(Time >12 & Time <= 24, "medium-term",
"long-term"))) %>%
mutate(Time = paste0(Time, " weeks")) %>%
mutate(Time = ifelse(Time == "4 weeks", paste0("=<","4 weeks"), Time)) %>%
mutate(Study_id = paste0(Author," (", Year, ")"," ", Time, " ", Treatment, " vs. ", Control))
meta_HR3 <- metagen(logHR, SE, sm="HR", data = ref_HR, subgroup = Source, studlab = Study_id)
forest(meta_HR3, digits=3,test.effect.subgroup = TRUE,test.overall = TRUE,family="sans",fontsize=9.5,lwd=2,col.diamond.fixed="lightslategray",col.diamond.lines.fixed="lightslategray",
col.diamond.random="maroon",col.diamond.lines.random="maroon",col.square="skyblue",col.study="lightslategray",
lty.fixed=4,plotwidth="8cm",colgap.forest.left="1cm",colgap.forest.right="1cm",just.forest="right",colgap.left="0.5cm",
colgap.right="0.5cm", layout = "RevMan5")
p3 = grid.grab()
# Route and injection
ref_HR <- ref %>%
fill(`T.Group.N (F/M)`, `C.Group.N (F/M)`, .direction = "down") %>%
mutate(n.T = str_split(`T.Group.N (F/M)`, '/') |>
map(as.numeric) |>
map_dbl(~sum(.x))) %>%
mutate(n.C = str_split(`C.Group.N (F/M)`, '/') |>
map(as.numeric) |>
map_dbl(~sum(.x))) %>%
filter(!is.na(logHR)) %>%
select(PMID, Author, Year, n.T, n.C, Follow.up, Dead.T:SE, Treatment, Control, Source, Injection_rout2, Injection_times) %>%
mutate(Time = ifelse(str_detect(Follow.up, '(12 months)|(360 days)'), "48 weeks",
ifelse(str_detect(Follow.up, '180 days'), "24 weeks",
ifelse(str_detect(Follow.up, '24 months'), "96 weeks",
ifelse(str_detect(Follow.up, '3 months'), "12 weeks",
ifelse(str_detect(Follow.up, '(30 days)|(1 month)'), "4 weeks",
ifelse(str_detect(Follow.up, '6 months'), "24 weeks",
ifelse(str_detect(Follow.up, '(60 days)'), "8 weeks",
ifelse(str_detect(Follow.up, '90 days'), "12 weeks",
ifelse(str_detect(Follow.up, "2-4weeks"), "4 weeks",
Follow.up)
))))))))) %>%
mutate(Time = as.duration(Time) |> as.numeric('weeks')) %>%
arrange(Time) %>%
mutate(Duration = ifelse(Time <= 12, "short-term",
ifelse(Time >12 & Time <= 24, "medium-term",
"long-term"))) %>%
mutate(Time = paste0(Time, " weeks")) %>%
mutate(Time = ifelse(Time == "4 weeks", paste0("=<","4 weeks"), Time)) %>%
mutate(Study_id = paste0(Author," (", Year, ")"))
ref_HR = ref_HR %>%
mutate(Injection_rout2 = ifelse(Injection_rout2 == "Deep", "Deep+Single", "Peripheral+Multiple")) %>%
rename("Route+Injection" = Injection_rout2) %>%
mutate(Study_id = paste0(Study_id," ", Time)) %>%
mutate(Study_id = paste0(Study_id, " ", Treatment, " vs. ", Control))
meta_HR4 <- metagen(logHR, SE, sm="HR", data = ref_HR, subgroup = `Route+Injection`, studlab = Study_id)
forest(meta_HR4, digits=3,test.effect.subgroup = TRUE,test.overall = TRUE,family="sans",fontsize=9.5,lwd=2,col.diamond.fixed="lightslategray",col.diamond.lines.fixed="lightslategray",
col.diamond.random="maroon",col.diamond.lines.random="maroon",col.square="skyblue",col.study="lightslategray",
lty.fixed=4,plotwidth="8cm",colgap.forest.left="1cm",colgap.forest.right="1cm",just.forest="right",colgap.left="0.5cm",
colgap.right="0.5cm", layout = "RevMan5")
p4 = grid.grab()
## Integration
## HR forest combination
grid.newpage()
grid.arrange(p1, p2, p3, p4, ncol = 2)
rstudioapi::savePlotAsImage("./Survival_FR_231112.svg",width=2177,height=1420, format = "svg")
## Supplementary combination
####> Funnel plot
####> I dont know why funnel plot can not be grabbed.
####> So I have to use par method to combine plots.
par(mfrow=c(1,2), cex= 1)
meta::funnel(meta_HR1)
title(main = "SCT vs. SMT")
meta::funnel(meta_HR2)
title(main = "SCT+PE vs. PE")
# meta::funnel(meta_HR3)
# title(main = "Autologous vs. Allogeneic")
# meta::funnel(meta_HR4)
# title(main = "Deep+Single vs. Periphera+Multiple")
rstudioapi::savePlotAsImage("./Survival_FU_231113.svg",
width=960,height=500, format = "svg")
## Sensitivity analysis
meta::forest(metainf(meta_HR1, pooled = "random"))
p1 = grid.grab()
meta::forest(metainf(meta_HR2, pooled = "random"))
p2 = grid.grab()
# meta::forest(metainf(meta_HR3, pooled = "random"))
# p3 = grid.grab()
# meta::forest(metainf(meta_HR4, pooled = "random"))
# p4 = grid.grab()
grid.newpage()
grid.arrange(p1, p2, ncol = 1)
rstudioapi::savePlotAsImage("./Survival_SE_231113.svg",
width=960,height=800, format = "svg")
###############################################
# MELD combination ######
###############################################
# Load the data
rm(list = ls())
ref = read_excel("./Add_new_column.xlsx", sheet = 1) %>%
select(-1)
pre_data <- function(i){
dt <- ref %>%
fill(`T.Group.N (F/M)`, `C.Group.N (F/M)`, .direction = "down") %>%
mutate(n.T = str_split(`T.Group.N (F/M)`, '/') |>
map(as.numeric) |>
map_dbl(~sum(.x))) %>%
mutate(n.C = str_split(`C.Group.N (F/M)`, '/') |>
map(as.numeric) |>
map_dbl(~sum(.x))) %>%
filter(!is.na(.[,paste0(i, ".T.SD")])) %>%
select(PMID, Author, Year, n.T, n.C, Follow.up, paste0(i,".T.M"):paste0(i,".C.SD"), Treatment, Control) %>%
mutate(Follow.up = str_trim(Follow.up, side = "both")) %>%
mutate(Time = ifelse(str_detect(Follow.up, '(12 months)|(360 days)'), "48 weeks",
ifelse(str_detect(Follow.up, '(180 days)'), "24 weeks",
ifelse(str_detect(Follow.up, '(24 months)'), "96 weeks",
ifelse(str_detect(Follow.up, '(3 months)'), "12 weeks",
ifelse(str_detect(Follow.up, '(30 days)|(1 month)'), "4 weeks",
ifelse(str_detect(Follow.up, '(6 months)'), "24 weeks",
ifelse(str_detect(Follow.up, '(60 days)'), "8 weeks",
ifelse(str_detect(Follow.up, '(90 days)'), "12 weeks",
ifelse(str_detect(Follow.up, "(2-4weeks)"), "4 weeks",
Follow.up)
))))))))) %>%
mutate(Time = as.duration(Time) |> as.numeric('weeks')) %>%
arrange(Time) %>%
mutate(Duration = ifelse(Time <= 12, "short-term",
ifelse(Time >12 & Time <= 24, "medium-term",
"long-term"))) %>%
mutate(Time = paste0(Time, " weeks")) %>%
mutate(Time = ifelse(Time == "4 weeks", paste0("<","4 weeks"), Time)) %>%
mutate(Study_id = paste0(Author," (", Year, ")")) %>%
filter(Treatment == "CT" & Control == "SMT")
return(dt)
}
## SCT vs. SMT
i = 'MELD'
ref_MELD <- pre_data(i)
ref_MELD %>% mutate(Total = n.T + n.C) %>%
distinct(PMID,.keep_all = T) %>%
summarise(sum(Total))
meta_MELD1 <- metacont(n.T, MELD.T.M, MELD.T.SD, n.C, MELD.C.M, MELD.C.SD, data = ref_MELD,
sm="SMD", subgroup = Time, studlab = Study_id)
meta_MELD1a <- escalc(measure = "SMD", n1i = n.T, m1i = MELD.T.M, sd1i = MELD.T.SD, n2i = n.C, m2i = MELD.C.M,
sd2i = MELD.C.SD, data = ref_MELD, slab = Study_id) # Calculate effect size and variance
forest(meta_MELD1, digits=3,test.effect.subgroup = TRUE,test.overall = TRUE,family="sans",fontsize=9.5,lwd=2,col.diamond.fixed="lightslategray",col.diamond.lines.fixed="lightslategray",
col.diamond.random="maroon",col.diamond.lines.random="maroon",col.square="skyblue",col.study="lightslategray",
lty.fixed=4,plotwidth="8cm",colgap.forest.left="1cm",colgap.forest.right="1cm",just.forest="right",colgap.left="0.5cm",
colgap.right="0.5cm", layout = "RevMan5")
p1 = grid.grab()
rstudioapi::savePlotAsImage("./MELD_SCT_231113.svg",
width=1273,height=960, format = "svg")
### CT+PE vs others
pre_data2 <- function(i){
dt <- ref %>%
fill(`T.Group.N (F/M)`, `C.Group.N (F/M)`, .direction = "down") %>%
mutate(n.T = str_split(`T.Group.N (F/M)`, '/') |>
map(as.numeric) |>
map_dbl(~sum(.x))) %>%
mutate(n.C = str_split(`C.Group.N (F/M)`, '/') |>
map(as.numeric) |>
map_dbl(~sum(.x))) %>%
filter(!is.na(.[,paste0(i, ".T.SD")])) %>%
select(PMID, Author, Year, n.T, n.C, Follow.up, paste0(i,".T.M"):paste0(i,".C.SD"), Treatment, Control) %>%
mutate(Time = ifelse(str_detect(Follow.up, '(12 months)|(360 days)'), "48 weeks",
ifelse(str_detect(Follow.up, '(180 days)'), "24 weeks",
ifelse(str_detect(Follow.up, '24 months'), "96 weeks",
ifelse(str_detect(Follow.up, '3 months'), "12 weeks",
ifelse(str_detect(Follow.up, '(30 days)|(1 month)'), "4 weeks",
ifelse(str_detect(Follow.up, '6 months'), "24 weeks",
ifelse(str_detect(Follow.up, '60 days'), "8 weeks",
ifelse(str_detect(Follow.up, '90 days'), "12 weeks",
ifelse(str_detect(Follow.up, "2-4weeks"), "4 weeks",
Follow.up)
))))))))) %>%
mutate(Time = as.duration(Time) |> as.numeric('weeks')) %>%
arrange(Time) %>%
mutate(Duration = ifelse(Time <= 12, "short-term",
ifelse(Time >12 & Time <= 24, "medium-term",
"long-term"))) %>%
mutate(Time = paste0(Time, " weeks")) %>%
mutate(Time = ifelse(Time == "4 weeks", paste0("<","4 weeks"), Time)) %>%
mutate(Study_id = paste0(Author," (", Year, ")")) %>%
filter(Treatment == "CT+PE" & Control == "PE")
return(dt)
}
i = 'MELD'
ref_MELD <- pre_data2(i)
ref_MELD %>% mutate(Total = n.T + n.C) %>%
distinct(PMID,.keep_all = T) %>%
summarise(sum(Total))
meta_MELD2 <- metacont(n.T, MELD.T.M, MELD.T.SD, n.C, MELD.C.M, MELD.C.SD, data = ref_MELD,
sm="SMD", subgroup = Time, studlab = Study_id)
meta_MELD2a <- escalc(measure = "SMD", n1i = n.T, m1i = MELD.T.M, sd1i = MELD.T.SD, n2i = n.C, m2i = MELD.C.M,
sd2i = MELD.C.SD, data = ref_MELD, slab = Study_id) # Calculate effect size and variance
forest(meta_MELD2, digits=3,test.effect.subgroup = TRUE,test.overall = TRUE,family="sans",fontsize=9.5,lwd=2,col.diamond.fixed="lightslategray",col.diamond.lines.fixed="lightslategray",
col.diamond.random="maroon",col.diamond.lines.random="maroon",col.square="skyblue",col.study="lightslategray",
lty.fixed=4,plotwidth="8cm",colgap.forest.left="1cm",colgap.forest.right="1cm",just.forest="right",colgap.left="0.5cm",
colgap.right="0.5cm", layout = "RevMan5")
p2 = grid.grab()
rstudioapi::savePlotAsImage("./MELD_SCTPE_231113.svg",
width=1273,height=960, format = "svg")
#######################################################
##### deep vs. peripheral | auto vs. allo ###########
#######################################################
pre_data3 <- function(i){
dt <- ref %>%
fill(`T.Group.N (F/M)`, `C.Group.N (F/M)`, .direction = "down") %>%
mutate(n.T = str_split(`T.Group.N (F/M)`, '/') |>
map(as.numeric) |>
map_dbl(~sum(.x))) %>%
mutate(n.C = str_split(`C.Group.N (F/M)`, '/') |>
map(as.numeric) |>
map_dbl(~sum(.x))) %>%
filter(!is.na(.[,paste0(i, ".T.SD")])) %>%
select(PMID, Author, Year, n.T, n.C, Follow.up, paste0(i,".T.M"):paste0(i,".C.SD"), Treatment, Control, Source, Injection_rout2, Injection_times) %>%
mutate(Follow.up = str_trim(Follow.up, side = "both")) %>%
mutate(Time = ifelse(str_detect(Follow.up, '(12 months)|(360 days)'), "48 weeks",
ifelse(str_detect(Follow.up, '180 days'), "24 weeks",
ifelse(str_detect(Follow.up, '24 months'), "96 weeks",
ifelse(str_detect(Follow.up, '3 months'), "12 weeks",
ifelse(str_detect(Follow.up, '(30 days)|(1 month)'), "4 weeks",
ifelse(str_detect(Follow.up, '6 months'), "24 weeks",
ifelse(str_detect(Follow.up, '60 days'), "8 weeks",
ifelse(str_detect(Follow.up, '90 days'), "12 weeks",
ifelse(str_detect(Follow.up, "2-4weeks"), "4 weeks",
Follow.up)
))))))))) %>%
mutate(Time = as.duration(Time) |> as.numeric('weeks')) %>%
arrange(Time) %>%
mutate(Duration = ifelse(Time <= 12, "short-term",
ifelse(Time >12 & Time <= 24, "medium-term",
"long-term"))) %>%
mutate(Time = paste0(Time, " weeks")) %>%
mutate(Time = ifelse(Time == "4 weeks", paste0("=< ","4 weeks"), Time)) %>%
mutate(Study_id = paste0(Author," (", Year, ")"," ", Time, " ", Treatment, " vs. ", Control))
return(dt)
}
## Source
i = 'MELD'
ref_MELD <- pre_data3(i)
ref_MELD %>% mutate(Total = n.T + n.C) %>%
distinct(PMID, .keep_all = T) %>%
summarise(sum(Total))
meta_MELD3 <- metacont(n.T, MELD.T.M, MELD.T.SD, n.C, MELD.C.M, MELD.C.SD, data = ref_MELD,
sm="SMD", subgroup = Source, studlab = Study_id)
meta_MELD3a <- escalc(measure = "SMD", n1i = n.T, m1i = MELD.T.M, sd1i = MELD.T.SD, n2i = n.C, m2i = MELD.C.M,
sd2i = MELD.C.SD, data = ref_MELD, slab = Study_id) # Calculate effect size and variance
forest(meta_MELD3, digits=3,test.effect.subgroup = TRUE,test.overall = TRUE,family="sans",fontsize=9.5,lwd=2,col.diamond.fixed="lightslategray",col.diamond.lines.fixed="lightslategray",
col.diamond.random="maroon",col.diamond.lines.random="maroon",col.square="skyblue",col.study="lightslategray",
lty.fixed=4,plotwidth="8cm",colgap.forest.left="1cm",colgap.forest.right="1cm",just.forest="right",colgap.left="0.5cm",
colgap.right="0.5cm", layout = "RevMan5")
# p3 = grid.grab()
rstudioapi::savePlotAsImage("./MELD_SOURCE_231113.svg",
width=1382,height=1010, format = "svg")
## Injection route and times
i = 'MELD'
ref_MELD <- pre_data3(i)
ref_MELD %>% mutate(Total = n.T + n.C) %>%
distinct(PMID, .keep_all = T) %>%
summarise(sum(Total))
ref_MELD = ref_MELD %>%
mutate(Injection_rout2 = ifelse(Injection_rout2 == "Deep", "Deep+Single", "Peripheral+Multiple")) %>%
rename("Route+Injection" = Injection_rout2)
## rma convergence issue
##> https://www.metafor-project.org/doku.php/tips:convergence_problems_rma
##>
meta_MELD4 <- metacont(n.T, MELD.T.M, MELD.T.SD, n.C, MELD.C.M, MELD.C.SD, data = ref_MELD,
sm="SMD", subgroup = `Route+Injection`, studlab = Study_id,
control=list(stepadj=0.5))
meta_MELD4a <- escalc(measure = "SMD", n1i = n.T, m1i = MELD.T.M, sd1i = MELD.T.SD, n2i = n.C, m2i = MELD.C.M,
sd2i = MELD.C.SD, data = ref_MELD, slab = Study_id) # Calculate effect size and variance
forest(meta_MELD4, digits=3,test.effect.subgroup = TRUE,test.overall = TRUE,family="sans",fontsize=9.5,lwd=2,col.diamond.fixed="lightslategray",col.diamond.lines.fixed="lightslategray",
col.diamond.random="maroon",col.diamond.lines.random="maroon",col.square="skyblue",col.study="lightslategray",
lty.fixed=4,plotwidth="8cm",colgap.forest.left="1cm",colgap.forest.right="1cm",just.forest="right",colgap.left="0.5cm",
colgap.right="0.5cm", layout = "RevMan5")
# p4 = grid.grab()
rstudioapi::savePlotAsImage("./MELD_ROUTE_231113.svg",
width=1382,height=1010, format = "svg")
## Adjustment for publication bias
par(mfrow = c(2, 2), # 2 x 4 pictures on one plot
cex = 1) # square plotting region
meta::funnel(meta_MELD1)
title(main = "SCT vs. SMT", sub = "Funnel plot")
res <- rma(yi, vi, data=meta_MELD1a) # Perform meta-analysis
res
metafor::trimfill(res)
metafor::trimfill(res) %>% meta::funnel()
title(sub = "Adjusted funnel plot")
#########################################
meta::funnel(meta_MELD2)
title(main = "SCT+PE vs. PE", sub = "Funnel plot")
res <- rma(yi, vi, data=meta_MELD2a) # Perform meta-analysis
res
metafor::trimfill(res)
metafor::trimfill(res) %>% meta::funnel()
title(sub = "Adjusted funnel plot")
################################################
# meta::funnel(meta_MELD3)
# title(main = "Autologous vs. Allogeneic", sub = "Funnel plot")
# res <- rma(yi, vi, data=meta_MELD3a) # Perform meta-analysis
# res
# metafor::trimfill(res)
# metafor::trimfill(res) %>% meta::funnel()
# title(sub = "Adjusted funnel plot")
# ######################################################
# meta::funnel(meta_MELD4)
# title(main = "Deep+Single vs. Periphera+Multiple", sub = "Funnel plot")
# res <- rma(yi, vi, data=meta_MELD4a) # Perform meta-analysis
# res
# metafor::trimfill(res)
# metafor::trimfill(res) %>% meta::funnel()
# title(sub = "Adjusted funnel plot")
rstudioapi::savePlotAsImage("./MELD_FU_adj.svg", format = "svg",
width=960,height=960)
dev.off()
###############################################
# ALT combination ######
###############################################
# Load the data
rm(list = ls())
ref = read_excel("./Add_new_column.xlsx", sheet = 1) %>%
select(-1)
pre_data <- function(i){
dt <- ref %>%
fill(`T.Group.N (F/M)`, `C.Group.N (F/M)`, .direction = "down") %>%
mutate(n.T = str_split(`T.Group.N (F/M)`, '/') |>
map(as.numeric) |>
map_dbl(~sum(.x))) %>%
mutate(n.C = str_split(`C.Group.N (F/M)`, '/') |>
map(as.numeric) |>
map_dbl(~sum(.x))) %>%
filter(!is.na(.[,paste0(i, ".T.SD")])) %>%
select(PMID, Author, Year, n.T, n.C, Follow.up, paste0(i,".T.M"):paste0(i,".C.SD"), Treatment, Control) %>%
mutate(Follow.up = str_trim(Follow.up, side = "both")) %>%
mutate(Time = ifelse(str_detect(Follow.up, '(12 months)|(360 days)'), "48 weeks",
ifelse(str_detect(Follow.up, '(180 days)'), "24 weeks",
ifelse(str_detect(Follow.up, '(24 months)'), "96 weeks",
ifelse(str_detect(Follow.up, '(3 months)'), "12 weeks",
ifelse(str_detect(Follow.up, '(30 days)|(1 month)'), "4 weeks",
ifelse(str_detect(Follow.up, '(6 months)'), "24 weeks",
ifelse(str_detect(Follow.up, '(60 days)'), "8 weeks",
ifelse(str_detect(Follow.up, '(90 days)'), "12 weeks",
ifelse(str_detect(Follow.up, "(2-4weeks)"), "4 weeks",
Follow.up)
))))))))) %>%
mutate(Time = as.duration(Time) |> as.numeric('weeks')) %>%
arrange(Time) %>%
mutate(Duration = ifelse(Time <= 12, "short-term",
ifelse(Time >12 & Time <= 24, "medium-term",
"long-term"))) %>%
mutate(Time = paste0(Time, " weeks")) %>%
mutate(Time = ifelse(Time == "4 weeks", paste0("<","4 weeks"), Time)) %>%
mutate(Study_id = paste0(Author," (", Year, ")")) %>%
filter(Treatment == "CT" & Control == "SMT")
return(dt)
}
## SCT vs. SMT
i = 'ALT'
ref_ALT <- pre_data(i)
ref_ALT %>% mutate(Total = n.T + n.C) %>%
distinct(PMID, .keep_all = T) %>%
summarise(sum(Total))
meta_ALT1 <- metacont(n.T, ALT.T.M, ALT.T.SD, n.C, ALT.C.M, ALT.C.SD, data = ref_ALT,
sm="SMD", subgroup = Time, studlab = Study_id) ## Standardized mean difference (SMD)
forest(meta_ALT1, digits=3,test.effect.subgroup = TRUE,test.overall = TRUE,family="sans",fontsize=9.5,lwd=2,col.diamond.fixed="lightslategray",col.diamond.lines.fixed="lightslategray",
col.diamond.random="maroon",col.diamond.lines.random="maroon",col.square="skyblue",col.study="lightslategray",
lty.fixed=4,plotwidth="8cm",colgap.forest.left="1cm",colgap.forest.right="1cm",just.forest="right",colgap.left="0.5cm",
colgap.right="0.5cm", layout = "RevMan5")
p1 = grid.grab()
rstudioapi::savePlotAsImage("./ALT_SCT_FR.svg",
width=1230,height=1070, format = "svg")
### CT+PE vs others
pre_data2 <- function(i){
dt <- ref %>%
fill(`T.Group.N (F/M)`, `C.Group.N (F/M)`, .direction = "down") %>%
mutate(n.T = str_split(`T.Group.N (F/M)`, '/') |>
map(as.numeric) |>
map_dbl(~sum(.x))) %>%
mutate(n.C = str_split(`C.Group.N (F/M)`, '/') |>
map(as.numeric) |>
map_dbl(~sum(.x))) %>%
filter(!is.na(.[,paste0(i, ".T.SD")])) %>%
select(PMID, Author, Year, n.T, n.C, Follow.up, paste0(i,".T.M"):paste0(i,".C.SD"), Treatment, Control) %>%
mutate(Time = ifelse(str_detect(Follow.up, '(12 months)|(360 days)'), "48 weeks",
ifelse(str_detect(Follow.up, '(180 days)'), "24 weeks",
ifelse(str_detect(Follow.up, '24 months'), "96 weeks",
ifelse(str_detect(Follow.up, '3 months'), "12 weeks",
ifelse(str_detect(Follow.up, '(30 days)|(1 month)'), "4 weeks",
ifelse(str_detect(Follow.up, '6 months'), "24 weeks",
ifelse(str_detect(Follow.up, '60 days'), "8 weeks",
ifelse(str_detect(Follow.up, '90 days'), "12 weeks",
ifelse(str_detect(Follow.up, "2-4weeks"), "4 weeks",
Follow.up)
))))))))) %>%
mutate(Time = as.duration(Time) |> as.numeric('weeks')) %>%
arrange(Time) %>%
mutate(Duration = ifelse(Time <= 12, "short-term",
ifelse(Time >12 & Time <= 24, "medium-term",
"long-term"))) %>%
mutate(Time = paste0(Time, " weeks")) %>%
mutate(Time = ifelse(Time == "4 weeks", paste0("<","4 weeks"), Time)) %>%
mutate(Study_id = paste0(Author," (", Year, ")")) %>%
filter(Treatment == "CT+PE" & Control == "PE")
return(dt)
}
i = 'ALT'
ref_ALT <- pre_data2(i)
ref_ALT %>% mutate(Total = n.T + n.C) %>%
distinct(PMID, .keep_all = T) %>%
summarise(sum(Total))
meta_ALT2 <- metacont(n.T, ALT.T.M, ALT.T.SD, n.C, ALT.C.M, ALT.C.SD, data = ref_ALT,
sm="SMD", subgroup = Time, studlab = Study_id) ## Standardized mean difference (SMD)
forest(meta_ALT2, digits=3,test.effect.subgroup = TRUE,test.overall = TRUE,family="sans",fontsize=9.5,lwd=2,col.diamond.fixed="lightslategray",col.diamond.lines.fixed="lightslategray",
col.diamond.random="maroon",col.diamond.lines.random="maroon",col.square="skyblue",col.study="lightslategray",
lty.fixed=4,plotwidth="8cm",colgap.forest.left="1cm",colgap.forest.right="1cm",just.forest="right",colgap.left="0.5cm",
colgap.right="0.5cm", layout = "RevMan5")
p2 = grid.grab()
rstudioapi::savePlotAsImage("./ALT_SCTPE_FR.svg",
width=1230,height=1070, format = "svg")
#######################################################
##### deep vs. peripheral | auto vs. allo ###########
#######################################################
pre_data3 <- function(i){
dt <- ref %>%
fill(`T.Group.N (F/M)`, `C.Group.N (F/M)`, .direction = "down") %>%
mutate(n.T = str_split(`T.Group.N (F/M)`, '/') |>
map(as.numeric) |>
map_dbl(~sum(.x))) %>%
mutate(n.C = str_split(`C.Group.N (F/M)`, '/') |>
map(as.numeric) |>
map_dbl(~sum(.x))) %>%
filter(!is.na(.[,paste0(i, ".T.SD")])) %>%
select(PMID, Author, Year, n.T, n.C, Follow.up, paste0(i,".T.M"):paste0(i,".C.SD"), Treatment, Control, Source, Injection_rout2, Injection_times) %>%
mutate(Follow.up = str_trim(Follow.up, side = "both")) %>%
mutate(Time = ifelse(str_detect(Follow.up, '(12 months)|(360 days)'), "48 weeks",
ifelse(str_detect(Follow.up, '180 days'), "24 weeks",
ifelse(str_detect(Follow.up, '24 months'), "96 weeks",
ifelse(str_detect(Follow.up, '3 months'), "12 weeks",
ifelse(str_detect(Follow.up, '(30 days)|(1 month)'), "4 weeks",
ifelse(str_detect(Follow.up, '6 months'), "24 weeks",
ifelse(str_detect(Follow.up, '60 days'), "8 weeks",
ifelse(str_detect(Follow.up, '90 days'), "12 weeks",
ifelse(str_detect(Follow.up, "2-4weeks"), "4 weeks",
Follow.up)
))))))))) %>%
mutate(Time = as.duration(Time) |> as.numeric('weeks')) %>%
arrange(Time) %>%
mutate(Duration = ifelse(Time <= 12, "short-term",
ifelse(Time >12 & Time <= 24, "medium-term",
"long-term"))) %>%
mutate(Time = paste0(Time, " weeks")) %>%
mutate(Time = ifelse(Time == "4 weeks", paste0("=< ","4 weeks"), Time)) %>%
mutate(Study_id = paste0(Author," (", Year, ")"," ", Time, " ", Treatment, " vs. ", Control))
return(dt)
}
## Source
i = 'ALT'
ref_ALT <- pre_data3(i)
ref_ALT %>% mutate(Total = n.T + n.C) %>%
distinct(PMID, .keep_all = T) %>%
summarise(sum(Total))
meta_ALT3 <- metacont(n.T, ALT.T.M, ALT.T.SD, n.C, ALT.C.M, ALT.C.SD, data = ref_ALT,
sm="SMD", subgroup = Source, studlab = Study_id) ## Standardized mean difference (SMD)
forest(meta_ALT3, digits=3,test.effect.subgroup = TRUE,test.overall = TRUE,family="sans",fontsize=9.5,lwd=2,col.diamond.fixed="lightslategray",col.diamond.lines.fixed="lightslategray",
col.diamond.random="maroon",col.diamond.lines.random="maroon",col.square="skyblue",col.study="lightslategray",
lty.fixed=4,plotwidth="8cm",colgap.forest.left="1cm",colgap.forest.right="1cm",just.forest="right",colgap.left="0.5cm",
colgap.right="0.5cm", layout = "RevMan5")
p3 = grid.grab()
rstudioapi::savePlotAsImage("./ALT_Source_FR.svg",
width=1390,height=1070, format = "svg")
## Injection route and times
i = 'ALT'
ref_ALT <- pre_data3(i)
ref_ALT %>% mutate(Total = n.T + n.C) %>%
distinct(PMID, .keep_all = T) %>%
summarise(sum(Total))
ref_ALT = ref_ALT %>%
mutate(Injection_rout2 = ifelse(Injection_rout2 == "Deep", "Deep+Single", "Peripheral+Multiple")) %>%
rename("Route+Injection" = Injection_rout2)
meta_ALT4 <- metacont(n.T, ALT.T.M, ALT.T.SD, n.C, ALT.C.M, ALT.C.SD, data = ref_ALT,
sm="SMD", subgroup = `Route+Injection`, studlab = Study_id) ## Standardized mean difference (SMD)
forest(meta_ALT4, digits=3,test.effect.subgroup = TRUE,test.overall = TRUE,family="sans",fontsize=9.5,lwd=2,col.diamond.fixed="lightslategray",col.diamond.lines.fixed="lightslategray",
col.diamond.random="maroon",col.diamond.lines.random="maroon",col.square="skyblue",col.study="lightslategray",
lty.fixed=4,plotwidth="8cm",colgap.forest.left="1cm",colgap.forest.right="1cm",just.forest="right",colgap.left="0.5cm",
colgap.right="0.5cm", layout = "RevMan5")
p4 = grid.grab()
rstudioapi::savePlotAsImage("./ALT_Source_FR.svg",
width=1390,height=1070, format = "svg")
###############################################
# TBIL combination ######
###############################################
# Load the data
rm(list = ls())
ref = read_excel("./Add_new_column.xlsx", sheet = 1) %>%
select(-1)
pre_data <- function(i){
dt <- ref %>%
fill(`T.Group.N (F/M)`, `C.Group.N (F/M)`, .direction = "down") %>%
mutate(n.T = str_split(`T.Group.N (F/M)`, '/') |>
map(as.numeric) |>
map_dbl(~sum(.x))) %>%
mutate(n.C = str_split(`C.Group.N (F/M)`, '/') |>
map(as.numeric) |>
map_dbl(~sum(.x))) %>%
filter(!is.na(.[,paste0(i, ".T.SD")])) %>%
select(PMID, Author, Year, n.T, n.C, Follow.up, paste0(i,".T.M"):paste0(i,".C.SD"), Treatment, Control) %>%
mutate(Follow.up = str_trim(Follow.up, side = "both")) %>%
mutate(Time = ifelse(str_detect(Follow.up, '(12 months)|(360 days)'), "48 weeks",
ifelse(str_detect(Follow.up, '(180 days)'), "24 weeks",
ifelse(str_detect(Follow.up, '(24 months)'), "96 weeks",
ifelse(str_detect(Follow.up, '(3 months)'), "12 weeks",
ifelse(str_detect(Follow.up, '(30 days)|(1 month)'), "4 weeks",
ifelse(str_detect(Follow.up, '(6 months)'), "24 weeks",
ifelse(str_detect(Follow.up, '(60 days)'), "8 weeks",
ifelse(str_detect(Follow.up, '(90 days)'), "12 weeks",
ifelse(str_detect(Follow.up, "(2-4weeks)"), "4 weeks",
Follow.up)
))))))))) %>%
mutate(Time = as.duration(Time) |> as.numeric('weeks')) %>%
arrange(Time) %>%
mutate(Duration = ifelse(Time <= 12, "short-term",
ifelse(Time >12 & Time <= 24, "medium-term",
"long-term"))) %>%
mutate(Time = paste0(Time, " weeks")) %>%
mutate(Time = ifelse(Time == "4 weeks", paste0("<","4 weeks"), Time)) %>%
mutate(Study_id = paste0(Author," (", Year, ")")) %>%
filter(Treatment == "CT" & Control == "SMT")
return(dt)
}
## SCT vs. SMT
i = 'TBIL'
ref_TBIL <- pre_data(i)
ref_TBIL %>% mutate(Total = n.T + n.C) %>%
distinct(PMID, .keep_all = T) %>%
summarise(sum(Total))
meta_TBIL1 <- metacont(n.T, TBIL.T.M, TBIL.T.SD, n.C, TBIL.C.M, TBIL.C.SD, data = ref_TBIL,
sm="SMD", subgroup = Time, studlab = Study_id) ## Standardized mean difference (SMD)
forest(meta_TBIL1, digits=3,test.effect.subgroup = TRUE,test.overall = TRUE,family="sans",fontsize=9.5,lwd=2,col.diamond.fixed="lightslategray",col.diamond.lines.fixed="lightslategray",
col.diamond.random="maroon",col.diamond.lines.random="maroon",col.square="skyblue",col.study="lightslategray",
lty.fixed=4,plotwidth="8cm",colgap.forest.left="1cm",colgap.forest.right="1cm",just.forest="right",colgap.left="0.5cm",
colgap.right="0.5cm", layout = "RevMan5")
p1 = grid.grab()
rstudioapi::savePlotAsImage("./TBIL_SCT_FR.svg",
width=1230,height=1070, format = "svg")
### CT+PE vs others
pre_data2 <- function(i){
dt <- ref %>%
fill(`T.Group.N (F/M)`, `C.Group.N (F/M)`, .direction = "down") %>%
mutate(n.T = str_split(`T.Group.N (F/M)`, '/') |>
map(as.numeric) |>
map_dbl(~sum(.x))) %>%
mutate(n.C = str_split(`C.Group.N (F/M)`, '/') |>
map(as.numeric) |>
map_dbl(~sum(.x))) %>%
filter(!is.na(.[,paste0(i, ".T.SD")])) %>%
select(PMID, Author, Year, n.T, n.C, Follow.up, paste0(i,".T.M"):paste0(i,".C.SD"), Treatment, Control) %>%
mutate(Time = ifelse(str_detect(Follow.up, '(12 months)|(360 days)'), "48 weeks",
ifelse(str_detect(Follow.up, '(180 days)'), "24 weeks",
ifelse(str_detect(Follow.up, '24 months'), "96 weeks",
ifelse(str_detect(Follow.up, '3 months'), "12 weeks",
ifelse(str_detect(Follow.up, '(30 days)|(1 month)'), "4 weeks",
ifelse(str_detect(Follow.up, '6 months'), "24 weeks",
ifelse(str_detect(Follow.up, '60 days'), "8 weeks",
ifelse(str_detect(Follow.up, '90 days'), "12 weeks",
ifelse(str_detect(Follow.up, "2-4weeks"), "4 weeks",
Follow.up)
))))))))) %>%
mutate(Time = as.duration(Time) |> as.numeric('weeks')) %>%
arrange(Time) %>%
mutate(Duration = ifelse(Time <= 12, "short-term",
ifelse(Time >12 & Time <= 24, "medium-term",
"long-term"))) %>%
mutate(Time = paste0(Time, " weeks")) %>%
mutate(Time = ifelse(Time == "4 weeks", paste0("<","4 weeks"), Time)) %>%
mutate(Study_id = paste0(Author," (", Year, ")")) %>%
filter(Treatment == "CT+PE" & Control == "PE")
return(dt)
}
i = 'TBIL'
ref_TBIL <- pre_data2(i)
ref_TBIL %>% mutate(Total = n.T + n.C) %>%
distinct(PMID, .keep_all = T) %>%
summarise(sum(Total))
meta_TBIL2 <- metacont(n.T, TBIL.T.M, TBIL.T.SD, n.C, TBIL.C.M, TBIL.C.SD, data = ref_TBIL,
sm="SMD", subgroup = Time, studlab = Study_id) ## Standardized mean difference (SMD)
forest(meta_TBIL2, digits=3,test.effect.subgroup = TRUE,test.overall = TRUE,family="sans",fontsize=9.5,lwd=2,col.diamond.fixed="lightslategray",col.diamond.lines.fixed="lightslategray",
col.diamond.random="maroon",col.diamond.lines.random="maroon",col.square="skyblue",col.study="lightslategray",
lty.fixed=4,plotwidth="8cm",colgap.forest.left="1cm",colgap.forest.right="1cm",just.forest="right",colgap.left="0.5cm",
colgap.right="0.5cm", layout = "RevMan5")
p2 = grid.grab()
rstudioapi::savePlotAsImage("./TBIL_SCTPE_FR.svg",
width=1230,height=1070, format = "svg")
###############################################
# ALB combination ######
###############################################
# Load the data
rm(list = ls())
ref = read_excel("./Add_new_column.xlsx", sheet = 1) %>%
select(-1)
pre_data <- function(i){
dt <- ref %>%
fill(`T.Group.N (F/M)`, `C.Group.N (F/M)`, .direction = "down") %>%
mutate(n.T = str_split(`T.Group.N (F/M)`, '/') |>
map(as.numeric) |>
map_dbl(~sum(.x))) %>%
mutate(n.C = str_split(`C.Group.N (F/M)`, '/') |>
map(as.numeric) |>
map_dbl(~sum(.x))) %>%
filter(!is.na(.[,paste0(i, ".T.SD")])) %>%
select(PMID, Author, Year, n.T, n.C, Follow.up, paste0(i,".T.M"):paste0(i,".C.SD"), Treatment, Control) %>%
mutate(Follow.up = str_trim(Follow.up, side = "both")) %>%
mutate(Time = ifelse(str_detect(Follow.up, '(12 months)|(360 days)'), "48 weeks",
ifelse(str_detect(Follow.up, '(180 days)'), "24 weeks",
ifelse(str_detect(Follow.up, '(24 months)'), "96 weeks",
ifelse(str_detect(Follow.up, '(3 months)'), "12 weeks",
ifelse(str_detect(Follow.up, '(30 days)|(1 month)'), "4 weeks",
ifelse(str_detect(Follow.up, '(6 months)'), "24 weeks",
ifelse(str_detect(Follow.up, '(60 days)'), "8 weeks",
ifelse(str_detect(Follow.up, '(90 days)'), "12 weeks",
ifelse(str_detect(Follow.up, "(2-4weeks)"), "4 weeks",
Follow.up)
))))))))) %>%
mutate(Time = as.duration(Time) |> as.numeric('weeks')) %>%
arrange(Time) %>%
mutate(Duration = ifelse(Time <= 12, "short-term",
ifelse(Time >12 & Time <= 24, "medium-term",
"long-term"))) %>%
mutate(Time = paste0(Time, " weeks")) %>%
mutate(Time = ifelse(Time == "4 weeks", paste0("<","4 weeks"), Time)) %>%
mutate(Study_id = paste0(Author," (", Year, ")")) %>%
filter(Treatment == "CT" & Control == "SMT")
return(dt)
}
## SCT vs. SMT
i = 'ALB'
ref_ALB <- pre_data(i)
ref_ALB %>% mutate(Total = n.T + n.C) %>%
distinct(PMID, .keep_all = T) %>%
summarise(sum(Total))
meta_ALB1 <- metacont(n.T, ALB.T.M, ALB.T.SD, n.C, ALB.C.M, ALB.C.SD, data = ref_ALB,
sm="SMD", subgroup = Time, studlab = Study_id) ## Standardized mean difference (SMD)
forest(meta_ALB1, digits=3,test.effect.subgroup = TRUE,test.overall = TRUE,family="sans",fontsize=9.5,lwd=2,col.diamond.fixed="lightslategray",col.diamond.lines.fixed="lightslategray",
col.diamond.random="maroon",col.diamond.lines.random="maroon",col.square="skyblue",col.study="lightslategray",
lty.fixed=4,plotwidth="8cm",colgap.forest.left="1cm",colgap.forest.right="1cm",just.forest="right",colgap.left="0.5cm",
colgap.right="0.5cm", layout = "RevMan5")
p1 = grid.grab()
rstudioapi::savePlotAsImage("./ALB_SCT_FR.svg",
width=1230,height=1070, format = "svg")
### CT+PE vs others
pre_data2 <- function(i){
dt <- ref %>%
fill(`T.Group.N (F/M)`, `C.Group.N (F/M)`, .direction = "down") %>%
mutate(n.T = str_split(`T.Group.N (F/M)`, '/') |>
map(as.numeric) |>
map_dbl(~sum(.x))) %>%
mutate(n.C = str_split(`C.Group.N (F/M)`, '/') |>
map(as.numeric) |>
map_dbl(~sum(.x))) %>%
filter(!is.na(.[,paste0(i, ".T.SD")])) %>%
select(PMID, Author, Year, n.T, n.C, Follow.up, paste0(i,".T.M"):paste0(i,".C.SD"), Treatment, Control) %>%
mutate(Time = ifelse(str_detect(Follow.up, '(12 months)|(360 days)'), "48 weeks",
ifelse(str_detect(Follow.up, '(180 days)'), "24 weeks",
ifelse(str_detect(Follow.up, '24 months'), "96 weeks",
ifelse(str_detect(Follow.up, '3 months'), "12 weeks",
ifelse(str_detect(Follow.up, '(30 days)|(1 month)'), "4 weeks",
ifelse(str_detect(Follow.up, '6 months'), "24 weeks",
ifelse(str_detect(Follow.up, '60 days'), "8 weeks",
ifelse(str_detect(Follow.up, '90 days'), "12 weeks",
ifelse(str_detect(Follow.up, "2-4weeks"), "4 weeks",
Follow.up)
))))))))) %>%
mutate(Time = as.duration(Time) |> as.numeric('weeks')) %>%
arrange(Time) %>%
mutate(Duration = ifelse(Time <= 12, "short-term",
ifelse(Time >12 & Time <= 24, "medium-term",
"long-term"))) %>%
mutate(Time = paste0(Time, " weeks")) %>%
mutate(Time = ifelse(Time == "4 weeks", paste0("<","4 weeks"), Time)) %>%
mutate(Study_id = paste0(Author," (", Year, ")")) %>%
filter(Treatment == "CT+PE" & Control == "PE")
return(dt)
}
i = 'ALB'
ref_ALB <- pre_data2(i)
ref_ALB %>% mutate(Total = n.T + n.C) %>%
distinct(PMID, .keep_all = T) %>%
summarise(sum(Total))
meta_ALB2 <- metacont(n.T, ALB.T.M, ALB.T.SD, n.C, ALB.C.M, ALB.C.SD, data = ref_ALB,
sm="SMD", subgroup = Time, studlab = Study_id) ## Standardized mean difference (SMD)
forest(meta_ALB2, digits=3,test.effect.subgroup = TRUE,test.overall = TRUE,family="sans",fontsize=9.5,lwd=2,col.diamond.fixed="lightslategray",col.diamond.lines.fixed="lightslategray",
col.diamond.random="maroon",col.diamond.lines.random="maroon",col.square="skyblue",col.study="lightslategray",
lty.fixed=4,plotwidth="8cm",colgap.forest.left="1cm",colgap.forest.right="1cm",just.forest="right",colgap.left="0.5cm",
colgap.right="0.5cm", layout = "RevMan5")
p2 = grid.grab()
rstudioapi::savePlotAsImage("./ALB_SCTPE_FR.svg",
width=1230,height=1070, format = "svg")
###############################################
# INR combination ######
###############################################
# Load the data
rm(list = ls())
ref = read_excel("./Add_new_column.xlsx", sheet = 1) %>%
select(-1)
pre_data <- function(i){
dt <- ref %>%
fill(`T.Group.N (F/M)`, `C.Group.N (F/M)`, .direction = "down") %>%
mutate(n.T = str_split(`T.Group.N (F/M)`, '/') |>
map(as.numeric) |>
map_dbl(~sum(.x))) %>%
mutate(n.C = str_split(`C.Group.N (F/M)`, '/') |>
map(as.numeric) |>
map_dbl(~sum(.x))) %>%
filter(!is.na(.[,paste0(i, ".T.SD")])) %>%
select(PMID, Author, Year, n.T, n.C, Follow.up, paste0(i,".T.M"):paste0(i,".C.SD"), Treatment, Control) %>%
mutate(Follow.up = str_trim(Follow.up, side = "both")) %>%
mutate(Time = ifelse(str_detect(Follow.up, '(12 months)|(360 days)'), "48 weeks",
ifelse(str_detect(Follow.up, '(180 days)'), "24 weeks",
ifelse(str_detect(Follow.up, '(24 months)'), "96 weeks",
ifelse(str_detect(Follow.up, '(3 months)'), "12 weeks",
ifelse(str_detect(Follow.up, '(30 days)|(1 month)'), "4 weeks",
ifelse(str_detect(Follow.up, '(6 months)'), "24 weeks",
ifelse(str_detect(Follow.up, '(60 days)'), "8 weeks",
ifelse(str_detect(Follow.up, '(90 days)'), "12 weeks",
ifelse(str_detect(Follow.up, "(2-4weeks)"), "4 weeks",
Follow.up)
))))))))) %>%
mutate(Time = as.duration(Time) |> as.numeric('weeks')) %>%
arrange(Time) %>%
mutate(Duration = ifelse(Time <= 12, "short-term",
ifelse(Time >12 & Time <= 24, "medium-term",
"long-term"))) %>%
mutate(Time = paste0(Time, " weeks")) %>%
mutate(Time = ifelse(Time == "4 weeks", paste0("<","4 weeks"), Time)) %>%
mutate(Study_id = paste0(Author," (", Year, ")")) %>%
filter(Treatment == "CT" & Control == "SMT")
return(dt)
}
## SCT vs. SMT
i = 'INR'
ref_INR <- pre_data(i)
ref_INR %>% mutate(Total = n.T + n.C) %>%
distinct(PMID, .keep_all = T) %>%
summarise(sum(Total))
meta_INR1 <- metacont(n.T, INR.T.M, INR.T.SD, n.C, INR.C.M, INR.C.SD, data = ref_INR,
sm="SMD", subgroup = Time, studlab = Study_id) ## Standardized mean difference (SMD)
forest(meta_INR1, digits=3,test.effect.subgroup = TRUE,test.overall = TRUE,family="sans",fontsize=9.5,lwd=2,col.diamond.fixed="lightslategray",col.diamond.lines.fixed="lightslategray",
col.diamond.random="maroon",col.diamond.lines.random="maroon",col.square="skyblue",col.study="lightslategray",
lty.fixed=4,plotwidth="8cm",colgap.forest.left="1cm",colgap.forest.right="1cm",just.forest="right",colgap.left="0.5cm",
colgap.right="0.5cm", layout = "RevMan5")
p1 = grid.grab()
rstudioapi::savePlotAsImage("./INR_SCT_FR.svg",
width=1230,height=1070, format = "svg")
### CT+PE vs others
#
pre_data2 <- function(i){
dt <- ref %>%
fill(`T.Group.N (F/M)`, `C.Group.N (F/M)`, .direction = "down") %>%
mutate(n.T = str_split(`T.Group.N (F/M)`, '/') |>
map(as.numeric) |>
map_dbl(~sum(.x))) %>%
mutate(n.C = str_split(`C.Group.N (F/M)`, '/') |>
map(as.numeric) |>
map_dbl(~sum(.x))) %>%
filter(!is.na(.[,paste0(i, ".T.SD")])) %>%
select(PMID, Author, Year, n.T, n.C, Follow.up, paste0(i,".T.M"):paste0(i,".C.SD"), Treatment, Control) %>%
mutate(Time = ifelse(str_detect(Follow.up, '(12 months)|(360 days)'), "48 weeks",
ifelse(str_detect(Follow.up, '(180 days)'), "24 weeks",
ifelse(str_detect(Follow.up, '24 months'), "96 weeks",
ifelse(str_detect(Follow.up, '3 months'), "12 weeks",
ifelse(str_detect(Follow.up, '(30 days)|(1 month)'), "4 weeks",
ifelse(str_detect(Follow.up, '6 months'), "24 weeks",
ifelse(str_detect(Follow.up, '60 days'), "8 weeks",
ifelse(str_detect(Follow.up, '90 days'), "12 weeks",
ifelse(str_detect(Follow.up, "2-4weeks"), "4 weeks",
Follow.up)
))))))))) %>%
mutate(Time = as.duration(Time) |> as.numeric('weeks')) %>%
arrange(Time) %>%
mutate(Duration = ifelse(Time <= 12, "short-term",
ifelse(Time >12 & Time <= 24, "medium-term",
"long-term"))) %>%
mutate(Time = paste0(Time, " weeks")) %>%
mutate(Time = ifelse(Time == "4 weeks", paste0("<","4 weeks"), Time)) %>%
mutate(Study_id = paste0(Author," (", Year, ")")) %>%
filter(Treatment == "CT+PE" & Control == "PE")
return(dt)
}
i = 'INR'
ref_INR <- pre_data2(i)
ref_INR %>% mutate(Total = n.T + n.C) %>%
distinct(PMID, .keep_all = T) %>%
summarise(sum(Total))
meta_INR2 <- metacont(n.T, INR.T.M, INR.T.SD, n.C, INR.C.M, INR.C.SD, data = ref_INR,
sm="SMD", subgroup = Time, studlab = Study_id) ## Standardized mean difference (SMD)
forest(meta_INR2, digits=3,test.effect.subgroup = TRUE,test.overall = TRUE,family="sans",fontsize=9.5,lwd=2,col.diamond.fixed="lightslategray",col.diamond.lines.fixed="lightslategray",
col.diamond.random="maroon",col.diamond.lines.random="maroon",col.square="skyblue",col.study="lightslategray",
lty.fixed=4,plotwidth="8cm",colgap.forest.left="1cm",colgap.forest.right="1cm",just.forest="right",colgap.left="0.5cm",
colgap.right="0.5cm", layout = "RevMan5")
p2 = grid.grab()
rstudioapi::savePlotAsImage("./INR_SCTPE_FR.svg",
width=1230,height=1070, format = "svg")
## Adjustment for publication bias
if(T){
par(mfrow = c(1, 2), # 2 x 2 pictures on one plot
pty = "s") # square plotting region
meta_INR <- metacont(n.T, INR.T.M, INR.T.SD, n.C, INR.C.M, INR.C.SD, data = ref_INR,
sm="SMD", subgroup = Time, studlab = Study_id)
meta_INR
meta::funnel(meta_INR)
title(main = "SCT+PE vs. PE", sub = "Funnel plot")
meta_INR <- escalc(measure = "SMD", n1i = n.T, m1i = INR.T.M, sd1i = INR.T.SD, n2i = n.C, m2i = INR.C.M,
sd2i = INR.C.SD, data = ref_INR, slab = Study_id) # Calculate effect size and variance
res <- rma(yi, vi, data=meta_INR) # Perform meta-analysis
res
metafor::trimfill(res)
metafor::trimfill(res) %>% meta::funnel()
title(sub = "Adjusted funnel plot")
}
rstudioapi::savePlotAsImage("./CT_PE_INR_AFU.svg", format = "svg",
width=695.04,height=456.96)
dev.off()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。