getDesignFixed: Get Fixed Design

View source: R/f_design_fixed.R

getDesignFixedR Documentation

Get Fixed Design

Description

Create a fixed (single-stage) trial design. This convenience wrapper constructs an object of class TrialDesignFixed with kMax = 1.

Usage

getDesignFixed(
  alpha = NA_real_,
  beta = NA_real_,
  sided = 1L,
  directionUpper = NA,
  twoSidedPower = NA
)

Arguments

alpha

The significance level alpha, default is 0.025. Must be a positive numeric of length 1.

beta

Type II error rate, necessary for providing sample size calculations (e.g., getSampleSizeMeans()), beta spending function designs, or optimum designs, default is 0.20. Must be a positive numeric of length 1.

sided

Is the alternative one-sided (1) or two-sided (2), default is 1. Must be a positive integer of length 1.

directionUpper

Logical. Specifies the direction of the alternative, only applicable for one-sided testing; TRUE means that larger values of the test statistics yield smaller p-values. The default is TRUE for means, rates, and count data, and FALSE for survival data (power calculations, simulations, and analyses). In sample size calculations, the direction is derived from the specified alternative; a specified directionUpper must agree with it.

twoSidedPower

For two-sided testing, if twoSidedPower = TRUE is specified the sample size calculation is performed by considering both tails of the distribution. Default is FALSE, i.e., it is assumed that one tail probability is equal to 0 or the power should be directed to one part.#'

Details

The fixed design represents a single-stage hypothesis test. The returned object can be used with the standard analysis and plotting helpers in the package. Typical use is to specify the type I error alpha and the desired type II error beta (or equivalently power = 1 - beta).

Value

Returns a TrialDesign object. The following generics (R generic functions) are available for this result object:

  • names() to obtain the field names,

  • print() to print the object,

  • summary() to display a summary of the object,

  • plot() to plot the object,

  • as.data.frame() to coerce the object to a data.frame,

  • as.matrix() to coerce the object to a matrix.

See Also

Other design functions: getDesignCharacteristics(), getDesignConditionalDunnett(), getDesignFisher(), getDesignGroupSequential(), getDesignInverseNormal(), getGroupSequentialProbabilities(), getPowerAndAverageSampleNumber()

Examples

# Basic fixed design with default alpha and beta
design <- getDesignFixed()
design

# Custom significance and power
design2 <- getDesignFixed(alpha = 0.05, beta = 0.1)
design2


rpact documentation built on Nov. 17, 2026, 1:07 a.m.