Skip to contents

A class representing a Binomial Conditional Power Prior model.

Super classes

Model -> MCMCModel -> BinomialCPP

Public fields

power_parameter

The power parameter for the model

method

Method name

stan_prior

Stan prior model

stan_prior_code

Stan code for the prior

fixed_power_parameter

Whether the power parameter is the same for every replicate, so that the posterior is read off a cached prior kernel.

Methods

Inherited methods


BinomialCPP$summary_rows()

Rows of the model summary, with the power parameter

A power parameter set from each replicate's data is already among the posterior_parameters rows, so it is only added when it is fixed.

Usage

BinomialCPP$summary_rows()

Returns

A data frame with columns Attribute and Value.


BinomialCPP$new()

Initialize an instance of the BinomialCPP class.

Usage

BinomialCPP$new(prior, mcmc_config)

Arguments

prior

The prior object

mcmc_config

The MCMC configuration parameters


BinomialCPP$prepare_data()

Prepare data for the model

Usage

BinomialCPP$prepare_data(target_data)

Arguments

target_data

The target study data

Returns

A list of prepared data


BinomialCPP$quadrature_posterior()

The posterior on a grid, under the quadrature engine

The same model as the Stan program, with the current power parameter.

Usage

BinomialCPP$quadrature_posterior(target_data)

Arguments

target_data

The target study data

Returns

A grid_posterior() list.


BinomialCPP$quadrature_prior()

The prior on a grid, under the quadrature engine: the same model without target patients, as in the Stan prior program.

Usage

BinomialCPP$quadrature_prior(power_parameter = self$power_parameter)

Arguments

power_parameter

The power parameter of the prior, by default the model's own.

Returns

A grid_posterior() list.


BinomialCPP$prior_given_control_rate()

The prior of the treatment effect given the target control rate

The power prior of quadrature_prior() with the target control rate fixed rather than integrated out, so the effect is confined to the range that rate leaves it.

Usage

BinomialCPP$prior_given_control_rate(control_rate)

Arguments

control_rate

The target control rate.

Returns

A list of three functions of the treatment effect: cdf, pdf, and sample, which takes the number of draws.


BinomialCPP$draw_mcmc_prior()

Sample from the prior using Stan

Usage

BinomialCPP$draw_mcmc_prior()


BinomialCPP$clone()

The objects of this class are cloneable with this method.

Usage

BinomialCPP$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.