generateNormalData: Generates Normally Distributed Data Depending on the Design

View source: R/tTest.R

generateNormalDataR Documentation

Generates Normally Distributed Data Depending on the Design

Description

The designs supported are "oneSample", "paired", "twoSample".

Usage

generateNormalData(
  nPlan,
  nSim = 1000L,
  deltaTrue = NULL,
  muGlobal = 0,
  sigma = 1,
  sigma2 = 1,
  paired = FALSE,
  seed = NULL,
  meanDiffTrue = NULL
)

Arguments

nPlan

optional numeric vector of length at most 2, see scenario 2 and 3 above.

nSim

integer > 0, the number of simulations needed to compute power or the number of samples paths for the savi t test under continuous monitoring.

deltaTrue

numeric, the value of the true standardised effect size (test-relevant parameter). This argument is used by designSaviT() with deltaTrue <- deltaMin

muGlobal

numeric, population grand mean

sigma

numeric > 0, population standard deviation

sigma2

numeric > 0 representing the population standard deviation used for the test, for the second group in a two-sample t-test

paired

a logical, if TRUE then pair the data.

seed

integer, seed number.

meanDiffTrue

numeric, data governing parameter value

Value

Returns a list of two data matrices contains at least the following components:

dataGroup1

a matrix of data dimension nSim by nPlan[1].

dataGroup2

a matrix of data dimension nSim by nPlan[2].

Examples

generateNormalData(20, 15, deltaTrue=0.3)

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