bayes_two_stage_sim: Helper function for Bayesian two stage simulations

View source: R/bayes_two_stage_sim.R

bayes_two_stage_simR Documentation

Helper function for Bayesian two stage simulations

Description

Helper function for Bayesian two stage simulations

Usage

bayes_two_stage_sim(
  req_p = 0.995,
  true_p = 0.995,
  gamma = 0.8,
  alpha = 0.05,
  n1 = 200,
  n2 = 800,
  prior_alpha = 0.5,
  prior_beta = 0.5
)

Arguments

req_p

observed count

true_p

total count

gamma

posterior probability threshold needed to reject, defaults to .8

n1

first stage sample size, defaults to 200

n2

second stage sample size, defaults to 800

prior_alpha

alpha parameter of beta prior, defaults to .5 (Jeffrey's prior)

prior_beta

beta parameter of beta prior, defaults to .5 (Jeffrey's prior)

Value

a df of simulated outcomes and posterior probabilities


njjms/nicks documentation built on May 4, 2022, 8:10 a.m.