assurance_nd_na {bayesassurance}R Documentation

Bayesian Assurance Computation

Description

Takes in a set of parameters and returns the exact Bayesian assurance based on a closed-formed solution.

Usage

assurance_nd_na(n, n_a, n_d, theta_0, theta_1, sigsq, alt, alpha = 0.05)

Arguments

n

sample size (either scalar or vector)

n_a

sample size at analysis stage that quantifies the amount of prior information we have for parameter \theta. This should be a single scalar value.

n_d

sample size at design stage that quantifies the amount of prior information we have for where the data is being generated from. This should be a single scalar value.

theta_0

parameter value that is known a priori (typically provided by the client)

theta_1

alternative parameter value that will be tested in comparison to theta_0. See alt for specification options.

sigsq

known variance \sigma^2.

alt

specifies alternative test case, where alt = "greater" tests if \theta_1 > \theta_0, alt = "less" tests if \theta_1 < \theta_0, and alt = "two.sided" performs a two-sided test. alt = "greater" by default.

alpha

significance level

Value

objects corresponding to the assurance

Examples


## Assign the following fixed parameters to determine the Bayesian assurance
## for the given vector of sample sizes.
n <- seq(10, 250, 5)
n_a <- 1e-8
n_d <- 1e+8
theta_0 <- 0.15
theta_1 <- 0.25
sigsq <- 0.104
assur_vals <- assurance_nd_na(n = n, n_a = n_a, n_d = n_d, 
theta_0 = theta_0, theta_1 = theta_1,
sigsq = sigsq, alt = "two.sided", alpha = 0.05)
assur_vals$assurance_plot

[Package bayesassurance version 0.1.0 Index]