draw_sample_mixture: Draw Samples from a Gaussian Mixture Distribution

View source: R/draw_sample_mixture.R

draw_sample_mixtureR Documentation

Draw Samples from a Gaussian Mixture Distribution

Description

[Experimental]

Draws exemplary samples with a certain effect size for the sequential one-oway ANOVA or the sequential t-test, see Steinhilber et al. (2023) doi:10.31234/osf.io/m64ne

Usage

draw_sample_mixture(k_groups, f, max_n, counter_n = 100, verbose = FALSE)

Arguments

k_groups

number of groups (levels of factor_A)

f

Cohen's f. The simulated effect size.

max_n

sample size for the groups (total sample size = max_n*k_groups)

counter_n

number of times the function tries to find a possible parameter combination for the distribution. Default value is set to 100.

verbose

TRUE or FALSE. Print out more information about the internal process of sampling the parameters (the internal counter that was reached, some additional hints and the drawn parameters for the Gaussian Mixture distributions.)

Value

returns a data.frame with the columns y (observations) and x (factor_A).

Examples

set.seed(333)

data <- sprtt::draw_sample_mixture(
  k_groups = 2,
  f = 0.40,
  max_n = 2
)
data

data <- sprtt::draw_sample_mixture(
  k_groups = 4,
  f = 1.2, # very large effect size
  max_n = 4,
  counter_n = 1000, # increase of counter is necessary
  verbose = TRUE # prints more information to the console
)
data

sprtt documentation built on July 9, 2023, 6:14 p.m.