Learn R Programming

anomo (version 1.0.0)

od.eq.2group: Optimal sample allocation calculation for equivalence test of two-group means

Description

The optimal design of single-level experiments detecting equivalence of two-group means is to choose the optimal sample allocation that minimizes the variance of a treatment effect under a fixed budget, which is approximately the optimal sample allocation that maximizes statistical power under a fixed budget. The optimal design parameter is the proportion of individuals to be assigned to treatment (p).

Usage

od.eq.2group(
  p = NULL,
  r12 = NULL,
  c1 = NULL,
  c1t = NULL,
  m = NULL,
  plots = TRUE,
  plim = NULL,
  varlim = NULL,
  plab = NULL,
  varlab = NULL,
  vartitle = NULL,
  verbose = TRUE
)

Value

Unconstrained or constrained optimal sample allocation (p). The function also returns function name, design type, and parameters used in the calculation.

Arguments

p

The proportion of individuals to be assigned to treatment.

r12

The proportion of outcome variance explained by covariates.

c1

The cost of sampling one unit in the control condition.

c1t

The cost of sampling one unit in the treated condition.

m

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

plots

Logical, provide variance plots if TRUE, otherwise not; default value is TRUE.

plim

The plot range for p, default value is c(0, 1).

varlim

The plot range for variance, default value is c(0, 0.05).

plab

The plot label for p, default value is "Proportion of Units in Treatment: p".

varlab

The plot label for variance, default value is "Variance".

vartitle

The title of variance plot, default value is NULL.

verbose

Logical; print the value of p if TRUE, otherwise not; default value is TRUE.

Examples

Run this code
# Unconstrained optimal design #---------
  myod <- od.eq.2group(r12 = 0.5, c1 = 1, c1t = 50)
  myod$out # output

Run the code above in your browser using DataLab