SetMetrics {rankinma} | R Documentation |
Setup data of treatment ranking metrics for rankinma
Description
SetMetrics() is a function for checking and preparing data set of metrics for further ploting in rankinma.
Usage
SetMetrics(
data,
outcome = NULL,
tx = NULL,
metrics = NULL,
metrics.name = NULL,
trans = 0.8
)
Arguments
data |
DATAFRAME of treatment, metrics, and name of outcomes. |
outcome |
VARIABLE string data for of outcome(s). |
tx |
VARIABLE with string data for treatments. |
metrics |
VARIABLE with numeric data for global metrics, but it should be "NULL" when using "Probabilities" as metrics. |
metrics.name |
STRING for metrics of treatment ranking in terms of "SUCRA","P-score", and "P-best" for the value of surface under the cumulative ranking curve, P-score, and probability of achieving the best treatment. |
trans |
NUMERIC for indicating transparency of colors of treatments. |
Value
SetMetrics() returns a confirmed data.frame of treatment, metrics of treatment ranking, and outcome name.
metrics.name |
A string shows type of metrics of treatment ranking. |
ls.outcome |
Strings list outcomes. |
ls.tx |
Strings list treatments. |
n.outcome |
An integer shows numbers of outcomes. |
n.tx |
An integer shows numbers of treatments. |
data |
A data frame consists of seven columns of core information among all outcomes. |
data.sets |
A list shows data frame of core information by each outcome. |
ptrn.tx |
A data frame shows treatments on each outcome. |
ptrn.outcome |
A data frame shows outcomes by treatments. |
color.txs |
A data frame shows color of each treatment. |
trans |
A numeric value shows transparency for colors of each treatment. |
See Also
Examples
## Not run:
#library(netmeta)
#data(Senn2013)
#nma <- netmeta(TE, seTE, treat1, treat2,
#studlab, data = Senn2013, sm = "SMD")
# Get SUCRA
#nma.1 <- GetMetrics(nma, outcome = "HbA1c.random", prefer = "small", metrics = "SUCRA",
#model = "random", simt = 1000)
#nma.2 <- GetMetrics(nma, outcome = "HbA1c.common", prefer = "small", metrics = "SUCRA",
#model = "common", simt = 1000)
# Combine metrics of multiple outcomes
#dataMetrics <- rbind(nma.1, nma.2)
# Set data for rankinma
#dataRankinma <- SetMetrics(dataMetrics, tx = tx, outcome = outcome,
#metrics = SUCRA, metrics.name = "SUCRA")
## End(Not run)