View source: R/deficit_power.R
| BTD_power | R Documentation | 
Calculates approximate power, given sample size, using Monte Carlo simulation for the Bayesian test of deficit for a specified case score, mean and standard deviation for the control sample. The mean and standard deviation defaults to 0 and 1, so if no other values are given the case score is interpreted as deviation from the mean in standard deviations.
BTD_power(
  case,
  mean = 0,
  sd = 1,
  sample_size,
  alternative = c("less", "greater", "two.sided"),
  alpha = 0.05,
  nsim = 1000,
  iter = 1000
)
case | 
 A single value from the expected case observation.  | 
mean | 
 The expected mean of the control sample.  | 
sd | 
 The expected standard deviation of the control sample.  | 
sample_size | 
 The size of the control sample, vary this parameter to see how the sample size affects power.  | 
alternative | 
 The alternative hypothesis. A string of either "less" (default), "greater" or "two.sided".  | 
alpha | 
 The specified Type I error rate. This can also be varied, with effects on power.  | 
nsim | 
 The number of simulations for the power calculation. Defaults to 1000 due to BTD already being computationally intense.  | 
iter | 
 The number of simulations used by the BTD. Defaults to 1000.  | 
Returns a single value approximating the power of the test for the given parameters.
BTD_power(case = -2, mean = 0, sd = 1, sample_size = 20)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.