Learn R Programming

cases (version 0.2.0)

draw_data: Generate binary data

Description

Generate binary data

Usage

draw_data(
  n = 200,
  prev = c(0.5, 0.5),
  random = FALSE,
  m = 10,
  method = c("roc", "lfc", "pr"),
  pars = list(),
  ...
)

Value

(matrix)
generated binary data (possibly stratified for subgroups)

Arguments

n

(numeric)
integer, overall sample size

prev

(numeric)
vector of class prevalences (adding up to 1)

random

(logical)
random sampling (TRUE) or fixed group sample sizes (FALSE)

m

(numeric)
integer, number of models

method

(character)
either "roc", "lfc" (multiple subgroups) or "prob" (no subgroups)

pars

(list)
containing further named parameters passed to draw_data_roc, draw_data_lfc

...

(any)
further named parameters passed

Examples

Run this code
draw_data()

Run the code above in your browser using DataLab