——–1. Meta analysis of proportions, by subgroup, of those who obtained good outcomes after treament (subgroup) ———

metaprop1_PAH <- read.table(text = "
Study_ID Sample subgroup suc_treat complications
'Mbaye 2021' 24 'Microsurgery' 10 14
'Skoch 2017-S' 9 'Surgery' 9 0
'Skoch 2017-E' 7 'Endovascular' 7 0
'Slator 2019-S' 4 'Surgery' 4 0
'Slator 2019-E' 16 'Endovascular' 14 2
'Aryan 2006' 50 'Endovascular+surgery' 44 10
'Stiefel 2008' 12 'Microsurgery+Endovascular' 11 1
'Kakarla 2010' 48 'Surgery' 19 29
'Mehrotra 2012' 63 'Surgery' 44 19
'Deora 2016' 44 'Microsurgery' 31 13
'Vaid 2008' 27 'Surgery' 21 6
'Herman 1991' 16 'Surgery' 11 5
'Storrs 1982' 29 'Surgery' 16 13
'Alawi 2014-S' 200 'Surgery' 187 13
'Alawi 2014-E' 920 'Endovascular' 905 15
", header = TRUE, stringsAsFactors = FALSE)

print(metaprop1_PAH)
##         Study_ID Sample                  subgroup suc_treat complications
## 1     Mbaye 2021     24              Microsurgery        10            14
## 2   Skoch 2017-S      9                   Surgery         9             0
## 3   Skoch 2017-E      7              Endovascular         7             0
## 4  Slator 2019-S      4                   Surgery         4             0
## 5  Slator 2019-E     16              Endovascular        14             2
## 6     Aryan 2006     50      Endovascular+surgery        44            10
## 7   Stiefel 2008     12 Microsurgery+Endovascular        11             1
## 8   Kakarla 2010     48                   Surgery        19            29
## 9  Mehrotra 2012     63                   Surgery        44            19
## 10    Deora 2016     44              Microsurgery        31            13
## 11     Vaid 2008     27                   Surgery        21             6
## 12   Herman 1991     16                   Surgery        11             5
## 13   Storrs 1982     29                   Surgery        16            13
## 14  Alawi 2014-S    200                   Surgery       187            13
## 15  Alawi 2014-E    920              Endovascular       905            15
# Install the meta package if not already installed
if (!require(meta)) {
  install.packages("meta")
  library(meta)
}
## Loading required package: meta
## Loading required package: metadat
## Loading 'meta' package (version 7.0-0).
## Type 'help(meta)' for a brief overview.
## Readers of 'Meta-Analysis with R (Use R!)' should install
## older version of 'meta' package: https://tinyurl.com/dt4y5drs
# Assuming 'df' is your DataFrame loaded as previously shown
# Meta-analysis of proportions with study labels

# Calculate the pooled proportion using metaprop function, labeling each study by the First Author
meta_analysis1 <- metaprop(event = suc_treat, n = Sample, data = metaprop1_PAH, 
                          sm = "PLO", method.tau = "DL",
                          prediction = FALSE, comb.fixed = FALSE,
                          comb.random = TRUE, studlab = metaprop1_PAH$Study_ID,
                          byvar = subgroup
                          )

# Summary of the meta-analysis
summary(meta_analysis1)
##               proportion           95%-CI %W(random)                  subgroup
## Mbaye 2021        0.4167 [0.2211; 0.6336]        7.5              Microsurgery
## Skoch 2017-S      1.0000 [0.6637; 1.0000]        4.2                   Surgery
## Skoch 2017-E      1.0000 [0.5904; 1.0000]        4.2              Endovascular
## Slator 2019-S     1.0000 [0.3976; 1.0000]        4.1                   Surgery
## Slator 2019-E     0.8750 [0.6165; 0.9845]        6.4              Endovascular
## Aryan 2006        0.8800 [0.7569; 0.9547]        7.4      Endovascular+surgery
## Stiefel 2008      0.9167 [0.6152; 0.9979]        5.5 Microsurgery+Endovascular
## Kakarla 2010      0.3958 [0.2577; 0.5473]        7.7                   Surgery
## Mehrotra 2012     0.6984 [0.5698; 0.8077]        7.8                   Surgery
## Deora 2016        0.7045 [0.5480; 0.8324]        7.6              Microsurgery
## Vaid 2008         0.7778 [0.5774; 0.9138]        7.3                   Surgery
## Herman 1991       0.6875 [0.4134; 0.8898]        7.1                   Surgery
## Storrs 1982       0.5517 [0.3569; 0.7355]        7.6                   Surgery
## Alawi 2014-S      0.9350 [0.8914; 0.9649]        7.7                   Surgery
## Alawi 2014-E      0.9837 [0.9733; 0.9908]        7.8              Endovascular
## 
## Number of studies: k = 15
## Number of observations: o = 1469
## Number of events: e = 1333
## 
##                      proportion           95%-CI
## Random effects model     0.8170 [0.6557; 0.9128]
## 
## Quantifying heterogeneity:
##  tau^2 = 2.3618 [0.8052; 5.2929]; tau = 1.5368 [0.8973; 2.3006]
##  I^2 = 93.2% [90.4%; 95.2%]; H = 3.84 [3.22; 4.57]
## 
## Test of heterogeneity:
##       Q d.f.  p-value
##  206.04   14 < 0.0001
## 
## Results for subgroups (random effects model):
##                                        k proportion           95%-CI  tau^2
## subgroup = Microsurgery                2     0.5725 [0.2915; 0.8134] 0.5863
## subgroup = Surgery                     8     0.7502 [0.5464; 0.8822] 1.3432
## subgroup = Endovascular                3     0.9561 [0.8067; 0.9913] 1.4859
## subgroup = Endovascular+surgery        1     0.8800 [0.7576; 0.9451]     --
## subgroup = Microsurgery+Endovascular   1     0.9167 [0.5868; 0.9884]     --
##                                         tau     Q   I^2
## subgroup = Microsurgery              0.7657  5.18 80.7%
## subgroup = Surgery                   1.1590 64.65 89.2%
## subgroup = Endovascular              1.2190  7.88 74.6%
## subgroup = Endovascular+surgery          --  0.00    --
## subgroup = Microsurgery+Endovascular     --  0.00    --
## 
## Test for subgroup differences (random effects model):
##                    Q d.f. p-value
## Between groups 10.28    4  0.0359
## 
## Details on meta-analytical method:
## - Inverse variance method
## - DerSimonian-Laird estimator for tau^2
## - Jackson method for confidence interval of tau^2 and tau
## - Logit transformation
## - Clopper-Pearson confidence interval for individual studies
## - Continuity correction of 0.5 in studies with zero cell frequencies
# To visualize the results, you can plot a forest plot
meta::forest(meta_analysis1, layout = "JAMA")

1. Meta analysis of proportions, by subgroup, of those who obtained good outcomes after treament (subgroup)

——–2. Meta analysis of proportions, by subgroup, of those who obtained complications after treament (subgroup) ———

Same data as the previous one

# Calculate the pooled proportion using metaprop function, labeling each study by the First Author
meta_analysis2 <- metaprop(event = complications, n = Sample, data = metaprop1_PAH, 
                          sm = "PLO", method.tau = "DL",
                          prediction = FALSE, comb.fixed = FALSE,
                          comb.random = TRUE, studlab = metaprop1_PAH$Study_ID,
                          byvar = metaprop1_PAH$subgroup
                          )

# Summary of the meta-analysis
summary(meta_analysis2)
##               proportion           95%-CI %W(random)                  subgroup
## Mbaye 2021        0.5833 [0.3664; 0.7789]        7.5              Microsurgery
## Skoch 2017-S      0.0000 [0.0000; 0.3363]        4.2                   Surgery
## Skoch 2017-E      0.0000 [0.0000; 0.4096]        4.1              Endovascular
## Slator 2019-S     0.0000 [0.0000; 0.6024]        4.1                   Surgery
## Slator 2019-E     0.1250 [0.0155; 0.3835]        6.4              Endovascular
## Aryan 2006        0.2000 [0.1003; 0.3372]        7.6      Endovascular+surgery
## Stiefel 2008      0.0833 [0.0021; 0.3848]        5.4 Microsurgery+Endovascular
## Kakarla 2010      0.6042 [0.4527; 0.7423]        7.7                   Surgery
## Mehrotra 2012     0.3016 [0.1923; 0.4302]        7.8                   Surgery
## Deora 2016        0.2955 [0.1676; 0.4520]        7.7              Microsurgery
## Vaid 2008         0.2222 [0.0862; 0.4226]        7.3                   Surgery
## Herman 1991       0.3125 [0.1102; 0.5866]        7.1                   Surgery
## Storrs 1982       0.4483 [0.2645; 0.6431]        7.6                   Surgery
## Alawi 2014-S      0.0650 [0.0351; 0.1086]        7.7                   Surgery
## Alawi 2014-E      0.0163 [0.0092; 0.0267]        7.8              Endovascular
## 
## Number of studies: k = 15
## Number of observations: o = 1469
## Number of events: e = 140
## 
##                      proportion           95%-CI
## Random effects model     0.1903 [0.0924; 0.3517]
## 
## Quantifying heterogeneity:
##  tau^2 = 2.2707 [0.7831; 5.1483]; tau = 1.5069 [0.8850; 2.2690]
##  I^2 = 93.2% [90.3%; 95.2%]; H = 3.82 [3.21; 4.55]
## 
## Test of heterogeneity:
##       Q d.f.  p-value
##  204.59   14 < 0.0001
## 
## Results for subgroups (random effects model):
##                                        k proportion           95%-CI  tau^2
## subgroup = Microsurgery                2     0.4275 [0.1866; 0.7085] 0.5863
## subgroup = Surgery                     8     0.2498 [0.1178; 0.4536] 1.3432
## subgroup = Endovascular                3     0.0439 [0.0087; 0.1933] 1.4859
## subgroup = Endovascular+surgery        1     0.2000 [0.1111; 0.3333]     --
## subgroup = Microsurgery+Endovascular   1     0.0833 [0.0116; 0.4132]     --
##                                         tau     Q   I^2
## subgroup = Microsurgery              0.7657  5.18 80.7%
## subgroup = Surgery                   1.1590 64.65 89.2%
## subgroup = Endovascular              1.2190  7.88 74.6%
## subgroup = Endovascular+surgery          --  0.00    --
## subgroup = Microsurgery+Endovascular     --  0.00    --
## 
## Test for subgroup differences (random effects model):
##                   Q d.f. p-value
## Between groups 8.60    4  0.0719
## 
## Details on meta-analytical method:
## - Inverse variance method
## - DerSimonian-Laird estimator for tau^2
## - Jackson method for confidence interval of tau^2 and tau
## - Logit transformation
## - Clopper-Pearson confidence interval for individual studies
## - Continuity correction of 0.5 in studies with zero cell frequencies
# To visualize the results, you can plot a forest plot
meta::forest(meta_analysis2, layout = "JAMA")

2. Meta analysis of proportions, by subgroup, of those who obtained complications after treament (subgroup)

——–3. Meta analysis of odds ratios for risk of successful treatment surgery vs endovascular ———

data_comparison <- read.table(text = "
Study_ID sample_surg suc_surg comp_surg sample_endo suc_end comp_end
'Skoch, 2017' 9 9 0 7 7 0
'Slator, 2019' 4 4 0 16 14 2
'Alawi, 2014' 200 187 13 920 905 15
", header = TRUE, stringsAsFactors = FALSE)

print(data_comparison)
##       Study_ID sample_surg suc_surg comp_surg sample_endo suc_end comp_end
## 1  Skoch, 2017           9        9         0           7       7        0
## 2 Slator, 2019           4        4         0          16      14        2
## 3  Alawi, 2014         200      187        13         920     905       15
# Load the necessary library
library(meta)

# Assuming mrs_odds is already loaded with your data
# You might need to check the names of your columns with names(mrs_odds)

# Meta-analysis of odds ratios
meta_analysis3 <- metabin(
  event.e = data_comparison$suc_end, 
  n.e = data_comparison$sample_endo, 
  event.c = data_comparison$suc_surg, 
  n.c = data_comparison$sample_surg, 
  data = data_comparison,
  studlab = paste(data_comparison$Study_ID),
  sm = "OR",                     # Specify summary measure as Odds Ratio
  method.tau = "DL",             # DerSimonian-Laird estimator for tau^2
  comb.fixed = FALSE,            # Random effects model
  comb.random = TRUE,            # Include random effects
  prediction = FALSE             # No prediction interval by default
)

# Summary of the meta-analysis
summary(meta_analysis3)
##                  OR            95%-CI %W(random)
## Skoch, 2017      NA                          0.0
## Slator, 2019 0.6444 [0.0259; 16.0534]       14.4
## Alawi, 2014  4.1943 [1.9631;  8.9614]       85.6
## 
## Number of studies: k = 2
## Number of observations: o = 1156 (o.e = 943, o.c = 213)
## Number of events: e = 1126
## 
##                          OR            95%-CI    z p-value
## Random effects model 3.2014 [0.8715; 11.7609] 1.75  0.0796
## 
## Quantifying heterogeneity:
##  tau^2 = 0.3650; tau = 0.6041; I^2 = 20.4%; H = 1.12
## 
## Test of heterogeneity:
##     Q d.f. p-value
##  1.26    1  0.2622
## 
## Details on meta-analytical method:
## - Inverse variance method
## - DerSimonian-Laird estimator for tau^2
## - Mantel-Haenszel estimator used in calculation of Q and tau^2 (like RevMan 5)
## - Continuity correction of 0.5 in studies with zero cell frequencies
# To visualize the results, you can plot a forest plot
meta::forest(meta_analysis3, layout = "JAMA")

——–4. Meta analysis of odds ratios for risk of complications in surgery vs endovascular ———

# Load the necessary library
library(meta)

# Assuming mrs_odds is already loaded with your data
# You might need to check the names of your columns with names(mrs_odds)

# Meta-analysis of odds ratios
meta_analysis4 <- metabin(
  event.e = data_comparison$comp_end, 
  n.e = data_comparison$sample_endo, 
  event.c = data_comparison$comp_surg, 
  n.c = data_comparison$sample_surg, 
  data = data_comparison,
  studlab = paste(data_comparison$Study_ID),
  sm = "OR",                     # Specify summary measure as Odds Ratio
  method.tau = "DL",             # DerSimonian-Laird estimator for tau^2
  comb.fixed = FALSE,            # Random effects model
  comb.random = TRUE,            # Include random effects
  prediction = FALSE             # No prediction interval by default
)

# Summary of the meta-analysis
summary(meta_analysis4)
##                  OR            95%-CI %W(random)
## Skoch, 2017      NA                          0.0
## Slator, 2019 1.5517 [0.0623; 38.6542]       14.4
## Alawi, 2014  0.2384 [0.1116;  0.5094]       85.6
## 
## Number of studies: k = 2
## Number of observations: o = 1156 (o.e = 943, o.c = 213)
## Number of events: e = 30
## 
##                          OR           95%-CI     z p-value
## Random effects model 0.3124 [0.0850; 1.1475] -1.75  0.0796
## 
## Quantifying heterogeneity:
##  tau^2 = 0.3650; tau = 0.6041; I^2 = 20.4%; H = 1.12
## 
## Test of heterogeneity:
##     Q d.f. p-value
##  1.26    1  0.2622
## 
## Details on meta-analytical method:
## - Inverse variance method
## - DerSimonian-Laird estimator for tau^2
## - Mantel-Haenszel estimator used in calculation of Q and tau^2 (like RevMan 5)
## - Continuity correction of 0.5 in studies with zero cell frequencies
# To visualize the results, you can plot a forest plot
meta::forest(meta_analysis4, layout = "JAMA")