Я хотел бы построить три набора точек данных на одном воронкообразном графике (метафоры для R) - PullRequest
1 голос
/ 01 мая 2020

Можно ли назначить разные индикаторы для каждого набора точек данных на графике воронки? Я использую пакет метафора. Мой набор данных - это таблица Excel, импортированная в R. Я создал столбец («EffectType») и дал каждому исследованию значение (1, 2 или 3), относящееся к определенному типу эффекта. Сначала я провел метаанализ, и теперь я хочу создать воронкообразный график со всеми точками данных, но иметь возможность различать guish между типами эффектов с использованием разных индикаторов.

# load package
library(meta)
library(metafor)

# code for meta-analysis with sub-groups based on EffectType column
region.subgroup<-update.meta(m.dl, 
       byvar=EffectType, 
       comb.random = TRUE, 
       comb.fixed = FALSE)

# funnel plot
funnel(region.subgroup, xlab="Study Effect", pch=EffectType)

#dput(region.subgroup)
structure(list(studlab = c("Datta et al., 2011 [17] 1", "Nandi et al., 2017 [14] 1", 
"Okmen et al., 2017 [33] 1", "Cohen et al., 2012 [28] 1", "Ghahreman et al., 2010 [27] 1", 
"Karppinen et al., 2001 [25] 1", "Datta et al., 2011 [17] 2", 
"Manchikanti et al., 2012 [29] 2", "Nandi et al., 2017 [14] 2", 
"Ghai et al., 2015 [32] 2", "Manchikanti et al., 2014 [30] 2", 
"Okmen et al., 2017 [33] 2", "Karppinen et al., 2001 [25] 2", 
"Manchikanti et al., 2014 [31] 2", "Tafazal et al., 2009 [26] 2", 
"Manchikanti et al., 2012 [29] 3", "Ghai et al., 2015 [32] 3", 
"Manchikanti et al., 2014 [30] 3", "Okmen et al., 2017 [33] 3", 
"Karppinen et al., 2001 [25] 3", "Manchikanti et al., 2014 [31] 3"
), TE = c(-4.7, -17.9, -9, -12.6, -19.1, -2.3, -12.2, -7, -12.6, 
-13.9, -4, -20, 0.5, -1, -3.1, -4, -13.6, -6, -20, 16.2, 2), 
    seTE = c(1.4, 3.2, 2.6, 7.8, 6.6, 5.6, 1.7, 3.2, 4.1, 4.7, 
    2.4, 2.7, 5.9, 3, 7.2, 3.2, 5.1, 2.4, 2.3, 5.4, 2.9), lower = c(-7.44394957835607, 
    -24.1718847505282, -14.0959063598041, -27.8877190794124, 
    -32.0357622979644, -13.2757983134243, -15.5319387737181, 
    -13.2718847505282, -20.6358523366142, -23.1118307273383, 
    -8.70391356289613, -25.2919027582581, -11.0637875087863, 
    -6.87989195362016, -17.2117406886884, -10.2718847505282, 
    -23.5958163211543, -10.7039135628961, -24.5079171644421, 
    5.61619448348371, -3.68389555516616), upper = c(-1.95605042164393, 
    -11.6281152494718, -3.90409364019586, 2.68771907941242, -6.16423770203565, 
    8.6757983134243, -8.86806122628191, -0.728115249471828, -4.56414766338578, 
    -4.68816927266175, 0.703913562896129, -14.7080972417419, 
    12.0637875087863, 4.87989195362016, 11.0117406886884, 2.27188475052817, 
    -3.60418367884573, -1.29608643710387, -15.4920828355579, 
    26.7838055165163, 7.68389555516616), zval = c(-3.35714285714286, 
    -5.59375, -3.46153846153846, -1.61538461538462, -2.89393939393939, 
    -0.410714285714286, -7.17647058823529, -2.1875, -3.07317073170732, 
    -2.95744680851064, -1.66666666666667, -7.40740740740741, 
    0.0847457627118644, -0.333333333333333, -0.430555555555556, 
    -1.25, -2.66666666666667, -2.5, -8.69565217391304, 3, 0.689655172413793
    ), pval = c(0.000787524113356462, 2.22216865721181e-08, 0.000537097369288895, 
    0.106227429780004, 0.00380441585463475, 0.681282050502955, 
    7.15340318600297e-13, 0.0287060432176033, 0.00211797275208796, 
    0.00310198263536442, 0.0955807045456294, 1.28792344844862e-13, 
    0.932463513418651, 0.738882680363527, 0.666791563255851, 
    0.21129954733371, 0.00766076113517946, 0.0124193306515523, 
    3.44843305532707e-18, 0.00269979606326019, 0.49041106256261
    ), w.fixed = c(0.510204081632653, 0.09765625, 0.14792899408284, 
    0.0164365548980934, 0.0229568411386593, 0.0318877551020408, 
    0.346020761245675, 0.09765625, 0.0594883997620464, 0.0452693526482571, 
    0.173611111111111, 0.137174211248285, 0.0287273771904625, 
    0.111111111111111, 0.0192901234567901, 0.09765625, 0.0384467512495194, 
    0.173611111111111, 0.189035916824197, 0.0342935528120713, 
    0.118906064209275), w.random = c(0.0214176925138593, 0.0181916183177061, 
    0.0194211070756584, 0.00947235474026367, 0.0113262634833647, 
    0.0131422674465617, 0.0209994165994997, 0.0181916183177061, 
    0.0162494959147883, 0.0149654961747124, 0.0198057567991695, 
    0.0192232386898817, 0.0125722321000861, 0.0186114480430381, 
    0.0103551430341111, 0.0181916183177061, 0.0141361996281868, 
    0.0198057567991695, 0.019991855094554, 0.0135335632021998, 
    0.0188180848095829), TE.fixed = -8.41570672745868, seTE.fixed = 0.632788615741458, 
    lower.fixed = -9.65594962413889, upper.fixed = -7.17546383077847, 
    zval.fixed = -13.2993965411305, pval.fixed = 2.33343994878356e-40, 
    TE.random = -8.03110782264546, seTE.random = 1.69413132899102, 
    lower.random = -11.3515442125488, upper.random = -4.71067143274209, 
    zval.random = -4.74054619332764, pval.random = 2.13142849171202e-06, 
    null.effect = 0, seTE.predict = 6.89930804641291, lower.predict = -22.4715255225605, 
    upper.predict = 6.40930987726956, level.predict = 0.95, k = 21L, 
    Q = 121.264278025894, df.Q = 20L, pval.Q = 1.66241937202041e-16, 
    tau2 = 44.730370559429, se.tau2 = 21.3861120417447, lower.tau2 = 24.5614440042434, 
    upper.tau2 = 127.202454097413, tau = 6.68807674592846, lower.tau = 4.95595036337567, 
    upper.tau = 11.2784065407048, method.tau.ci = "J", sign.lower.tau = "", 
    sign.upper.tau = "", H = 2.4623594175698, lower.H = 2.03762882436406, 
    upper.H = 2.97562236497465, I2 = 0.835070967925695, lower.I2 = 0.759148226308052, 
    upper.I2 = 0.887060887266879, Rb = 0.742145491876444, lower.Rb = 0.586934294476571, 
    upper.Rb = 0.897356689276318, approx.TE = c("", "", "", "", 
    "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", 
    "", ""), approx.seTE = c("", "", "", "", "", "", "", "", 
    "", "", "", "", "", "", "", "", "", "", "", "", ""), sm = "MD", 
    method = "Inverse", level = 0.95, level.comb = 0.95, comb.fixed = FALSE, 
    comb.random = TRUE, overall = TRUE, overall.hetstat = TRUE, 
    hakn = FALSE, df.hakn = NULL, method.tau = "DL", method.tau.ci = "J", 
    tau.preset = NULL, TE.tau = NULL, tau.common = FALSE, prediction = FALSE, 
    method.bias = "linreg", n.e = NULL, n.c = NULL, title = "", 
    complab = "", outclab = "", label.e = "Experimental", label.c = "Control", 
    label.left = "", label.right = "", data = structure(list(
        Author = c("Datta et al., 2011 [17] 1", "Nandi et al., 2017 [14] 1", 
        "Okmen et al., 2017 [33] 1", "Cohen et al., 2012 [28] 1", 
        "Ghahreman et al., 2010 [27] 1", "Karppinen et al., 2001 [25] 1", 
        "Datta et al., 2011 [17] 2", "Manchikanti et al., 2012 [29] 2", 
        "Nandi et al., 2017 [14] 2", "Ghai et al., 2015 [32] 2", 
        "Manchikanti et al., 2014 [30] 2", "Okmen et al., 2017 [33] 2", 
        "Karppinen et al., 2001 [25] 2", "Manchikanti et al., 2014 [31] 2", 
        "Tafazal et al., 2009 [26] 2", "Manchikanti et al., 2012 [29] 3", 
        "Ghai et al., 2015 [32] 3", "Manchikanti et al., 2014 [30] 3", 
        "Okmen et al., 2017 [33] 3", "Karppinen et al., 2001 [25] 3", 
        "Manchikanti et al., 2014 [31] 3"), TE = c(-4.7, -17.9, 
        -9, -12.6, -19.1, -2.3, -12.2, -7, -12.6, -13.9, -4, 
        -20, 0.5, -1, -3.1, -4, -13.6, -6, -20, 16.2, 2), seTE = c(1.4, 
        3.2, 2.6, 7.8, 6.6, 5.6, 1.7, 3.2, 4.1, 4.7, 2.4, 2.7, 
        5.9, 3, 7.2, 3.2, 5.1, 2.4, 2.3, 5.4, 2.9), RoB = c("High", 
        "Some", "Some", "Low", "Low", "Low", "High", "High", 
        "Some", "High", "High", "Some", "Low", "High", "High", 
        "High", "High", "High", "Some", "Low", "High"), Technique = c("Caudal", 
        "Caudal", "Interlaminar", "Transforaminal", "Transforaminal", 
        "Transforaminal", "Caudal", "Caudal", "Caudal", "Interlaminar", 
        "Interlaminar", "Interlaminar", "Transforaminal", "Transforaminal", 
        "Transforaminal", "Caudal", "Interlaminar", "Interlaminar", 
        "Interlaminar", "Transforaminal", "Transforaminal"), 
        EffectType = c(1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 
        2, 2, 3, 3, 3, 3, 3, 3), .TE = c(-4.7, -17.9, -9, -12.6, 
        -19.1, -2.3, -12.2, -7, -12.6, -13.9, -4, -20, 0.5, -1, 
        -3.1, -4, -13.6, -6, -20, 16.2, 2), .seTE = c(1.4, 3.2, 
        2.6, 7.8, 6.6, 5.6, 1.7, 3.2, 4.1, 4.7, 2.4, 2.7, 5.9, 
        3, 7.2, 3.2, 5.1, 2.4, 2.3, 5.4, 2.9), .studlab = c("Datta et al., 2011 [17] 1", 
        "Nandi et al., 2017 [14] 1", "Okmen et al., 2017 [33] 1", 
        "Cohen et al., 2012 [28] 1", "Ghahreman et al., 2010 [27] 1", 
        "Karppinen et al., 2001 [25] 1", "Datta et al., 2011 [17] 2", 
        "Manchikanti et al., 2012 [29] 2", "Nandi et al., 2017 [14] 2", 
        "Ghai et al., 2015 [32] 2", "Manchikanti et al., 2014 [30] 2", 
        "Okmen et al., 2017 [33] 2", "Karppinen et al., 2001 [25] 2", 
        "Manchikanti et al., 2014 [31] 2", "Tafazal et al., 2009 [26] 2", 
        "Manchikanti et al., 2012 [29] 3", "Ghai et al., 2015 [32] 3", 
        "Manchikanti et al., 2014 [30] 3", "Okmen et al., 2017 [33] 3", 
        "Karppinen et al., 2001 [25] 3", "Manchikanti et al., 2014 [31] 3"
        ), .byvar = c(1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 
        2, 2, 3, 3, 3, 3, 3, 3)), row.names = c(NA, -21L), class = c("tbl_df", 
    "tbl", "data.frame")), subset = NULL, exclude = NULL, print.byvar = TRUE, 
    byseparator = " = ", warn = FALSE, call = update.meta(object = m.dl, 
        comb.fixed = FALSE, comb.random = TRUE, byvar = EffectType), 
    backtransf = TRUE, pscale = 1, irscale = 1, irunit = "person-years", 
    control = NULL, version = "4.11-0", byvar = c(1, 1, 1, 1, 
    1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3), bylab = "EffectType", 
    bylevs = c(1, 2, 3), TE.fixed.w = c(-7.49184655119754, -9.70033189245231, 
    -7.58113477771093), seTE.fixed.w = c(1.09958483281334, 0.990950004138082, 
    1.23849133665371), lower.fixed.w = c(-9.64699322145819, -11.6425582110428, 
    -10.0085331927171), upper.fixed.w = c(-5.33669988093689, 
    -7.75810557386185, -5.15373636270479), zval.fixed.w = c(-6.81334111532738, 
    -9.78892159235577, -6.12126589290035), pval.fixed.w = c(9.53576665434999e-12, 
    1.25628597075612e-22, 9.283483870295e-10), w.fixed.w = c(0.827070476854287, 
    1.01834869777374, 0.651949646206173), TE.random.w = c(-10.2458375238752, 
    -8.71229409104888, -4.62563643882933), seTE.random.w = c(2.84471402157904, 
    2.3359545201711, 4.58539814394897), lower.random.w = c(-15.8213745524862, 
    -13.2906808201078, -13.6128516557461), upper.random.w = c(-4.67030049526417, 
    -4.13390736198999, 4.36157877808746), zval.random.w = c(-3.60171090877808, 
    -3.72965056289313, -1.00877531102364), pval.random.w = c(0.000316129799539468, 
    0.000191745502800541, 0.313082404109481), df.hakn.w = NA, 
    w.random.w = c(0.0929713035774138, 0.150973845672993, 0.104477077851399
    ), n.harmonic.mean.w = c(NaN, NaN, NaN), t.harmonic.mean.w = c(NaN, 
    NaN, NaN), n.e.w = c(NA_real_, NA_real_, NA_real_), n.c.w = c(NA_real_, 
    NA_real_, NA_real_), k.w = c(6, 9, 6), k.all.w = c(6, 9, 
    6), Q.w = c(19.2741174885702, 36.6059037028299, 62.5437059660418
    ), pval.Q.w = c(0.00170872673573467, 1.35972605922616e-05, 
    3.6187724514725e-12), tau2.w = c(30.2319880674129, 34.6927986679139, 
    112.715864492933), lower.tau2.w = c(0, 7.93291056541169, 
    40.9875930481943), upper.tau2.w = c(273.001472845768, 164.636965092514, 
    841.055330841785), tau.w = c(5.49836230776154, 5.8900593093715, 
    10.6167727908689), lower.tau.w = c(0, 2.81654230669658, 6.4021553439599
    ), upper.tau.w = c(16.5227562121387, 12.8310936826334, 29.0009539643403
    ), sign.lower.tau.w = c("", "", ""), sign.upper.tau.w = c(">", 
    "", ""), H.w = c(1.96337044332292, 2.13909746455222, 3.53676988129117
    ), lower.H.w = c(1.30025792415368, 1.55608033482686, 2.61352364778506
    ), upper.H.w = c(2.96466064625071, 2.94055381360684, 4.78615956041163
    ), I2.w = c(0.740584750354196, 0.781456016905231, 0.920055904542741
    ), lower.I2.w = c(0.408518750491136, 0.587013389638618, 0.853597958795784
    ), upper.I2.w = c(0.886224167199427, 0.884351038632625, 0.956345838173359
    ), Rb.w = c(0.622641738855097, 0.706428253205448, 0.893469422711138
    ), lower.Rb.w = c(0.239211625891973, 0.444004978891535, 0.756837535911127
    ), upper.Rb.w = c(1, 0.968851527519361, 1), Q.w.fixed = 118.423727157442, 
    Q.w.random = NA, df.Q.w = 18, pval.Q.w.fixed = 8.32021898549227e-17, 
    pval.Q.w.random = NA, Q.b.fixed = 2.84055086845167, Q.b.random = 1.08484237833637, 
    df.Q.b = 2, pval.Q.b.fixed = 0.241647449751775, pval.Q.b.random = 0.581339015320737, 
    upper.tau2.resid = NA, lower.tau2.resid = NA, tau2.resid = NA, 
    upper.tau.resid = NA, lower.tau.resid = NA, tau.resid = NA, 
    H.resid = 2.5649748445533, lower.H.resid = 2.11081744736669, 
    upper.H.resid = 3.11684743813296, I2.resid = 0.848003432825, 
    lower.I2.resid = 0.775560832323316, upper.I2.resid = 0.897063615624055, 
    call.object = metagen(TE = TE, seTE = seTE, studlab = paste(Author), 
        data = Funnel_plot_data_Pain, sm = "MD", comb.fixed = FALSE, 
        comb.random = TRUE, hakn = FALSE, prediction = FALSE)), class = c("metagen", 
"meta"))

I знаю, что я могу как-то сделать это с помощью функции pch, но я не могу заставить ее работать. Есть предложения?

Спасибо! E.

1 Ответ

0 голосов
/ 01 мая 2020

Вы были близки, pch работает. В metabin() вы определяете переменную "byvar", поэтому вам просто нужно выбрать pch для этой переменной в аргументе pch= графика. Я не уверен, какой класс "byvar", но as.numeric(as.factor(m1$byvar)) должен быть устойчивым. Пример:

library("meta")

data(Olkin95)
# add toy effect type
set.seed(42)
Olkin95 <- transform(Olkin95, EffectType=sample(letters[1:6], nrow(Olkin95), replace=T))

m1 <- metabin(event.e, n.e, event.c, n.c,
              data=Olkin95, subset=c(41, 47, 51, 59),
              studlab=paste(author, year),
              byvar=EffectType,    ## defining byvar
              sm="RR", method="I")

op <- par(mfrow=c(1, 2))
meta::funnel(m1, pch=as.numeric(as.factor(m1$byvar)), main="w/ pch")    ## using byvar for pch
meta::funnel(m1, main="w/o pch")
par(op)

enter image description here

Обратите внимание, , что у меня возникли некоторые проблемы с funnel(), потому что, как ни странно, два пакета совместно используют функцию с одинаковым именем: есть metafor::funnel, а также meta::funnel функция. Я использовал meta::funnel здесь.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...