Learn R Programming

cases (version 0.2.0)

draw_data_lfc: Generate binary data (LFC model)

Description

Generate binary data (LFC model)

Usage

draw_data_lfc(
  n = 100,
  prev = c(0.5, 0.5),
  random = FALSE,
  m = 10,
  se = 0.8,
  sp = 0.8,
  B = round(m/2),
  L = 1,
  Rse = diag(rep(1, m)),
  Rsp = diag(rep(1, m)),
  modnames = paste0("model", 1:m),
  ...
)

Value

(list)
list of matrices including generated binary datasets (1: correct prediction, 0: incorrect prediction) for each subgroup (specificity, sensitivity)

Arguments

n

(numeric)
integer, total sample size

prev

(numeric)
disease and healthy prevalence (length 2, adds up to 1)

random

(logical)
random sampling (TRUE) or fixed prevalence (FALSE)

m

(numeric)
integer, number of models

se

(numeric)
sensitivity (length 1)

sp

(numeric)
specificity (length 1)

B

(numeric)
integer, between 1 and m, specifies how many sensitivity values are projected to 1

L

(numeric)
worst alternative is computed under side condition Acc <= L (default value L=1 corresponds to true LFC where values are projected to 1)

Rse

(matrix)
correlation matrix for empirical sensitivities (m x m)

Rsp

(maxtrix)
correlation matrix for empirical specificities (m x m)

modnames

(modnames)
character, model names (length m)

...

(any)
further arguments (currently unused)

Examples

Run this code
data <- draw_data_lfc()
head(data)

Run the code above in your browser using DataLab