get_data: Simulate Data Based on a Binomial Distribution

View source: R/get_data.R

get_dataR Documentation

Simulate Data Based on a Binomial Distribution

Description

Simulate Data Based on a Binomial Distribution

Usage

get_data(k, n, p, iter, type = c("matrix", "bhmbasket"))

Arguments

k

The number of baskets.

n

The sample sizes of the baskets. A vector must be used for varying sample sizes.

p

Probabilities used to simulate the data

iter

The number of iterations in the simulation. Is ignored if data is specified.

type

Type of output. Use bhmbasket for the BHM and EXNED design and matrix for everything else.

Details

For type = "bhmbasket" this is simply a wraper for bhmbasket::simulateScenarios.

Value

If type = "matrix" then a matrix is returned, if type = "bhmbasket" then an element with class scenario_list.

Examples

# Equal sample sizes
get_data(k = 3, n = 20, p = c(0.2, 0.2, 0.5), iter = 1000,
  type = "matrix")

# Unequal sample sizes
get_data(k = 3, n = c(15, 20, 25), p = c(0.2, 0.2, 0.5),
  iter = 1000, type = "matrix")

basksim documentation built on May 12, 2026, 9:08 a.m.