designFreqT: Design a Frequentist T-Test

View source: R/tTest.R

designFreqTR Documentation

Design a Frequentist T-Test

Description

Computes the number of samples necessary to reach a tolerable type I and desired power for the frequentist T-test.

Usage

designFreqT(
  deltaMin,
  alpha = 0.05,
  power = 0.8,
  alternative = c("twoSided", "greater", "less"),
  h0 = 0,
  testType = c("oneSample", "paired", "twoSample"),
  ...
)

Arguments

deltaMin

numeric that defines the minimal relevant standardised mean difference, the smallest population effect size that we would like to detect (with sufficient power).

alpha

numeric in (0, 1) that specifies the tolerable type I error and the null rejection rule e >= 1/alpha.

power

numeric in (0, 1) that specifies the desired power, that is, the targetted chance to stop in favour of the alternative over the null hypothesis, when the alternative holds true. Note that prior to version 0.8.8 power <- 1-beta. The "beta" argument does not need to be specified anymore.

alternative

a character string specifying the alternative hypothesis. Must be one of "twoSided" (default), "greater" or "less".

h0

numeric, representing the null value, default h0=0.

testType

either one of "oneSample", "paired", "twoSample".

...

further arguments to be passed to or from methods, but mainly to perform do.calls.

Value

Returns an object of class 'freqTDesign'. An object of class 'freqTDesign' is a list containing at least the following components:

nPlan

the planned sample size(s).

esMin

the minimal clinically relevant standardised effect size provided by the user.

alpha

the tolerable type I error provided by the user.

power

the desired power provided by the user.

lowN

the smallest n of the search space for n provided by the user.

highN

the largest n of the search space for n provided by the user.

testType

any of "oneSample", "paired", "twoSample" provided by the user.

alternative

any of "twoSided", "greater", "less" provided by the user.

Examples

designFreqT(0.5)

safestats documentation built on Sept. 6, 2026, 1:06 a.m.