Update model fit statistics depending on calculation for pD

changepd(model, jagsdata = NULL, pd = "pv", likelihood = NULL, type = "dose")

Arguments

model

A model object of class "rjags"

jagsdata

A list object containing data used to estimate model

pd

Can take either:

  • pv only pV will be reported (as automatically outputted by R2jags).

  • plugin calculates pD by the plug-in method (Spiegelhalter et al. 2002) . It is faster, but may output negative non-sensical values, due to skewed deviances that can arise with non-linear models.

  • pd.kl calculates pD by the Kullback-Leibler divergence (Plummer 2008) . This will require running the model for additional iterations but is a more robust calculation for the effective number of parameters in non-linear models.

  • popt calculates pD using an optimism adjustment which allows for calculation of the penalized expected deviance (Plummer 2008) .

likelihood

A string indicating the likelihood to use in the model. Can take either "binomial", "normal" or "poisson". If left as NULL the likelihood will be inferred from the data.

type

Can take either "dose" for a dose-response MBNMA or "time" for a time-course MBNMA (this accounts for multiple observations within an arm)

Value

A list containing pd (effective number of parameters calculated using the method specified in arguments), deviance (the posterior median of the total residual deviance) and dic (the model DIC)