c212.1a.interim {c212}R Documentation

A Two or Three-Level Hierarchical Body-system based Model for interim analysis without Point-Mass.

Description

Implementation of a Two or Three-Level Hierarchical Body-system based Model for interim analysis without Point-Mass.

Usage

	c212.1a.interim(trial.data, sim_type = "SLICE", burnin = 10000,
		iter = 40000, nchains = 3,
		global.sim.params = NULL,
		sim.params = NULL,
		monitor = NULL,
		initial_values = NULL,
		hier = 3,
		level = 1,
		hyper_params = NULL,
		memory_model = "HIGH")

Arguments

trial.data

A file or data frame containing the trial data. It must contain must contain the columns I_index (interval index), B (body-system), AE (adverse event), Group (1 - control, 2 treatment), Count (total number of events), Total (total number of participants in the trial arm).

sim_type

The type of MCMC method to use for simulating from non-standard distributions. Allowed values are "MH" and "SLICE" for Metropolis_Hastings and Slice sampling respectively.

burnin

The burnin period for the monte-carlo simulation. These are discarded from the returned samples.

iter

The total number of iterations for which the monte-carlo simulation is run. This includes the burnin period. The total number of samples returned is iter - burnin

nchains

The number of independent chains to run.

global.sim.params

A data frame containing the parameters for the simulation type sim_type. For "MH" the parameter is the variance of the normal distribution used to simulate the next candidate value centred on the current value. For "SLICE" the parameters are the estimated width of the slice and a value limiting the search for the next sample. Passing NULL uses the model defaults.

sim.params

A dataframe containing simulation parameters which override the global simulation parameters (global.sim.params) for particular model parameters. sim.params must contain the following columns: type: the simulation type ("MH" or "SLICE"); variable: the model parameter for which the simulation parameters are being overridden; B: the body-system (if applicable); AE: the adverse event (if applicable); param: the simulation parameter; value: the overridden value; control: the overridden control value. Passing NULL uses the model defaults.

The function c212.sim.control.params generates a template for sim.params which can be edited by the user.

monitor

A dataframe indicating which sets of If NULL is passed default parameters are variables to monitor. Passing NULL uses the model defaults.

initial_values

The initial values for starting the chains. If NULL (the default) is passed the function generates the initial values for the chains. initial_values is a list with the following format:

list(gamma, theta, mu.gamma, mu.theta, sigma2.gamma,
	sigma2.theta, mu.gamma.0, mu.theta.0, tau2.gamma.0,
	tau2.theta.0)

where each element of the list is either a dataframe or array. The function c212.gen.initial.values can be used to generate a template for the list which can be updated by the user if required. The formats of the list elements are as follows:

gamma, theta: dataframe with columns B, AE, chain, value

mu.gamma, mu.theta, sigma2.gamma, sigma2.theta: dataframe with columns B, chain, value

mu.gamma.0, mu.theta.0, tau2.gamma.0, tau2.theta.0: array of size chain.

hier

Model using a two or three level hierarchy. 2 - two-level hierarchy, 3 - three level hierarchy.

level

The level of longitudinal dependency between the intervals. Allowed values are 0, 1, 2 for a three-level hierarchy and 0, 1 for a two-level hierarchy. 0 - independent intervals, 1 - common interval body-system means, 2 - weak dependency.

hyper_params

The hyperparameters for the model. The default hyperparameters are based on those given in Berry and Berry 2004. Passing NULL uses the model defaults.

memory_model

Allowed values are "HIGH" and "LOW". "HIGH" means use as much memory as possible. "LOW" means use the minimum amount of memory.

Details

The models are fitted by Gibbs samplers. The posterior distributions for gamma and theta are sampled with either a Metropolis-Hastings step or a slice sampler.

Value

The output from the simulation including all the sampled values for the three-level hierarchy is as follows:

list(id, sim_type, chains, nIntervals, Intervals, nBodySys, maxBs,
	maxAEs, nAE, AE, B, burnin, iter, monitor,
	mu.gamma.0, mu.theta.0, tau2.gamma.0, tau2.theta.0,
	mu.gamma, mu.theta, sigma2.gamma, sigma2.theta, gamma,
	theta, gamma_acc, theta_acc)

The output from the simulation including all the sampled values for the two-level hierarchy is as follows:

list(id, sim_type, chains, nIntervals, Intervals, nBodySys, maxBs,
	maxAEs, nAE, AE, B, burnin, iter, monitor,
	mu.gamma, mu.theta, sigma2.gamma, sigma2.theta, gamma,
	theta, gamma_acc, theta_acc)

where

id - a string identifying the version of the function

sim_type - an string identifying the sampling method used for non-standard distributions, either "MH" or "SLICE"

chains - the number of chains for which the simulation was run.

nIntervals - the number of intervals in the simulation

Intervals - an array. The intervals.

nBodySys - the number of body-systems

maxBs - the maximum number of body-systems in an interval

maxAEs - the maximum number of AEs in a body-system

nAE - an array. The number of AEs in each body-system.

AE - an array of dimension nBodySys, maxAEs. The Adverse Events.

B - an array. The body-systems.

burnin - burnin used for the simulation.

iter - the total number of iterations in the simulation.

monitor - the variables being monitored. A dataframe.

mu.gamma.0 - array of samples of dimension chains, iter - burnin

mu.theta.0 - array of samples of dimension chains, iter - burnin

tau2.gamma.0 - array of samples of dimension chains, iter - burnin

tau2.theta.0 - array of samples of dimension chains, iter - burnin

mu.gamma - array of samples of dimension chains, nBodySys iter - burnin

mu.theta - array of samples of dimension chains, nBodySys iter - burnin

sigma2.gamma - array of samples of dimension chains, nBodySys iter - burnin

sigma2.theta - array of samples of dimension chains, nBodySys iter - burnin

gamma - array of samples of dimension chains, nBodySys, maxAEs, iter - burnin

theta - array of samples of dimension chains, nBodySys, maxAEs, iter - burnin

gamma_acc - the acceptance rate for the gamma samples if a Metropolis-Hastings method is used. An array of dimension chains, nBodySys, maxAEs

theta_acc - the acceptance rate for the theta samples if a Metropolis-Hastings method is used. An array of dimension chains, nBodySys, maxAEs

Note

The function performs the simulation and returns the raw output. No checks for convergence are performed.

Author(s)

R. Carragher

Examples

data(c212.trial.interval.data1)
raw = c212.1a.interim(c212.trial.interval.data1, burnin = 100, iter = 200)
## Not run: 
data(c212.trial.interval.data1)
raw = c212.1a.interim(c212.trial.interval.data1)

raw$B
    [,1]        [,2]         [,3]         [,4]         [,5]        
[1,] "Bdy-sys_1" "Bdy-sys_10" "Bdy-sys_11" "Bdy-sys_12" "Bdy-sys_13"
[2,] "Bdy-sys_1" "Bdy-sys_10" "Bdy-sys_11" "Bdy-sys_12" "Bdy-sys_13"
[3,] "Bdy-sys_1" "Bdy-sys_10" "Bdy-sys_11" "Bdy-sys_12" "Bdy-sys_13"
[4,] "Bdy-sys_1" "Bdy-sys_10" "Bdy-sys_11" "Bdy-sys_12" "Bdy-sys_13"
[5,] "Bdy-sys_1" "Bdy-sys_10" "Bdy-sys_11" "Bdy-sys_12" "Bdy-sys_13"
[6,] "Bdy-sys_1" "Bdy-sys_10" "Bdy-sys_11" "Bdy-sys_12" "Bdy-sys_13"
     [,6]         [,7]         [,8]        [,9]        [,10]       [,11]      
[1,] "Bdy-sys_14" "Bdy-sys_15" "Bdy-sys_2" "Bdy-sys_3" "Bdy-sys_4" "Bdy-sys_5"
[2,] "Bdy-sys_14" "Bdy-sys_15" "Bdy-sys_2" "Bdy-sys_3" "Bdy-sys_4" "Bdy-sys_5"
[3,] "Bdy-sys_14" "Bdy-sys_15" "Bdy-sys_2" "Bdy-sys_3" "Bdy-sys_4" "Bdy-sys_5"
[4,] "Bdy-sys_14" "Bdy-sys_15" "Bdy-sys_2" "Bdy-sys_3" "Bdy-sys_4" "Bdy-sys_5"
[5,] "Bdy-sys_14" "Bdy-sys_15" "Bdy-sys_2" "Bdy-sys_3" "Bdy-sys_4" "Bdy-sys_5"
[6,] "Bdy-sys_14" "Bdy-sys_15" "Bdy-sys_2" "Bdy-sys_3" "Bdy-sys_4" "Bdy-sys_5"
     [,12]       [,13]       [,14]       [,15]      
[1,] "Bdy-sys_6" "Bdy-sys_7" "Bdy-sys_8" "Bdy-sys_9"
[2,] "Bdy-sys_6" "Bdy-sys_7" "Bdy-sys_8" "Bdy-sys_9"
[3,] "Bdy-sys_6" "Bdy-sys_7" "Bdy-sys_8" "Bdy-sys_9"
[4,] "Bdy-sys_6" "Bdy-sys_7" "Bdy-sys_8" "Bdy-sys_9"
[5,] "Bdy-sys_6" "Bdy-sys_7" "Bdy-sys_8" "Bdy-sys_9"
[6,] "Bdy-sys_6" "Bdy-sys_7" "Bdy-sys_8" "Bdy-sys_9"

## End(Not run)

[Package c212 version 0.98 Index]