Interactively Simulate P-values for a Binomial Test
ShinyPvalueBinomSim.RdLaunches a Shiny app wrapping Pvalue.binom.sim: given a
population proportion and a hypothesized proportion, it simulates
many samples, tests each with an approximate or exact binomial test,
and plots the resulting p-values in a histogram and QQ-plot.
Details
This function requires the shiny package to be installed. Use
the “Refresh” button to redraw the simulation with the
current settings. When p == p0, the simulated p-values
should approximately follow a uniform distribution; as the true
proportion moves away from the hypothesized value, the distribution
of p-values shifts towards 0, illustrating 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 <- ShinyPvalueBinomSim()
# h$stop() # run this when finished with the app
}