| pattern | R Documentation |
Full Bayesian cost-effectiveness models to handle missing data in the outcomes under different missing data
mechanism assumptions, using alternative parametric distributions for the effect and cost variables and
using a pattern mixture model approach to identify the model. The analysis is performed using the BUGS language,
which is implemented in the software JAGS using the function jags The output is stored in an object of class 'missingHE'.
pattern(
data,
model.eff,
model.cost,
dist_e,
dist_c,
type,
restriction = "CC",
prob = c(0.025, 0.975),
n.chains = 2,
n.iter = 10000,
n.burnin = floor(n.iter/2),
inits = NULL,
n.thin = 1,
save_model = FALSE,
prior = "default",
center = FALSE,
...
)
data |
A data frame in which to find the variables supplied in |
model.eff |
A formula expression in conventional |
model.cost |
A formula expression in conventional |
dist_e |
Distribution assumed for the effects. Current available choices are: Normal ('norm'), Beta ('beta'), Gamma ('gamma'), Exponential ('exp'), Weibull ('weib'), Logistic ('logis'), Poisson ('pois'), Negative Binomial ('negbin') or Bernoulli ('bern'). |
dist_c |
Distribution assumed for the costs. Current available choices are: Normal ('norm'), Gamma ('gamma') or LogNormal ('lnorm'). |
type |
Type of missingness mechanism assumed. Choices are Missing At Random (MAR) and Missing Not At Random (MNAR). |
restriction |
type of identifying restriction to be imposed to identify the distributions of the missing data in each pattern. Available choices are: complete case restrcition ('CC') - default - or available case restriction ('AC'). |
prob |
A numeric vector of probabilities within the range (0, 1), representing the upper and lower CI sample quantiles to be calculated and returned for the imputed values. |
n.chains |
Number of chains. |
n.iter |
Number of iterations. |
n.burnin |
Number of warmup iterations. |
inits |
A list with elements equal to the number of chains selected; each element of the list is itself a list of starting values for the
|
n.thin |
Thinning interval. |
save_model |
Logical. If |
prior |
A list containing the hyperprior values provided by the user. Each element of this list must be a vector
containing the user-provided prior distribution and parameter values and must be named with the name of the corresponding parameter. For example, the hyperprior
values for the standard deviation parameter for the effects can be provided using the list |
center |
Logical. If |
... |
Additional arguments that can be provided by the user. Examples are the additional arguments that can be provided to the function |
Depending on the distributions specified for the outcome variables in the arguments dist_e and
dist_c and the type of missingness mechanism specified in the argument type, different pattern mixture models
are built and run in the background by the function pattern. The model for the outcomes is fitted in each missingness pattern
and the parameters indexing the missing data distributions are identified using: the corresponding parameters identified from the observed data
in other patterns (under 'MAR'); or a combination of the parameters identified by the observed data and some sensitivity parameters (under 'MNAR').
A simple example can be used to show how pattern mixture models are specified.
Consider a data set comprising a response variable y and a set of centered covariates X_j. We denote with d_i the patterns' indicator variable for each
subject in the trial i = 1, ..., n such that: d_i = 1 indicates the completers (both e and c observed), d_i = 2 and d_i = 3 indicate that
only the costs or effects are observed, respectively, while d_i = 4 indicates that neither of the two outcomes is observed. d_i is assigned a multinomial distribution,
which probabilities are modelled using a Dirichlet prior. Next, the outcomes model is fitted in each pattern and parameters that cannot be identified in each pattern (d = 2, 3, 4),
e.g. mu_e[d] and mu_c[d], are identified using some restrictions based on the parameters estimated from other patterns. Two choices are currently available: the complete cases ('CC') or available cases ('AC').
For example, using the 'CC' restriction, the parameters indexing the distributions of the missing data are identified as:
mu_e[2] = \mu_e[4] = \mu_e[1] + \delta_e
mu_c[3] = \mu_c[4] = \mu_c[1] + \delta_c
where
\mu_e[1] is the effects mean for the completers.
\mu_c[1] is the costs mean for the completers.
\delta_e is the sensitivity parameters associated with the marginal effects mean.
\delta_c is the sensitivity parameters associated with the marginal costs mean.
If the 'AC' restriction is chosen, only the parameters estimated from the observed data in pattern 2 (costs) and pattern 3 (effects) are used to identify those in the other patterns.
When \delta_e = 0 and \delta_c = 0 the model assumes a 'MAR' mechanism. When \delta_e != 0 and/or \delta_c != 0 'MNAR' departures for the
effects and/or costs are explored with priors on sensitivity parameters that must be provided by the user (see Arguments).
When user-defined hyperprior values are supplied via the argument prior in the function pattern, the elements of this list (see Arguments)
must be vectors containing the user-provided distribution name and hyperprior values and must take specific names according to the parameters they are associated with.
Specifically, the names for the parameters indexing the model which are accepted by missingHE are the following:
auxiliary parameters \sigma: "sigma.prior.e"(effects) and/or "sigma.prior.c"(costs)
covariate parameters \alpha_j and \beta_j: "alpha.prior"(effects) and/or "beta.prior"(costs)
covariate parameters in the missingness model \gamma_j (if covariate data provided): "gamma.prior.e"(effects) and/or "gamma.prior.c"(costs)
sensitivity parameters \delta: "delta.prior.e"(effects) and/or "delta.prior.c"(costs)
missingness patterns' probabilities \pi: "patterns.prior"
For each outcome model, random effects can also be specified for each parameter by adding the term + (x | z) to each model formula, where x is the fixed regression coefficient for which also the random effects are desired and z is the clustering variable across which the random effects are specified (must be the name of a factor variable in the dataset). Multiple random effects can be specified using the notation + (x1 + x2 | site) for each covariate that was included in the fixed effects formula.
An object of the class 'missingHE' containing the following elements
A list containing the original data set provided in data (see Arguments). Additional information is also included about, among others,
the number of observed and missing individuals, the total number of individuals by treatment arm and the indicator vectors for the missing values
A list containing the output of a JAGS model generated from the functions jags, and
the posterior samples for the main parameters of the model
A list containing the output of the economic evaluation performed using the function bcea
A character variable that indicate which type of missing value mechanism used to run the model, either MAR or MNAR (see details)
A character variable that indicates which type of analysis was conducted, either using a wide or long dataset
Andrea Gabrio
Daniels, MJ. Hogan, JW. Missing Data in Longitudinal Studies: strategies for Bayesian modelling and sensitivity analysis, CRC/Chapman Hall.
Baio, G.(2012). Bayesian Methods in Health Economics. CRC/Chapman Hall, London.
Gelman, A. Carlin, JB., Stern, HS. Rubin, DB.(2003). Bayesian Data Analysis, 2nd edition, CRC Press.
Plummer, M. JAGS: A program for analysis of Bayesian graphical models using Gibbs sampling. (2003).
jags, bcea
# Quck example to run using subset of MenSS dataset
MenSS.subset <- MenSS[50:100, ]
# Run the model using the pattern function assuming a MAR mechanism
# Use only 100 iterations to run a quick check
model.pattern <- pattern(data = MenSS.subset,model.eff = e ~ trt, model.cost = c ~ trt,
dist_e = "norm", dist_c = "norm", type = "MAR", n.chains = 2, n.iter = 100)
# Print the results of the JAGS model
print(model.pattern)
#
# Use dic information criterion to assess model fit
pic.dic <- pic(model.pattern, criterion = "dic", cases = "cc")
pic.dic
#
# Extract regression coefficient estimates
coef(model.pattern)
#
# Assess model convergence using graphical tools
# Produce histograms of the posterior samples for the mean effects
diag.hist <- diagnostic(model.pattern, type = "histogram", param = "mu.e")
#
# Compare observed effect data with imputations from the model
# using plots (posteiror means and credible intervals)
p1 <- plot(model.pattern, class = "scatter", outcome = "effects")
#
# Summarise the CEA information from the model
summary(model.pattern)
# Further examples which take longer to run
model.pattern <- pattern(data = MenSS, model.eff = e ~ trt, model.cost = c ~ trt + e,
dist_e = "norm", dist_c = "norm", type = "MAR", n.chains = 2, n.iter = 500)
#
# Print results for all imputed values
print(model.pattern)
# Use looic to assess model fit
pic.looic <- pic(model.pattern, criterion = "looic", cases = "cc")
pic.looic
# Show density plots for mean costs parameters
diag.den <- diagnostic(model.pattern, type = "denplot", param = "mu.c")
# Plots of imputations for all data
p1 <- plot(model.pattern, class = "scatter", outcome = "both")
# Summarise the CEA results
summary(model.pattern)
#
#
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.