微信公眾號:醫學統計與R語言
簡介R 軟體netmeta 程序包是基於經典頻率學派研發的一款專用於實現網狀Meta 分析的程序包。
R package netmeta provides frequentist methods for network meta-analysis and supports Schwarzer et al. (2015).
- 輸入1:
mynet <- read.csv("mynet.csv",header=T)
mynet
- 結果1:
study treatment1 y1 sd1 n1 treatment2 y2 sd2 n2 treatment3 y3 sd3 n3
1 1 A 61.71 7.53 49 K 56.00 9.46 50 D 59 8 50
2 2 B 22.30 2.60 32 K 16.30 1.00 31 <NA> NA NA NA
3 3 C 98.41 4.70 46 K 94.85 8.81 44 <NA> NA NA NA
4 4 D 26.64 3.39 45 K 23.29 3.00 31 <NA> NA NA NA
5 5 B 91.76 2.73 52 K 89.02 2.41 50 <NA> NA NA NA
6 6 E 90.42 8.50 60 K 70.22 6.34 60 <NA> NA NA NA
7 7 A 92.80 3.20 54 K 85.00 2.60 54 <NA> NA NA NA
8 8 A 88.48 3.90 29 K 85.77 5.98 30 <NA> NA NA NA
9 9 D 88.46 1.54 25 K 78.76 1.08 25 <NA> NA NA NA
10 10 F 89.50 3.57 40 K 88.09 2.51 40 <NA> NA NA NA
- 輸入2:
netform<- pairwise(list(treatment1, treatment2,treatment3),
n=list(n1, n2,n3),
mean=list(y1, y2,y3),
sd=list(sd1, sd2,sd3),
data=mynet, studlab=study)
netform
This function transforms data that are given in wide or long arm-based format (e.g. input format for WinBUGS) to a contrast-based format that is needed as input to R function netmeta. The function
can transform data with binary, continuous, or generic outcomes as well as incidence rates from arm-based to contrast-based format.
- 結果2:
TE seTE studlab treat1 treat2 n1 mean1 sd1 n2 mean2 sd2 study treatment1 y1 sd1.orig n1.orig
1 5.71 1.7166809 1 A K 49 61.71 7.53 50 56.00 9.46 1 A 61.71 7.53 49
2 2.71 1.5611410 1 A D 49 61.71 7.53 50 59.00 8.00 1 A 61.71 7.53 49
3 -3.00 1.7520936 1 K D 50 56.00 9.46 50 59.00 8.00 1 A 61.71 7.53 49
4 6.00 0.4934654 2 B K 32 22.30 2.60 31 16.30 1.00 2 B 22.30 2.60 32
5 3.56 1.4980720 3 C K 46 98.41 4.70 44 94.85 8.81 3 C 98.41 4.70 46
6 3.35 0.7387168 4 D K 45 26.64 3.39 31 23.29 3.00 4 D 26.64 3.39 45
7 2.74 0.5093987 5 B K 52 91.76 2.73 50 89.02 2.41 5 B 91.76 2.73 52
8 20.20 1.3689753 6 E K 60 90.42 8.50 60 70.22 6.34 6 E 90.42 8.50 60
9 7.80 0.5610836 7 A K 54 92.80 3.20 54 85.00 2.60 7 A 92.80 3.20 54
10 2.71 1.3101512 8 A K 29 88.48 3.90 30 85.77 5.98 8 A 88.48 3.90 29
11 9.70 0.3761914 9 D K 25 88.46 1.54 25 78.76 1.08 9 D 88.46 1.54 25
12 1.41 0.6900181 10 F K 40 89.50 3.57 40 88.09 2.51 10 F 89.50 3.57 40
treatment2 y2 sd2.orig n2.orig treatment3 y3 sd3 n3
1 K 56.00 9.46 50 D 59 8 50
2 K 56.00 9.46 50 D 59 8 50
3 K 56.00 9.46 50 D 59 8 50
4 K 16.30 1.00 31 <NA> NA NA NA
5 K 94.85 8.81 44 <NA> NA NA NA
6 K 23.29 3.00 31 <NA> NA NA NA
7 K 89.02 2.41 50 <NA> NA NA NA
8 K 70.22 6.34 60 <NA> NA NA NA
9 K 85.00 2.60 54 <NA> NA NA NA
10 K 85.77 5.98 30 <NA> NA NA NA
11 K 78.76 1.08 25 <NA> NA NA NA
12 K 88.09 2.51 40 <NA> NA NA NA
- 輸入3:
netmeta <- netmeta(netform,sm="MD")
netmeta
- 結果3:
Original data (with adjusted standard errors for multi-arm studies):
treat1 treat2 TE seTE seTE.adj narms multiarm
1 A K 5.7100 1.7167 2.1366 3 *
1 A D 2.7100 1.5611 1.8068 3 *
1 D K 3.0000 1.7521 2.2471 3 *
2 B K 6.0000 0.4935 0.4935 2
3 C K 3.5600 1.4981 1.4981 2
4 D K 3.3500 0.7387 0.7387 2
5 B K 2.7400 0.5094 0.5094 2
6 E K 20.2000 1.3690 1.3690 2
7 A K 7.8000 0.5611 0.5611 2
8 A K 2.7100 1.3102 1.3102 2
9 D K 9.7000 0.3762 0.3762 2
10 F K 1.4100 0.6900 0.6900 2
Number of treatment arms (by study):
narms
1 3
10 2
2 2
3 2
4 2
5 2
6 2
7 2
8 2
9 2
Results (fixed effect model):
treat1 treat2 MD 95%-CI Q leverage
1 A K 7.2200 [ 6.2720; 8.1680] 0.50 0.05
1 A D -0.9324 [-2.0502; 0.1855] 4.06 0.10
1 D K 8.1523 [ 7.5124; 8.7922] 5.26 0.02
2 B K 4.4218 [ 3.7271; 5.1165] 10.23 0.52
3 C K 3.5600 [ 0.6238; 6.4962] 0.00 1.00
4 D K 8.1523 [ 7.5124; 8.7922] 42.26 0.20
5 B K 4.4218 [ 3.7271; 5.1165] 10.90 0.48
6 E K 20.2000 [17.5169; 22.8831] 0.00 1.00
7 A K 7.2200 [ 6.2720; 8.1680] 1.07 0.74
8 A K 7.2200 [ 6.2720; 8.1680] 11.85 0.14
9 D K 8.1523 [ 7.5124; 8.7922] 16.93 0.75
10 F K 1.4100 [ 0.0576; 2.7624] 0.00 1.00
Results (random effects model):
treat1 treat2 MD 95%-CI
1 A K 5.9719 [ 2.1452; 9.7985]
1 A D 0.6116 [-4.2239; 5.4472]
1 D K 5.3603 [ 1.5950; 9.1255]
2 B K 4.3712 [-0.2138; 8.9562]
3 C K 3.5600 [-3.4898; 10.6098]
4 D K 5.3603 [ 1.5950; 9.1255]
5 B K 4.3712 [-0.2138; 8.9562]
6 E K 20.2000 [13.2518; 27.1482]
7 A K 5.9719 [ 2.1452; 9.7985]
8 A K 5.9719 [ 2.1452; 9.7985]
9 D K 5.3603 [ 1.5950; 9.1255]
10 F K 1.4100 [-5.1404; 7.9604]
Number of studies: k = 10
Number of treatments: n = 7
Number of pairwise comparisons: m = 12
Number of designs: d = 7
Fixed effects model
Treatment estimate (sm = 'MD'):
A B C D E F K
A . 2.7982 3.6600 -0.9324 -12.9800 5.8100 7.2200
B -2.7982 . 0.8618 -3.7305 -15.7782 3.0118 4.4218
C -3.6600 -0.8618 . -4.5923 -16.6400 2.1500 3.5600
D 0.9324 3.7305 4.5923 . -12.0477 6.7423 8.1523
E 12.9800 15.7782 16.6400 12.0477 . 18.7900 20.2000
F -5.8100 -3.0118 -2.1500 -6.7423 -18.7900 . 1.4100
K -7.2200 -4.4218 -3.5600 -8.1523 -20.2000 -1.4100 .
Lower 95%-confidence limit:
A B C D E F K
A . 1.6229 0.5745 -2.0502 -15.8257 4.1584 6.2720
B -3.9734 . -2.1554 -4.6750 -18.5498 1.4914 3.7271
C -6.7454 -3.8790 . -7.5974 -20.6175 -1.0827 0.6238
D -0.1855 2.7860 1.5872 . -14.8061 5.2461 7.5124
E 10.1344 13.0066 12.6625 9.2893 . 15.7853 17.5169
F -7.4615 -4.5322 -5.3827 -8.2385 -21.7947 . 0.0576
K -8.1680 -5.1165 -6.4962 -8.7922 -22.8831 -2.7624 .
Upper 95%-confidence limit:
A B C D E F K
A . 3.9734 6.7454 0.1855 -10.1344 7.4615 8.1680
B -1.6229 . 3.8790 -2.7860 -13.0066 4.5322 5.1165
C -0.5745 2.1554 . -1.5872 -12.6625 5.3827 6.4962
D 2.0502 4.6750 7.5974 . -9.2893 8.2385 8.7922
E 15.8257 18.5498 20.6175 14.8061 . 21.7947 22.8831
F -4.1584 -1.4914 1.0827 -5.2461 -15.7853 . 2.7624
K -6.2720 -3.7271 -0.6238 -7.5124 -17.5169 -0.0576 .
Random effects model
Treatment estimate (sm = 'MD'):
A B C D E F K
A . 1.6007 2.4119 0.6116 -14.2281 4.5619 5.9719
B -1.6007 . 0.8112 -0.9891 -15.8288 2.9612 4.3712
C -2.4119 -0.8112 . -1.8003 -16.6400 2.1500 3.5600
D -0.6116 0.9891 1.8003 . -14.8397 3.9503 5.3603
E 14.2281 15.8288 16.6400 14.8397 . 18.7900 20.2000
F -4.5619 -2.9612 -2.1500 -3.9503 -18.7900 . 1.4100
K -5.9719 -4.3712 -3.5600 -5.3603 -20.2000 -1.4100 .
Lower 95%-confidence limit:
A B C D E F K
A . -4.3714 -5.6095 -4.2239 -22.1604 -3.0244 2.1452
B -7.5728 . -7.5985 -6.9220 -24.1535 -5.0345 -0.2138
C -10.4333 -9.2209 . -9.7925 -26.5384 -7.4733 -3.4898
D -5.4472 -4.9438 -6.1920 . -22.7426 -3.6052 1.5950
E 6.2958 7.5041 6.7416 6.9369 . 9.2409 13.2518
F -12.1481 -10.9568 -11.7733 -11.5057 -28.3391 . -5.1404
K -9.7985 -8.9562 -10.6098 -9.1255 -27.1482 -7.9604 .
Upper 95%-confidence limit:
A B C D E F K
A . 7.5728 10.4333 5.4472 -6.2958 12.1481 9.7985
B 4.3714 . 9.2209 4.9438 -7.5041 10.9568 8.9562
C 5.6095 7.5985 . 6.1920 -6.7416 11.7733 10.6098
D 4.2239 6.9220 9.7925 . -6.9369 11.5057 9.1255
E 22.1604 24.1535 26.5384 22.7426 . 28.3391 27.1482
F 3.0244 5.0345 7.4733 3.6052 -9.2409 . 7.9604
K -2.1452 0.2138 3.4898 -1.5950 -13.2518 5.1404 .
Quantifying heterogeneity / inconsistency:
tau^2 = 10.6936; I^2 = 95.1%
Tests of heterogeneity (within designs) and inconsistency (between designs):
Q d.f. p-value
Total 103.05 5 < 0.0001
Within designs 92.56 3 < 0.0001
Between designs 10.50 2 0.0053
- 輸入4:
print(netmeta,ref="K")
- 結果4:
Original data (with adjusted standard errors for multi-arm studies):
treat1 treat2 TE seTE seTE.adj narms multiarm
1 A K 5.7100 1.7167 2.1366 3 *
1 A D 2.7100 1.5611 1.8068 3 *
1 D K 3.0000 1.7521 2.2471 3 *
2 B K 6.0000 0.4935 0.4935 2
3 C K 3.5600 1.4981 1.4981 2
4 D K 3.3500 0.7387 0.7387 2
5 B K 2.7400 0.5094 0.5094 2
6 E K 20.2000 1.3690 1.3690 2
7 A K 7.8000 0.5611 0.5611 2
8 A K 2.7100 1.3102 1.3102 2
9 D K 9.7000 0.3762 0.3762 2
10 F K 1.4100 0.6900 0.6900 2
Number of treatment arms (by study):
narms
1 3
10 2
2 2
3 2
4 2
5 2
6 2
7 2
8 2
9 2
Results (fixed effect model):
treat1 treat2 MD 95%-CI Q leverage
1 A K 7.2200 [ 6.2720; 8.1680] 0.50 0.05
1 A D -0.9324 [-2.0502; 0.1855] 4.06 0.10
1 D K 8.1523 [ 7.5124; 8.7922] 5.26 0.02
2 B K 4.4218 [ 3.7271; 5.1165] 10.23 0.52
3 C K 3.5600 [ 0.6238; 6.4962] 0.00 1.00
4 D K 8.1523 [ 7.5124; 8.7922] 42.26 0.20
5 B K 4.4218 [ 3.7271; 5.1165] 10.90 0.48
6 E K 20.2000 [17.5169; 22.8831] 0.00 1.00
7 A K 7.2200 [ 6.2720; 8.1680] 1.07 0.74
8 A K 7.2200 [ 6.2720; 8.1680] 11.85 0.14
9 D K 8.1523 [ 7.5124; 8.7922] 16.93 0.75
10 F K 1.4100 [ 0.0576; 2.7624] 0.00 1.00
Results (random effects model):
treat1 treat2 MD 95%-CI
1 A K 5.9719 [ 2.1452; 9.7985]
1 A D 0.6116 [-4.2239; 5.4472]
1 D K 5.3603 [ 1.5950; 9.1255]
2 B K 4.3712 [-0.2138; 8.9562]
3 C K 3.5600 [-3.4898; 10.6098]
4 D K 5.3603 [ 1.5950; 9.1255]
5 B K 4.3712 [-0.2138; 8.9562]
6 E K 20.2000 [13.2518; 27.1482]
7 A K 5.9719 [ 2.1452; 9.7985]
8 A K 5.9719 [ 2.1452; 9.7985]
9 D K 5.3603 [ 1.5950; 9.1255]
10 F K 1.4100 [-5.1404; 7.9604]
Number of studies: k = 10
Number of treatments: n = 7
Number of pairwise comparisons: m = 12
Number of designs: d = 7
Fixed effects model
Treatment estimate (sm = 'MD', comparison: other treatments vs 'K'):
MD 95%-CI
A 7.2200 [ 6.2720; 8.1680]
B 4.4218 [ 3.7271; 5.1165]
C 3.5600 [ 0.6238; 6.4962]
D 8.1523 [ 7.5124; 8.7922]
E 20.2000 [17.5169; 22.8831]
F 1.4100 [ 0.0576; 2.7624]
K . .
Random effects model
Treatment estimate (sm = 'MD', comparison: other treatments vs 'K'):
MD 95%-CI
A 5.9719 [ 2.1452; 9.7985]
B 4.3712 [-0.2138; 8.9562]
C 3.5600 [-3.4898; 10.6098]
D 5.3603 [ 1.5950; 9.1255]
E 20.2000 [13.2518; 27.1482]
F 1.4100 [-5.1404; 7.9604]
K . .
Quantifying heterogeneity / inconsistency:
tau^2 = 10.6936; I^2 = 95.1%
Tests of heterogeneity (within designs) and inconsistency (between designs):
Q d.f. p-value
Total 103.05 5 < 0.0001
Within designs 92.56 3 < 0.0001
Between designs 10.50 2 0.0053
- 輸入5:
netgraph(netmeta, start="circle",points=T,cex.points=2, cex=1.5,
highlight="D:K" ,col.highlight = "green",col.multiarm = "purple")
- 結果5:
- 輸入6:
netr <- netrank(netmeta,small.values = "bad")
print(netr,sort=T)
- 結果6:
P-score (fixed) P-score (random)
E 1.0000 0.9998
A 0.6735 0.6500
D 0.8246 0.5909
B 0.4520 0.4970
C 0.3657 0.4235
F 0.1793 0.2500
K 0.0049 0.0887
If treatment i is better than many other treatments, many of these P-values will be small and the P-score will be large. Vice versa, if treatment i is worse than most other treatments,
the P-score is small.The P-score of treatment i can be interpreted as the mean extent of certainty that treatment i is better than another treatment. This interpretation is comparable to that of the Surface Under the CumulativeRAnking curve (SUCRA) which is the rank of treatment i within the range of treatments,measured on a scale from 0 (worst) to 1 (best) (Salanti et al. 2011).
- 輸入7:
forest(netmeta,ref="K",pooled="random",smlab="Random effects model",
xlab="Score difference" , leftlabs="Treatment",sortvar =Pscore)
- 結果7:
- 輸入8:
netheat(netmeta)
This function creates a net heat plot, a graphical tool for locating inconsistency in network metaanalyses.
- 結果8: