power.examp(n = 1, stdev = 1, diff = 1, alpha = 0.05, xmin = -2, xmax = 4)
run.power.examp(hscale=1.5, vscale=1.5, wait=FALSE)
run.power.examp.old()tkrplot.tkrplot.power.examp invisibly returns the power computed.
run.power.examp returns a list with the parameter settings and
the power if wait is TRUE.
run.power.examp.old does not return anything meaningful.alpha and the rejection
region for the test statistic.
The lower panel shows the normal distribution for the test statistic
under the alternative hypothesis where the true mean (or mean
difference) is diff. Using the rejection region from the upper
panel it shades the upper tail area that corresponds to the power of
the test.
Both curves are affected by the specified stdev and sample size
n.
The function run.power.examp will in addition create a Tk
slider box that will allow you to interactively change the values of
stdev, diff, alpha, and n to dynamically
see the effects of the change on the graphs and on the power of the
test.
This can be used to demonstrate the concept of power, show the effect
of sample size on power, show the inverse relationship between the
type I and type II error rates, and show how power is dependent on the
true mean (or difference) and the population standard deviation.power.t.testpower.examp()
power.examp(n=25)
power.examp(alpha=0.1)Run the code above in your browser using DataLab