powerSim {NCStats}R Documentation

Dynamic 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 dynamically manipulate the effect size, standard deviation, sample size, and alpha to determine the effect of these parameters on power.

Usage

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

Arguments

mu0

A single numeric that is the null hypothesized mean

s.mua

A single numeric that is the starting value for the actual population mean

s.sigma

A single numeric that is the starting value for the actual population standard deviation

s.n

A single numeric that is the starting value for the sample size

s.alpha

A single numeric that is the starting value for alpha

lower.tail

A single logical that indicates if the rejection region is into the lower tail or not

Details

If the user is using RStudio and the manipulate package is installed then the dynamic graph is produced in the “Plots” pane of RStudio. The plot controls may be accessed through the “gear” that is in the upper-left corner of the plot. If the user is not using RStudio or the manipulate package is not installed, then an attempt is made to produce the dynamic graph with Tcl/Tk using the functions in the relax package.

Value

None, but a dynamic graphic with sliders is produced.

Examples

## Not run: 
powerSim()
powerSim(lower.tail=FALSE)

## End(Not run)


[Package NCStats version 0.4.7 Index]