View source: R/run.functions.R
pDcalc | R Documentation |
Uses results from MBNMA JAGS models to calculate pD via the plugin method \insertCitespiegelhalter2002MBNMAtime. Can only be used for models with known standard errors or covariance matrices (typically univariate).
pDcalc(
obs1,
obs2,
fups = NULL,
narm,
NS,
theta.result,
resdev.result,
likelihood = "normal",
type = "time"
)
obs1 |
A matrix (study x arm) or array (study x arm x time point) containing
observed data for |
obs2 |
A matrix (study x arm) or array (study x arm x time point) containing
observed data for |
fups |
A numeric vector of length equal to the number of studies,
containing the number of follow-up mean responses reported in each study. Required for
time-course MBNMA models (if |
narm |
A numeric vector of length equal to the number of studies, containing the number of arms in each study. |
NS |
A single number equal to the number of studies in the dataset. |
theta.result |
A matrix (study x arm) or array (study x arm x time point) containing the posterior mean predicted means/probabilities/rate in each arm of each study. This will be estimated by the JAGS model. |
resdev.result |
A matrix (study x arm) or array (study x arm x time point) containing the posterior mean residual deviance contributions in each arm of each study. This will be estimated by the JAGS model. |
likelihood |
A character object of any of the following likelihoods:
|
type |
The type of MBNMA model fitted. Can be either |
For non-linear time-course MBNMA models residual deviance contributions may be skewed, which
can lead to non-sensical results when calculating pD via the plugin method.
Therefore, alternative approaches are implented here using either pV (pD=FALSE
) as an
approximation or pD calculated by Kullback–Leibler
divergence (pD=TRUE
) \insertCiteplummer2008MBNMAtime.
A numeric value for the effective number of parameters, pD, calculated via the plugin method
## Not run:
# Using the alogliptin dataset
network <- mb.network(alog_pcfb)
# Run Emax model saving predicted means and residual deviance contributions
emax <- mb.run(network, fun=temax(),
parameters.to.save=c("theta", "resdev"), intercept=FALSE)
# Get matrices of observed data
jagsdat <- getjagsdata(network$data.ab)
# Plugin estimation of pD is problematic with non-linear models as it often leads to
#negative values, hence use of pV of pD calculated via Kullback-Liebler divergence as
#other measures for the effective number of parameters
pDcalc(obs1=jagsdat$y, obs2=jagsdat$se,
fups=jagsdat$fups, narm=jagsdat$narm, NS=jagsdat$NS,
theta.result = emax$BUGSoutput$mean$theta,
resdev.result = emax$BUGSoutput$mean$resdev
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.