generate_data: Generate Data

Description Usage Arguments Value Examples

View source: R/generate_data.R

Description

Generate Data

Usage

1
2
3
4
5
6
generate_data(
  seed = 1,
  n01_all = c(800, 800),
  data_generation = list(dist = "t-distribution", sigma = list(class_0 = diag(5),
    class_1 = diag(5)), df = c(10, 10), delta = c(rep(0, 5), rep(2, 5)))
)

Arguments

seed

the seed number

n01_all

size of all data labeled as class 0/1. For example, n01_all=c(800,800) represents that the size of all data labeled as class 0 is 800 and the size of all data labeled as class 1 is also 800.

data_generation

a parameter list that you can tell the function about the distribution and parameters you want to use to generate the data.

  • "gaussian" represent multivariate gaussian distribution. see mvrnorm in MASS package. For example, data_generation=list(dist="gaussian",sigma=list(class_0=diag(5),class_1=diag(5)),mu=c(rep(0,5),rep(2,5)))

  • "t-distribution" represent multivariate t distribution. see rmvt in mvtnorm package. For example, data_generation=list(dist="t-distribution",sigma=list(class_0=diag(5),class_1=diag(5)),df=c(10,10),delta=c(rep(0,5),rep(2,5)))

Value

the generated data

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
df = 10
rho = 0.5
d = 5
delta = rep(2, d)
H <- abs(outer(1:d, 1:d, "-"))
covxx = rho^H
data = generate_data(seed = 1, n01_all = c(800, 800),
    data_generation = list(dist = "t-distribution", sigma = list(class_0 = covxx,
        class_1 = covxx), df = c(10, 10), delta = c(rep(0,
        5), rep(2, 5))))

ShudongSun/Sample-Size-Determination documentation built on Feb. 10, 2022, 1:33 a.m.