donors_df: A data frame with donors caracheristics

View source: R/sim_df.R

donors_dfR Documentation

A data frame with donors caracheristics

Description

Returns a data frame for simulated donors clinical and demographic caracheristics.

Usage

donors_df(
  n = 10,
  replace = TRUE,
  origin = "PT",
  probs = c(0.4658, 0.0343, 0.077, 0.4229),
  lower = 18,
  upper = 75,
  mean = 60,
  sd = 12,
  uk = FALSE,
  n_seed = 3
)

Arguments

n

An integer to define the number of rows

replace

A logical value for sampling with replacement

origin

A character value for population origin from options: 'PT', 'API', 'AFA', 'CAU' and 'HIS'

probs

A vector with the probabilities for blood group A, AB, B and O (in this order). The sum of the probabilities must be equal to one.

lower

An integer for ages' lower limit.

upper

An integer for ages' upper limit.

mean

A value for mean's distribution.

sd

A value for standar deviation's distribution.

uk

A logical value, if TRUE is also computed the Donor Risk Index (DRI)

n_seed

a numeric seed that will be used for random number generation.

Value

A data frame with HLA typing, blood group and truncated ages for a simulated group of transplant donors.

Examples

donors_df(n = 10, replace = TRUE, origin = 'PT',
probs = c(0.4658, 0.0343, 0.077, 0.4229),
lower=18, upper=75, mean = 55, sd = 15,
uk = FALSE, n_seed = 3)

balima78/simK documentation built on May 23, 2023, 5:02 p.m.