Calculates relative effects/mean differences at a particular time-point
get.relative.RdUses mbnma time-course parameter estimates to calculate treatment differences between treatments or classes at a particular time-point. Can be used to compare treatments evaluated in studies at different follow-up times, or even to compare treatments in different MBNMA models via a common comparator.
Arguments
- mbnma
An S3 object of class
"mbnma"generated by running a time-course MBNMA model- mbnma.add
An S3 object of
class("mbnma")generated by running a time-course MBNMA model. This should only be specified if results from two different MBNMA models are to be combined to perform a 2-stage MBNMA (see Details).- time
A numeric value for the time at which to estimate relative effects/mean differences.
- treats
A character vector of treatment names for which to calculate relative effects/mean differences. Must be a subset of
mbnma$network$treatments.- classes
A character vector of class names for which to calculate relative effects/mean differences. Must be a subset of
mbnma$network$classes. Only works for class effect models.- lim
Specifies calculation of either 95% credible intervals (
lim="cred") or 95% prediction intervals (lim="pred").
Value
An object of class "relative.array" list containing:
The time-point for which results are estimated
Matrices of posterior means, medians, SDs and upper and lower 95% credible intervals for the differences between each treatment
An array containing MCMC results for the differences between all treatments specified in
treatsor all classes specified inclasses.
Results are reported in tables as the row-defined treatment minus the column-defined treatment.
Details
get.relative() can also be used to perform a 2-stage MBNMA that allows synthesis of results
from two different MBNMA models via a single common comparator.
In an MBNMA model, all treatments must share the same time-course function. However, a 2-stage
approach can enable fitting of different time-course functions to different sets ("subnetworks") of
treatments. For example, some treatments may have rich time-course information,
allowing for a more complex time-course function to be used, whereas others may be sparse,
requiring a simpler time-course function.
Relative comparisons between treatments in the two datasets at specific follow-up times can then be estimated from MBNMA predicted effects versus a common comparator using the Bucher method and assuming consistency. See the MBNMAtime vignette for further details.
Examples
# \donttest{
# Create an mb.network object from a dataset
alognet <- mb.network(alog_pcfb)
#> Reference treatment is `placebo`
#> Studies reporting change from baseline automatically identified from the data
# Run a quadratic time-course MBNMA using the alogliptin dataset
mbnma <- mb.run(alognet,
fun=tpoly(degree=2,
pool.1="rel", method.1="random",
pool.2="rel", method.2="common"
)
)
#> Compiling model graph
#> Resolving undeclared variables
#> Allocating nodes
#> Graph information:
#> Observed stochastic nodes: 233
#> Unobserved stochastic nodes: 71
#> Total graph size: 4375
#>
#> Initializing model
#>
# Calculate differences between all treatments at 20 weeks follow-up
allres <- get.relative(mbnma, time=20)
# Calculate difference between a subset of treatments at 10 weeks follow-up
subres <- get.relative(mbnma, time=10,
treats=c("alog_50", "alog_25", "placebo"))
###########################
##### 2-stage MBNMA #####
###########################
# Using the osteoarthritis dataset
# With placebo (Pl_0) as common comparator between subnetworks
#### Sparse model ####
# Treatments on which time-course data is limited
sparse.trt <- c("Ce_100", "Ce_400", "Du_90", "Lu_200", "Lu_400",
"Lu_NA", "Et_5", "Ox_44")
# Create a subnetwork of studies comparing these treatments
sparse.df <- osteopain %>% dplyr::group_by(studyID) %>%
dplyr::filter(any(treatment %in% sparse.trt)) %>%
dplyr::ungroup() %>%
subset(treatment %in% c("Pl_0", sparse.trt))
sparse.net <- mb.network(sparse.df)
#> Reference treatment is `Pl_0`
#> Studies reporting change from baseline automatically identified from the data
# Run a ITP MBNMA with a known rate
sparse.mbnma <- mb.run(sparse.net, fun=titp(method.rate=0.8, pool.rate="abs"))
#> 'rate' parameters must take positive values.
#> Default half-normal prior restricts posterior to positive values.
#> Compiling model graph
#> Resolving undeclared variables
#> Allocating nodes
#> Graph information:
#> Observed stochastic nodes: 76
#> Unobserved stochastic nodes: 28
#> Total graph size: 1447
#>
#> Initializing model
#>
#### Complex model ####
# Treatments on which time-course data is rich
rich.trt <- levels(osteopain$treatment)[!levels(osteopain$treatment) %in%
c("Pl_0", "Ce_100", "Ce_400", "Du_90", "Lu_200",
"Lu_400", "Lu_NA", "Et_5", "Ox_44")]
# Create a subnetwork of studies comparing these treatments
rich.df <- osteopain %>% dplyr::group_by(studyID) %>%
dplyr::filter(any(treatment %in% rich.trt)) %>%
dplyr::ungroup() %>%
subset(treatment %in% c("Pl_0", rich.trt))
rich.net <- mb.network(rich.df)
#> Reference treatment is `Pl_0`
#> Studies reporting change from baseline automatically identified from the data
# Run a Emax MBNMA
rich.mbnma <- mb.run(rich.net, temax(p.expon = FALSE))
#> 'et50' parameters must take positive values.
#> Default half-normal prior restricts posterior to positive values.
#> Compiling model graph
#> Resolving undeclared variables
#> Allocating nodes
#> Graph information:
#> Observed stochastic nodes: 363
#> Unobserved stochastic nodes: 121
#> Total graph size: 7221
#>
#> Initializing model
#>
#### Calculate relative effects between models ####
# At 10 weeks follow-up
rels.sparse <- get.relative(sparse.mbnma, time=10)
rels.rich <- get.relative(rich.mbnma, time=10)
rels.all <- get.relative(mbnma=rich.mbnma,
mbnma.add=sparse.mbnma, time=10)
print(rels.all$median)
#> Pl_0 Ce_200 Et_10 Et_30 Et_60
#> Pl_0 NA 0.96123029 0.471824255 1.23319633 1.64623732
#> Ce_200 -0.961230289 NA -0.488517123 0.26982558 0.68759516
#> Et_10 -0.471824255 0.48851712 NA 0.75588620 1.17312804
#> Et_30 -1.233196329 -0.26982558 -0.755886204 NA 0.41611695
#> Et_60 -1.646237321 -0.68759516 -1.173128043 -0.41611695 NA
#> Et_90 -1.716362353 -0.75476445 -1.241835478 -0.48212480 -0.06783837
#> Lu_100 -0.921570119 0.03860348 -0.443375024 0.31097449 0.72461454
#> Na_1000 -1.197453836 -0.23725884 -0.719664349 0.03474327 0.44923152
#> Na_1500 -1.126654188 -0.16746178 -0.654274437 0.10544342 0.52060234
#> Na_250 -0.003032188 0.95836525 0.469475442 1.22358117 1.64271052
#> Na_750 -0.874496903 0.08494509 -0.403621370 0.35594649 0.77189792
#> Ro_12 -0.943590417 0.01719680 -0.476880851 0.28704083 0.70226061
#> Ro_125 -2.353032604 -1.39801167 -1.882358979 -1.11874502 -0.70618140
#> Ro_25 -1.296648992 -0.33759680 -0.827353799 -0.06224436 0.35093433
#> Tr_100 -0.481067261 0.47910874 -0.005954795 0.74866247 1.16696930
#> Tr_200 -0.486750052 0.47275291 -0.011930021 0.74700398 1.16123830
#> Tr_300 -0.836699813 0.12318711 -0.360746697 0.39638833 0.80837979
#> Tr_400 -0.929274743 0.03244039 -0.447945878 0.30212079 0.71797980
#> Va_10 -0.751112284 0.20850862 -0.278066165 0.48066599 0.89470222
#> Va_20 -0.986406307 -0.02670413 -0.512335464 0.24378099 0.65924194
#> Va_5 -0.848454607 0.11294666 -0.370686801 0.38404211 0.80020365
#> Ce_100 -0.547106413 0.41449631 -0.074631536 0.68483948 1.10181849
#> Ce_400 -0.897424671 0.06267434 -0.422618293 0.33357910 0.74999365
#> Du_90 -0.552811878 0.40389292 -0.081354946 0.67430175 1.09407891
#> Et_5 -1.025098312 -0.06400784 -0.544759471 0.21206723 0.62506850
#> Lu_200 -0.549618629 0.41398278 -0.070557690 0.68546477 1.09721591
#> Lu_400 -0.708309357 0.25195628 -0.235739750 0.52457511 0.93798481
#> Lu_NA -0.802650389 0.15844761 -0.327192887 0.43291457 0.84677715
#> Ox_44 -1.079915915 -0.11889661 -0.603250023 0.15346238 0.56631037
#> Et_90 Lu_100 Na_1000 Na_1500 Na_250
#> Pl_0 1.71636235 0.921570119 1.19745384 1.12665419 0.003032188
#> Ce_200 0.75476445 -0.038603477 0.23725884 0.16746178 -0.958365253
#> Et_10 1.24183548 0.443375024 0.71966435 0.65427444 -0.469475442
#> Et_30 0.48212480 -0.310974494 -0.03474327 -0.10544342 -1.223581166
#> Et_60 0.06783837 -0.724614543 -0.44923152 -0.52060234 -1.642710521
#> Et_90 NA -0.797802086 -0.51402985 -0.58599228 -1.710025060
#> Lu_100 0.79780209 NA 0.27550715 0.20587285 -0.915216562
#> Na_1000 0.51402985 -0.275507148 NA -0.07114274 -1.194420135
#> Na_1500 0.58599228 -0.205872850 0.07114274 NA -1.122800276
#> Na_250 1.71002506 0.915216562 1.19442013 1.12280028 NA
#> Na_750 0.83716098 0.044133277 0.32463364 0.25342193 -0.868361852
#> Ro_12 0.76711491 -0.025583439 0.25103835 0.18327573 -0.944701044
#> Ro_125 -0.63823496 -1.432027415 -1.15981304 -1.22479209 -2.346802059
#> Ro_25 0.41736819 -0.379130973 -0.09951430 -0.16951357 -1.292917581
#> Tr_100 1.23523909 0.443738549 0.71869238 0.64781728 -0.477064565
#> Tr_200 1.23429743 0.434111821 0.70940069 0.64031888 -0.485990848
#> Tr_300 0.87738019 0.081739369 0.35914804 0.29059413 -0.833703924
#> Tr_400 0.78892114 -0.009496508 0.26815546 0.19561253 -0.925566963
#> Va_10 0.96091717 0.167964294 0.44467588 0.37928440 -0.747935162
#> Va_20 0.73026156 -0.065113366 0.21155204 0.14058846 -0.984487231
#> Va_5 0.86727634 0.072025782 0.35267714 0.27971273 -0.836692056
#> Ce_100 1.17082841 0.372070523 0.64948284 0.57861483 -0.541728215
#> Ce_400 0.81903089 0.024804064 0.30103037 0.23211700 -0.893281214
#> Du_90 1.16451948 0.362503490 0.64080736 0.57007372 -0.539676241
#> Et_5 0.69696300 -0.098412576 0.17241286 0.10376843 -1.020921221
#> Lu_200 1.17069258 0.372039153 0.65067936 0.57667359 -0.546292701
#> Lu_400 1.00953340 0.211598888 0.48852777 0.41938376 -0.706234304
#> Lu_NA 0.91372396 0.122095553 0.39563905 0.32391405 -0.795069568
#> Ox_44 0.64125547 -0.157875662 0.11780511 0.05204645 -1.064119094
#> Na_750 Ro_12 Ro_125 Ro_25 Tr_100 Tr_200
#> Pl_0 0.87449690 0.94359042 2.3530326 1.29664899 0.481067261 0.486750052
#> Ce_200 -0.08494509 -0.01719680 1.3980117 0.33759680 -0.479108738 -0.472752908
#> Et_10 0.40362137 0.47688085 1.8823590 0.82735380 0.005954795 0.011930021
#> Et_30 -0.35594649 -0.28704083 1.1187450 0.06224436 -0.748662468 -0.747003982
#> Et_60 -0.77189792 -0.70226061 0.7061814 -0.35093433 -1.166969298 -1.161238302
#> Et_90 -0.83716098 -0.76711491 0.6382350 -0.41736819 -1.235239093 -1.234297431
#> Lu_100 -0.04413328 0.02558344 1.4320274 0.37913097 -0.443738549 -0.434111821
#> Na_1000 -0.32463364 -0.25103835 1.1598130 0.09951430 -0.718692383 -0.709400693
#> Na_1500 -0.25342193 -0.18327573 1.2247921 0.16951357 -0.647817280 -0.640318884
#> Na_250 0.86836185 0.94470104 2.3468021 1.29291758 0.477064565 0.485990848
#> Na_750 NA 0.06770470 1.4763742 0.42260337 -0.393336137 -0.390585582
#> Ro_12 -0.06770470 NA 1.4114676 0.35043929 -0.461710201 -0.460541327
#> Ro_125 -1.47637425 -1.41146762 NA -1.05223263 -1.873857069 -1.869730802
#> Ro_25 -0.42260337 -0.35043929 1.0522326 NA -0.817448634 -0.807190978
#> Tr_100 0.39333614 0.46171020 1.8738571 0.81744863 NA 0.007315778
#> Tr_200 0.39058558 0.46054133 1.8697308 0.80719098 -0.007315778 NA
#> Tr_300 0.04143359 0.10508936 1.5206254 0.45961240 -0.360353987 -0.351603146
#> Tr_400 -0.05256320 0.01575607 1.4248139 0.36907471 -0.453253902 -0.443688413
#> Va_10 0.12405536 0.18996765 1.6026502 0.54665644 -0.271494727 -0.268516655
#> Va_20 -0.11053463 -0.03950858 1.3708468 0.31140162 -0.505675234 -0.502728699
#> Va_5 0.02483031 0.09838481 1.5097411 0.44840514 -0.368181687 -0.362087309
#> Ce_100 0.32737955 0.39931514 1.8049612 0.75273408 -0.059583027 -0.060639860
#> Ce_400 -0.02289000 0.04807935 1.4582167 0.39923424 -0.417705607 -0.410449526
#> Du_90 0.32018043 0.39382317 1.7977575 0.74098845 -0.077752305 -0.070285866
#> Et_5 -0.14931909 -0.07746782 1.3382208 0.27547137 -0.541107043 -0.534361407
#> Lu_200 0.32796787 0.39883299 1.8072783 0.74409038 -0.066117326 -0.059863714
#> Lu_400 0.16657322 0.23772193 1.6496523 0.58685029 -0.226375951 -0.221790385
#> Lu_NA 0.07347024 0.14730453 1.5578680 0.50149382 -0.322898387 -0.311306790
#> Ox_44 -0.20233737 -0.13258368 1.2757510 0.21797916 -0.599951357 -0.589582307
#> Tr_300 Tr_400 Va_10 Va_20 Va_5
#> Pl_0 0.83669981 0.929274743 0.75111228 0.98640631 0.84845461
#> Ce_200 -0.12318711 -0.032440391 -0.20850862 0.02670413 -0.11294666
#> Et_10 0.36074670 0.447945878 0.27806617 0.51233546 0.37068680
#> Et_30 -0.39638833 -0.302120790 -0.48066599 -0.24378099 -0.38404211
#> Et_60 -0.80837979 -0.717979799 -0.89470222 -0.65924194 -0.80020365
#> Et_90 -0.87738019 -0.788921139 -0.96091717 -0.73026156 -0.86727634
#> Lu_100 -0.08173937 0.009496508 -0.16796429 0.06511337 -0.07202578
#> Na_1000 -0.35914804 -0.268155459 -0.44467588 -0.21155204 -0.35267714
#> Na_1500 -0.29059413 -0.195612534 -0.37928440 -0.14058846 -0.27971273
#> Na_250 0.83370392 0.925566963 0.74793516 0.98448723 0.83669206
#> Na_750 -0.04143359 0.052563201 -0.12405536 0.11053463 -0.02483031
#> Ro_12 -0.10508936 -0.015756068 -0.18996765 0.03950858 -0.09838481
#> Ro_125 -1.52062543 -1.424813944 -1.60265025 -1.37084684 -1.50974110
#> Ro_25 -0.45961240 -0.369074705 -0.54665644 -0.31140162 -0.44840514
#> Tr_100 0.36035399 0.453253902 0.27149473 0.50567523 0.36818169
#> Tr_200 0.35160315 0.443688413 0.26851665 0.50272870 0.36208731
#> Tr_300 NA 0.093492865 -0.08408585 0.15096290 0.01074313
#> Tr_400 -0.09349286 NA -0.17758714 0.05665666 -0.08408023
#> Va_10 0.08408585 0.177587144 NA 0.23133167 0.09413802
#> Va_20 -0.15096290 -0.056656661 -0.23133167 NA -0.14034682
#> Va_5 -0.01074313 0.084080230 -0.09413802 0.14034682 NA
#> Ce_100 0.28961783 0.381469713 0.20730379 0.44065038 0.29821155
#> Ce_400 -0.05933164 0.036018024 -0.14504796 0.09506830 -0.04959564
#> Du_90 0.28333576 0.369364162 0.19457681 0.43118524 0.28752883
#> Et_5 -0.18835847 -0.091972241 -0.27174241 -0.03273060 -0.17604840
#> Lu_200 0.28861172 0.380582149 0.20477754 0.43851606 0.29935189
#> Lu_400 0.13014269 0.220541837 0.04578331 0.27971515 0.14364253
#> Lu_NA 0.03571013 0.129221682 -0.04459420 0.18651536 0.05119809
#> Ox_44 -0.24289678 -0.145567985 -0.32438859 -0.09361271 -0.22388013
#> Ce_100 Ce_400 Du_90 Et_5 Lu_200
#> Pl_0 0.5471064134 0.89742467 0.55281188 1.02509831 0.5496186285
#> Ce_200 -0.4144963086 -0.06267434 -0.40389292 0.06400784 -0.4139827810
#> Et_10 0.0746315360 0.42261829 0.08135495 0.54475947 0.0705576897
#> Et_30 -0.6848394773 -0.33357910 -0.67430175 -0.21206723 -0.6854647680
#> Et_60 -1.1018184913 -0.74999365 -1.09407891 -0.62506850 -1.0972159134
#> Et_90 -1.1708284070 -0.81903089 -1.16451948 -0.69696300 -1.1706925791
#> Lu_100 -0.3720705230 -0.02480406 -0.36250349 0.09841258 -0.3720391532
#> Na_1000 -0.6494828362 -0.30103037 -0.64080736 -0.17241286 -0.6506793612
#> Na_1500 -0.5786148283 -0.23211700 -0.57007372 -0.10376843 -0.5766735945
#> Na_250 0.5417282154 0.89328121 0.53967624 1.02092122 0.5462927013
#> Na_750 -0.3273795521 0.02289000 -0.32018043 0.14931909 -0.3279678728
#> Ro_12 -0.3993151362 -0.04807935 -0.39382317 0.07746782 -0.3988329881
#> Ro_125 -1.8049612471 -1.45821667 -1.79775750 -1.33822079 -1.8072782968
#> Ro_25 -0.7527340771 -0.39923424 -0.74098845 -0.27547137 -0.7440903828
#> Tr_100 0.0595830269 0.41770561 0.07775230 0.54110704 0.0661173265
#> Tr_200 0.0606398601 0.41044953 0.07028587 0.53436141 0.0598637140
#> Tr_300 -0.2896178289 0.05933164 -0.28333576 0.18835847 -0.2886117239
#> Tr_400 -0.3814697131 -0.03601802 -0.36936416 0.09197224 -0.3805821487
#> Va_10 -0.2073037901 0.14504796 -0.19457681 0.27174241 -0.2047775402
#> Va_20 -0.4406503770 -0.09506830 -0.43118524 0.03273060 -0.4385160640
#> Va_5 -0.2982115464 0.04959564 -0.28752883 0.17604840 -0.2993518916
#> Ce_100 NA 0.34934662 0.01204673 0.47579115 0.0005361338
#> Ce_400 -0.3493466199 NA -0.34070631 0.12561124 -0.3468269829
#> Du_90 -0.0120467292 0.34070631 NA 0.46767401 -0.0116532607
#> Et_5 -0.4757911469 -0.12561124 -0.46767401 NA -0.4773959555
#> Lu_200 -0.0005361338 0.34682698 0.01165326 0.47739596 NA
#> Lu_400 -0.1609931616 0.18667968 -0.15447625 0.31806650 -0.1600469743
#> Lu_NA -0.2539695132 0.09576022 -0.24641676 0.22634335 -0.2538215647
#> Ox_44 -0.5301091349 -0.18620085 -0.51619939 -0.05859579 -0.5342164816
#> Lu_400 Lu_NA Ox_44
#> Pl_0 0.70830936 0.80265039 1.07991591
#> Ce_200 -0.25195628 -0.15844761 0.11889661
#> Et_10 0.23573975 0.32719289 0.60325002
#> Et_30 -0.52457511 -0.43291457 -0.15346238
#> Et_60 -0.93798481 -0.84677715 -0.56631037
#> Et_90 -1.00953340 -0.91372396 -0.64125547
#> Lu_100 -0.21159889 -0.12209555 0.15787566
#> Na_1000 -0.48852777 -0.39563905 -0.11780511
#> Na_1500 -0.41938376 -0.32391405 -0.05204645
#> Na_250 0.70623430 0.79506957 1.06411909
#> Na_750 -0.16657322 -0.07347024 0.20233737
#> Ro_12 -0.23772193 -0.14730453 0.13258368
#> Ro_125 -1.64965233 -1.55786803 -1.27575098
#> Ro_25 -0.58685029 -0.50149382 -0.21797916
#> Tr_100 0.22637595 0.32289839 0.59995136
#> Tr_200 0.22179038 0.31130679 0.58958231
#> Tr_300 -0.13014269 -0.03571013 0.24289678
#> Tr_400 -0.22054184 -0.12922168 0.14556798
#> Va_10 -0.04578331 0.04459420 0.32438859
#> Va_20 -0.27971515 -0.18651536 0.09361271
#> Va_5 -0.14364253 -0.05119809 0.22388013
#> Ce_100 0.16099316 0.25396951 0.53010913
#> Ce_400 -0.18667968 -0.09576022 0.18620085
#> Du_90 0.15447625 0.24641676 0.51619939
#> Et_5 -0.31806650 -0.22634335 0.05859579
#> Lu_200 0.16004697 0.25382156 0.53421648
#> Lu_400 NA 0.09325759 0.37303765
#> Lu_NA -0.09325759 NA 0.27232008
#> Ox_44 -0.37303765 -0.27232008 NA
# }