Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

plot.power.htest

Plot diagram of sample size vs. test power


Description

Plot a diagram to illustrate the relationship of sample size and test power for a given set of parameters.

Usage

## S3 method for class 'power.htest'
plot(x, ...)

Arguments

x

object of class power.htest usually created by one of the power calculation functions, e.g., pwr.t.test()

...

Arguments to be passed to ggplot including xlab and ylab

Details

Power calculations for the following tests are supported: t-test (pwr.t.test(), pwr.t2n.test()), chi squared test (pwr.chisq.test()), one-way ANOVA (pwr.anova.test(), standard normal distribution (pwr.norm.test()), Pearson correlation (pwr.r.test()), proportions (pwr.p.test(), pwr.2p.test(), pwr.2p2n.test()))

Value

These functions are invoked for their side effect of drawing on the active graphics device.

Note

By default it attempts to use the plotting tools of ggplot2 and scales. If they are not installed, it will use the basic R plotting tools.

Author(s)

Stephan Weibelzahl <weibelzahl@pfh.de>

See Also

Examples

## Two-sample t-test
p.t.two <- pwr.t.test(d=0.3, power=0.8, type="two.sample", alternative="two.sided")
plot(p.t.two)
plot(p.t.two, xlab="sample size per group")

pwr

Basic Functions for Power Analysis

v1.3-0
GPL (>= 3)
Authors
Stephane Champely [aut], Claus Ekstrom [ctb], Peter Dalgaard [ctb], Jeffrey Gill [ctb], Stephan Weibelzahl [ctb], Aditya Anandkumar [ctb], Clay Ford [ctb], Robert Volcic [ctb], Helios De Rosario [cre]
Initial release
2020-03-16

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.