Learn R Programming

PowerUpR (version 1.1.0)

plots: Plots

Description

Plots statistical power, minimum detectable effect size (MDES), or MDES difference (MDESD) curves with (1-\(\alpha\))x100 % confidence interval.

Usage

# S3 method for power
plot(x, ypar = "power",  xpar = NULL,
          xlim = NULL, ylim = NULL,
          xlab = NULL, ylab = NULL,
          main = NULL, sub = NULL,
          locate = FALSE, ...)

# S3 method for mdes plot(x, ypar = "power", xpar = NULL, xlim = NULL, ylim = NULL, xlab = NULL, ylab = NULL, main = NULL, sub = NULL, locate = FALSE, ...)

# S3 method for mrss plot(x, ypar = "power", xpar = NULL, xlim = NULL, ylim = NULL, xlab = NULL, ylab = NULL, main = NULL, sub = NULL, locate = FALSE, ...)

Arguments

x

an object returned from one of the PowerUpR functions.

ypar

character; "mdes" or "power" on y axis .

xpar

character; one of the sample sizes on x axis.

xlim

limits for xpar.

ylim

limits for ypar.

xlab

x axis label (ignored for objects returned from power.med211(), power.med221(), and power.med321() functions).

ylab

y axis label (ignored for objects returned from power.med211(), power.med221(), and power.med321() functions).

main

title for the plot (ignored for objects returned from power.med221() and power.med211() functions).

sub

subtitle for the plot (ignored for objects returned from power.med221() and power.med211() functions).

locate

logical; TRUE locates parameter values for design x on the plot.

...

other graphical parameters to pass to plot.new().

Examples

Run this code
# NOT RUN {
design1 <- mdes.cra3(rho3=.06, rho2=.17, n=15, J=3, K=60)
plot(design1, ypar = "mdes", xpar = "K", xlim = c(30, 100))
plot(design1, ypar = "power", xpar = "K", xlim = c(30, 100))

design2 <- power.cra3(es=.269, rho3=.06, rho2=.17, n=15, J=3, K=60)
plot(design2, ypar = "mdes", xpar = "K", xlim = c(30, 100))
plot(design2, ypar = "power", xpar = "K", xlim = c(30, 100))
# }

Run the code above in your browser using DataLab