Skip to contents

Launches a Shiny app wrapping power.examp: it plots the sampling distributions of a test statistic under the null and alternative hypotheses, along with the rejection region, alpha, and power.

Usage

ShinyPowerExamp(n = 1, sd = 1, diff = 0, alpha = 0.05, xmin = -2, xmax = 4)

Arguments

n

Initial sample size.

sd

Initial population standard deviation.

diff

Initial true difference from the null hypothesis.

alpha

Initial significance level.

xmin

Initial minimum x value for the plot.

xmax

Initial maximum x value for the plot.

Details

This function requires the shiny package to be installed. Changing the sample size, standard deviation, true difference, or alpha updates the plot so you can see the effect of each parameter on statistical power.

Value

Launches the app in non-blocking mode (via startApp) and returns a ShinyAppHandle immediately, so the R console remains available while the app runs in the background. Use handle$stop() to stop the app.

Author

Greg Snow 538280@gmail.com

Examples

if(interactive()) {
  h <- ShinyPowerExamp()
  # h$stop() # run this when finished with the app
}