gen.data: Compute the posterior variance across Q difference proposed...

View source: R/gen.data.R

gen.dataR Documentation

Compute the posterior variance across Q difference proposed data collection exercises This can be used to estimate the EVSI using the Heath et al. method.

Description

Compute the posterior variance across Q difference proposed data collection exercises This can be used to estimate the EVSI using the Heath et al. method.

Usage

gen.data(model.stats, data, N.name = NULL, N.size = NULL,
  moment.matching = TRUE, Q = 30, data.stats = NULL,
  update = c("bugs", "jags"), n.burnin = 1000, n.thin = 1,
  n.iter = 5000)

Arguments

model.stats

A .txt file containing the model file of a Bayesian model. This should be a BUGS or JAGS model.

data

A string or vector of strings that defines the name of the future data in the model file.

N.name

A string that defines the name of the variable that defines the sample size of the future data in the model file. If NULL then the sample size of the data must be defined in data.stats.

N.size

A scalar or vector that defines the sample sizes for the future study. A scalar N.size will compute the EVSI for a single sample size. If a vector is passed for N.size then the EVSI can be estimated for all sample sizes within the range of values given. If NULL then the sample size of the data must be defined in data.stats.

moment.matching

If TRUE then the returned data can be used as inputs to the Heath et al. moment matching method for EVSI computation. If FALSE then a data.frame of the prior predictive distribution of the data will be returned.

Q

The number of quadrature points used the estimate the EVSI.

data.stats

A data file for the BUGS/JAGS model. This is the data used to inform the base case analysis. If empty then it is assumed that the models are

update

Defines the Bayesian engine that should be used to update the the Bayesian model file given in model.stats.

n.burnin

The burnin for the JAGS/BUGS model

n.thin

The thinning for the JAGS/BUGS model

n.iter

The number of interations for the JAGS/BUGS model

Value

A list of future data object. 1. data A data frame or list of the simulated data for the proposed study. 2. N.calc A vector containing the sample sizes for the which the EVSI has been computed.

Examples

NULL

annaheath/EVSI documentation built on June 25, 2022, 6:26 a.m.