cace.meta.ic: Bayesian hierarchical models for CACE meta-analysis with...

View source: R/cace.meta.ic.R

cace.meta.icR Documentation

Bayesian hierarchical models for CACE meta-analysis with incomplete compliance information

Description

This function also estimates θ^{\mathrm{CACE}} using the Bayesian hierarchcal model but can accommodate studies with incomplete compliance data. The necessary data structure and the likelihood function are presented in Section 2.3 of the package manuscript, "CACE for meta-analysis with incomplete compliance information".

Usage

cace.meta.ic(
  data,
  param = c("CACE", "u1out", "v1out", "s1out", "b1out", "pic", "pin", "pia"),
  random.effects = list(),
  re.values = list(),
  model.code = "",
  digits = 3,
  n.adapt = 1000,
  n.iter = 1e+05,
  n.burnin = floor(n.iter/2),
  n.chains = 3,
  n.thin = max(1, floor((n.iter - n.burnin)/1e+05)),
  conv.diag = FALSE,
  mcmc.samples = FALSE,
  study.specific = FALSE
)

Arguments

data

a input dataset the same structure as the example data epidural_ic, containing multiple rows referring to multiple studies in a meta-analysis.

param

the list of parameter used.

Default to c("CACE", "u1out", "v1out", "s1out", "b1out", "pic", "pin", "pia").

random.effects

a list of logical values indicating whether random effects are included in the model. The list should contain the assignment for these parameters only: delta.n (δ_{in}), delta.a (δ_{ia}), delta.u (δ_{iu}), delta.v (δ_{iv}), delta.s (δ_{is}), delta.b (δ_{ib}), cor. The list should be in the form of list(delta.a = FALSE, cor = FALSE, ...). By default, this is an empty list, and all parameters are default to TRUE. Parameters that are not listed in the list are assumed to be TRUE. Note that ρ (cor) can only be included when both δ_{in} (delta.n) and δ_{ia} (delta.a) are set to TRUE. Otherwise, a warning occurs and the model continues running by forcing delta.n = TRUE and delta.a = TRUE.

re.values

a list of parameter values for the random effects. It should contain the assignment for these parameters only: alpha.n.m and alpha.n.s, which refer to the mean and standard deviation used in the normal distribution estimation of alpha.n, as well as alpha.a.m, alpha.a.s, alpha.s.m, alpha.s.s, alpha.b.m, alpha.b.s, alpha.u.m, alpha.u.s, alpha.v.m, alpha.v.s. It also contains the shape and rate parameters of the gamma distributions of the standard deviation variable of delta.n, delta.a, delta.u, delta.v delta.s, delta.b. The shape parameters are named as tau.n.h and tau.a.h, for example, and the rate parameters are named as tau.n.r and tau.a.r. You do not need to specify the shape and rate parameters if the corresponding random effect is set to FALSE in random.effects, since they will not be used anyways. By default, re.values is an empty list, and all the mean are set to 0, and alpha.n.s = alpha.a.s = 0.16, and alpha.s.s = alpha.b.s = alpha.u.s = alpha.v.s = 0.25, and the shape and rate parameters are default to 2.

model.code

a string representation of the model code; each line should be separated. Default to constructing model code using the model.meta.ic function with the parameters that are inputted to this function. This parameter is only necessary if user wishes to make functional changes to the model code, such as changing the probability distributions of the parameters. Default to empty string.

digits

number of digits. Default to 3.

n.adapt

adapt value. Default to 1000.

n.iter

number of iterations. Default to 100000.

n.burnin

number of burn-in iterations. Default to n.iter/2.

n.chains

number of chains. Default to 3.

n.thin

thinning rate, must be a positive integer.

Default to max(1,floor((n.iter-n.burnin)/100000)).

conv.diag

whether or not to show convergence diagnostics. Default to FALSE.

mcmc.samples

whether to include JAGS samples in the final output. Default to FALSE.

study.specific

a logical value indicating whether to calculate the study-specific θ^{\mathrm{CACE}}_i. If TRUE, the model will first check the logical status of arguments delta.u and delta.v. If both are FALSE, meaning that neither response rate u_{i1} or v_{i1} is modeled with a random effect, then the study-specific θ^{\mathrm{CACE}}_i is the same across studies. The function gives a warning and continues by making study.specific = FALSE. Otherwise, the study-specific θ^{\mathrm{CACE}}_i are estimated and saved as the parameter cacei.

Details

Note that when compiling the JAGS model, the warning ‘adaptation incomplete’ may occasionally occur, indicating that the number of iterations for the adaptation process is not sufficient. The default value of n.adapt (the number of iterations for adaptation) is 1,000. This is an initial sampling phase during which the samplers adapt their behavior to maximize their efficiency (e.g., a Metropolis–Hastings random walk algorithm may change its step size). The ‘adaptation incomplete’ warning indicates the MCMC algorithm may not achieve maximum efficiency, but it generally has little impact on the posterior estimates of the treatment effects. To avoid this warning, users may increase n.adapt.

Value

It returns a model object whose attribute type is cace.Bayes

References

\insertRef

zhou2019bayesianBayesCACE

See Also

cace.study, cace.meta.c

Examples


data("epidural_ic", package = "BayesCACE")
set.seed(123)
out.meta.ic <- cace.meta.ic(data = epidural_ic, conv.diag = TRUE, 
mcmc.samples = TRUE, study.specific = TRUE)


BayesCACE documentation built on Oct. 2, 2022, 5:08 p.m.