Create a dataset with a single time point from each study closest to specified time
get.closest.time.Rd
Takes the closest time point from each arm in each study to a specified time (t) within an
mb.network
object. Useful for network plots or exploring standard NMA.
Usage
get.closest.time(network, t = stats::median(network$data.ab$time))
Value
A data frame in long format of responses at the closest time point to t in each arm of each study.
Examples
# Using the alogliptin dataset
network <- mb.network(alog_pcfb)
#> Reference treatment is `placebo`
#> Studies reporting change from baseline automatically identified from the data
# Take a single follow-up time from each study...
# ...closest to 7
get.closest.time(network, t=7)
#> # A tibble: 46 × 13
#> # Groups: studyID, arm [46]
#> studyID time treatment narm arm y se n clinicaltrialGov_ID
#> <dbl> <dbl> <dbl> <int> <int> <dbl> <dbl> <dbl> <chr>
#> 1 1 2 1 5 1 0 0.0216 75 NCT01263470
#> 2 1 2 2 5 2 -0.16 0.0172 79 NCT01263470
#> 3 1 2 3 5 3 -0.17 0.0212 84 NCT01263470
#> 4 1 2 4 5 4 -0.16 0.0210 79 NCT01263470
#> 5 1 2 5 5 5 -0.15 0.0203 79 NCT01263470
#> 6 2 4 1 3 1 -0.11 0.052 63 NCT00286455
#> 7 2 4 3 3 2 -0.37 0.035 131 NCT00286455
#> 8 2 4 4 3 3 -0.45 0.036 128 NCT00286455
#> 9 3 12 2 4 1 -0.55 0.0726 93 NCT01263496
#> 10 3 12 3 4 2 -0.7 0.0548 97 NCT01263496
#> # ℹ 36 more rows
#> # ℹ 4 more variables: agent <chr>, dose <dbl>, fupcount <int>, fups <int>
# ...closest to 20
get.closest.time(network, t=7)
#> # A tibble: 46 × 13
#> # Groups: studyID, arm [46]
#> studyID time treatment narm arm y se n clinicaltrialGov_ID
#> <dbl> <dbl> <dbl> <int> <int> <dbl> <dbl> <dbl> <chr>
#> 1 1 2 1 5 1 0 0.0216 75 NCT01263470
#> 2 1 2 2 5 2 -0.16 0.0172 79 NCT01263470
#> 3 1 2 3 5 3 -0.17 0.0212 84 NCT01263470
#> 4 1 2 4 5 4 -0.16 0.0210 79 NCT01263470
#> 5 1 2 5 5 5 -0.15 0.0203 79 NCT01263470
#> 6 2 4 1 3 1 -0.11 0.052 63 NCT00286455
#> 7 2 4 3 3 2 -0.37 0.035 131 NCT00286455
#> 8 2 4 4 3 3 -0.45 0.036 128 NCT00286455
#> 9 3 12 2 4 1 -0.55 0.0726 93 NCT01263496
#> 10 3 12 3 4 2 -0.7 0.0548 97 NCT01263496
#> # ℹ 36 more rows
#> # ℹ 4 more variables: agent <chr>, dose <dbl>, fupcount <int>, fups <int>
# ...closest to the median follow-up across all studies
get.closest.time(network, t=26)
#> # A tibble: 46 × 13
#> # Groups: studyID, arm [46]
#> studyID time treatment narm arm y se n clinicaltrialGov_ID
#> <dbl> <dbl> <dbl> <int> <int> <dbl> <dbl> <dbl> <chr>
#> 1 1 2 1 5 1 0 0.0216 75 NCT01263470
#> 2 1 2 2 5 2 -0.16 0.0172 79 NCT01263470
#> 3 1 2 3 5 3 -0.17 0.0212 84 NCT01263470
#> 4 1 2 4 5 4 -0.16 0.0210 79 NCT01263470
#> 5 1 2 5 5 5 -0.15 0.0203 79 NCT01263470
#> 6 2 4 1 3 1 -0.11 0.052 63 NCT00286455
#> 7 2 4 3 3 2 -0.37 0.035 131 NCT00286455
#> 8 2 4 4 3 3 -0.45 0.036 128 NCT00286455
#> 9 3 12 2 4 1 -0.55 0.0726 93 NCT01263496
#> 10 3 12 3 4 2 -0.7 0.0548 97 NCT01263496
#> # ℹ 36 more rows
#> # ℹ 4 more variables: agent <chr>, dose <dbl>, fupcount <int>, fups <int>