Description Usage Arguments Value Examples
View source: R/power_sampsize.R
Determine the required sample size for a Bayesian hypothesis test
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18  bayes_sampsize(
h1,
h2,
m1,
m2,
sd1 = 1,
sd2 = 1,
scale = 1000,
type = 1,
cutoff,
bound1 = 1,
bound2 = 1/bound1,
datasets = 1000,
nsamp = 1000,
minss = 2,
maxss = 1000,
seed = 31
)

h1 
A constraint matrix defining H1. 
h2 
A constraint matrix defining H2. 
m1 
A vector of expected population means under H1 (standardized). 
m2 
A vector of expected populations means under H2 (standardized).

sd1 
A vector of standard deviations under H1. Must be a single number (equal
standard deviation under all populations), or a vector of the same length as 
sd2 
A vector of standard deviations under H2. Must be a single number (equal
standard deviation under all populations), or a vector of the same length as 
scale 
A number specifying the prior scale 
type 
A character. The type of error to be controlled
options are: 
cutoff 
A number. The cutoff criterion for type.
If 
bound1 
A number. The boundary above which BF12 favors H1 
bound2 
A number. The boundary below which BF12 favors H2 
datasets 
A number. The number of datasets to compute the error probabilities 
nsamp 
A number. The number of prior or posterior samples to determine the fit and complexity 
minss 
A number. The minimum sample size to consider 
maxss 
A number. The maximum sample size to consider 
seed 
A number. The random seed to be set 
The sample size for which the chosen type of error probability is at the set cutoff, and the according error probabilities and median Bayes factors
1 2 3 4 5 6 7 8 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.