Learn R Programming

anomo (version 1.2.2)

plot.power.eq: Plot statistical power curves under a fixed budget across optimal design parameters for equivalence testing

Description

This function plots statistical power curves (for equivalence testing) under a fixed budget across optimal design parameters.

Usage

# S3 method for power.eq
plot(
  expr = NULL,
  nlim = c(2, 300),
  plim = c(0.01, 0.99),
  Jlim = c(3, 300),
  powerlim = c(0, 1),
  plot.title = NULL,
  m = NULL,
  d = NULL,
  q = 1,
  power = 0.8,
  eq.dis = NULL,
  by = c("n", "p", "J"),
  legend = TRUE,
  nlab = "Level-One Sample Size (n)",
  plab = "Proportion (p)",
  Jlab = "Level-Two Sample Size (J)",
  powerlab = "Statistical Power"
)

Arguments

expr

Returned objects from an od function (e.g., od.1.eq).

nlim

The limits of the level-1 sample size (n) for calculating and plotting power curves.

plim

The limits of the proportion to the treated (p) for calculating and plotting power curves.

Jlim

The limits of the level-2 sample size (J) for calculating and plotting power curves.

powerlim

The power limits for plotting power curves.

plot.title

The title of the plot (e.g., plot.title = "Power Curves"). The default is NULL.

m

Total budget, default value is the total costs of sampling 600 individuals across treatment conditions.

d

The estimated difference in two-group means.

q

The number of predictors in the combined linear regression model. Default is 1.

power

Statistical power.

eq.dis

A positive number to specify the distance from equivalence bounds to d. The equivalence bounds are c(-abs(d)-eq.dis, abs(d)+eq.dis).

by

Dimensions to plot power curves by the optimal design parameters. The default value is by all optimal design parameters for a type of design. For example, default values are by = "p" for single-level designs, by = c("n", "p") for two-level designs, and by = c("n", "p", "J") for three-level designs.

legend

Logical; present plot legend if TRUE. The default is TRUE.

nlab

Label for the x-axis when the plot is by the optimal design parameter "n".

plab

Label for the x-axis when the plot is by the optimal design parameter "p".

Jlab

Label for the x-axis when the plot is by the optimal design parameter "J".

powerlab

The label for the statistical power.

Examples

Run this code
# Optimal sample allocation identification
od <- od.1.eq(r12 = 0.5, c1 = 1, c1t = 10)
# plot the power curve
plot.power.eq(expr = od, d = 0.1, eq.dis = 0.1)

Run the code above in your browser using DataLab