getjagsdata | R Documentation |
Converts MBNMA data frame to a list for use in JAGS model
getjagsdata(
data.ab,
class = FALSE,
sdscale = FALSE,
regress = NULL,
regress.effect = "common",
likelihood = check.likelink(data.ab)$likelihood,
link = check.likelink(data.ab)$link,
level = "agent",
fun = NULL,
nodesplit = NULL
)
data.ab |
A data frame of arm-level data in "long" format containing the columns:
|
class |
A boolean object indicating whether or not |
sdscale |
Logical object to indicate whether to write a model that specifies a reference SD
for standardising when modelling using Standardised Mean Differences. Specifying |
regress |
A formula of effect modifiers (variables that
interact with the treatment effect) to incorporate using Network Meta-Regression
(E.g. |
regress.effect |
Indicates whether effect modification should be assumed to be
|
likelihood |
A string indicating the likelihood to use in the model. Can take either |
link |
A string indicating the link function to use in the model. Can take any link function
defined within JAGS (e.g. |
level |
Can take either |
fun |
An object of |
nodesplit |
A numeric vector of length 2 containing treatment codes on which to perform
an MBNMA nodesplit (see |
A named list of numbers, vector, matrices and arrays to be sent to JAGS. List elements are:
If likelihood="normal"
:
y
An array of mean responses for each arm within each study
se
An array of standard errors for each arm within each study
If likelihood="binomial"
:
r
An array of the number of responses/count for each each arm within each study
n
An array of the number of participants for each arm within each study
If likelihood="poisson"
:
r
An array of the number of responses/count for each each arm within each study
E
An array of the total exposure time for each arm within each study
dose
A matrix of doses for each arm within each study (if level="agent"
)
narm
A numeric vector with the number of arms per study
NS
The total number of studies in the dataset
Nagent
The total number of agents in the dataset (if level="agent"
)
agent
A matrix of agent codes within each study (if level="agent"
)
NT
The total number of treatment in the dataset (if level="treatment"
)
treatment
A matrix of treatment codes within each study (if level="treatment"
)
Nclass
Optional. The total number of classes in the dataset
class
Optional. A matrix of class codes within each study
classkey
Optional. A vector of class codes that correspond to agent codes.
Same length as the number of agent codes.
split.ind
Optional. A matrix indicating whether a specific arm contributes evidence
to a nodesplit comparison.
# Using the triptans headache dataset
network <- mbnma.network(triptans)
jagsdat <- getjagsdata(network$data.ab, likelihood="binomial", link="logit")
# Get JAGS data with class
netclass <- mbnma.network(osteopain)
jagsdat <- getjagsdata(netclass$data.ab, class=TRUE)
# Get JAGS data at the treatment level for split Network Meta-Analysis
network <- mbnma.network(triptans)
jagsdat <- getjagsdata(network$data.ab, level="treatment")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.