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 manipulate the effect size, standard deviation, sample size, and alpha to determine the effect 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 indicating if the rejection region is into the lower tail or not.

Value

None, but a dynamic graphic with slider bars is produced.

Examples

if (interactive()) {

powerSim()
powerSim(lower.tail=FALSE)

}

[Package NCStats version 0.3.4 Index]