power.sim {NCStats}R Documentation

Simulation of power calculation in 1-sample mean problems.

Description

This function plots the null and actual distributions, highlights the rejection region and the power region, and allows the user to manipulate the effect size, standard deviation, sample size, and alpha to determine the effect on power.

Usage

power.sim(mu0=100,s.mua=95,s.sigma=10,s.n=30,s.alpha=0.05,lower.tail=TRUE)

Arguments

mu0 The null hypothesized mean.
s.mua The starting value for the actual population mean.
s.sigma The starting value for the actual population standard deviation.
s.n The starting value for the sample size.
s.alpha The starting value for alpha.
lower.tail A logical indicating if the rejection region is into the lower tail or not.

Value

None, but a dynamic graphic with slider bars will be produced.

Note

On first call a dialog box with four sliders will appear in the upper-left corner of the R window. A graphic will not be seen until an item in the dialog box is changed. At this time, the dialog box will appear to disappear. However, it has simply been minimized and can be reaccessed as all minimized programs are accessed. This “bug” only appears when the function is started and upon first change of an item in the dialog box.

Author(s)

Derek H. Ogle, dogle@northland.edu

Examples

## Not run by examples().  Copy and try in an interactive R session
## Not run: power.sim()

[Package NCStats version 0.0-12 Index]