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

Description Usage Arguments Details References See Also Examples

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

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
cace.meta.ic(
  data,
  param = c("CACE", "u1out", "v1out", "s1out", "b1out", "pic", "pin", "pia"),
  prior.type = "default",
  delta.n = TRUE,
  delta.a = TRUE,
  delta.u = TRUE,
  delta.v = TRUE,
  delta.s = TRUE,
  delta.b = TRUE,
  cor = TRUE,
  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

a character string vector indicating the parameters to be tracked and estimated. By default the following parameters (see details) are included: θ^{CACE} (CACE), E(u_{i1}) (u1out), E(v_{i1}) (v1out), E(s_{i1}) (s1out), E(b_{i1}) (b1out), π_a (pia), π_n (pin), and π_c=1-π_a-π_n (pic). Users can modify the string vector to only include parameters of interest besides θ^{CACE}.

prior.type

the default priors are used by the default assignment 'prior.type="default"'. Like the function cace.study, weakly informative priors α_n, α_a \sim N(0, 2.5^2) and α_s, α_b, α_u, α_v \sim N(0, 2^2) are assigned to the means of these transformed parameters: π_{in}=\frac{\exp(n_i)}{1+\exp(n_i)+\exp(a_i)}, π_{ia}=\frac{\exp(a_i)}{1+\exp(n_i)+\exp(a_i)}, where n_i=α_n+δ_{in}, a_i=α_a+δ_{ia}, logit(s_{i1})=α_s + δ_{is}, logit(b_{i1})=α_b + δ_{ib}, probit(u_{i1})=α_u + δ_{iu}, and probit(v_{i1})=α_v + δ_{iv}. The default prior of random effects are illstrated in 'Details'. Alternatively, this function allows users to specify their own prior distributions by saving a separate 'R' file prior.meta.R under the same directory with the model file, and assigning the argument 'prior.type = "custom"'. See example in 'Details'. Users can modify the above customized file prior.meta.R to assign their preferred prior distributions. Note that same as the function cace.study, the function cannot combine the default priors with partial user-defined prior distributions. Thus users need to be careful when choosing the customized priors: the pre-defined 'R' file prior.meta.R must include distributions for all hyper-parameters.

delta.n

logical values indicating whether the corresponding random effect is included in the model. The default model sets all of these arguments to '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'.

delta.a

logical values indicating whether the corresponding random effect is included in the model. The default model sets all of these arguments to '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'.

delta.u

logical values indicating whether the corresponding random effect is included in the model. The default model sets all of these arguments to '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'.

delta.v

logical values indicating whether the corresponding random effect is included in the model. The default model sets all of these arguments to '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'.

delta.s

logical values indicating whether the corresponding random effect is included in the model. The default model sets all of these arguments to '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'.

delta.b

logical values indicating whether the corresponding random effect is included in the model. The default model sets all of these arguments to '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'.

cor

logical values indicating whether the corresponding random effect is included in the model. The default model sets all of these arguments to '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'.

digits

a positive integer specifying the digits after the decimal point for the effect size estimates. The default is 3.

n.adapt

the number of iterations for adaptation in Markov chain Monte Carlo (MCMC) algorithm; it is used to maximize the sampling efficiency. The default is 1,000. If a warning "adaptation incomplete" appears, users may increase n.adapt. This argument and the following n.iter, n.burnin, n.chains, n.thin are passed to the functions in R package rjags.

n.iter

the number of iterations of each MCMC chain. The default is 100,000.

n.burnin

the number of iterations for burn-in period. The default is the largest integer not greater than n.iter/2.

n.chains

the number of MCMC chains. The default is 3.

n.thin

a positive integer indicating thinning rate for MCMC chains, which is used to avoid potential high auto-correlation and to save computer memory when n.iter is large. The default is set as 1 or the largest integer not greater than ((n.iter - n.burnin)/1e+05), whichever is larger.

conv.diag

a logical value indicating whether to compute the Gelman and Rubin convergence statistic (\hat{R}) of each parameter as a convergence diagnostic. It is considered the chains are well mixed and have converged to the target distribution if \hat{R} ≤ 1.1. The default is 'FALSE'. If 'TRUE', n.chains must be greater than 1, and the function saves each chain's MCMC samples for all parameters, which can be used to produce trace, posterior density, and auto-correlation plots by calling the function plot.cacebayes.

mcmc.samples

a logical value indicating whether to save MCMC posterior samples in the output object. The default is 'FALSE'. If 'TRUE', the output object list includes each chain's MCMC samples for all parameters. They can be used in the function plot.cacebayes to generate the trace, posterior density, and auto-correlation plots for further model diagnostics.

study.specific

a logical value indicating whether to calculate the study-specific θ^{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 θ^{CACE}_i is the same across studies. The function gives a warning and continues by making 'study.specific = FALSE'. Otherwise, the study-specific θ^{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.

References

\insertRef

zhou2019bayesianBayesCACE \insertRefzhou2020softwareBayesCACE

See Also

cace.study, cace.meta.c

Examples

1
2
3
4
5
6
7
## Not run: 
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)

## End(Not run)

JinchengZ/BayesCACE documentation built on June 24, 2021, 4:47 a.m.