Skip to contents

One latent genotype, ZD, for true donor (D) and one latent genotype, ZS, for suspect (S).

Usage

sample_data_Hd_wTwR(n, wT, wR, p, ...)

Arguments

n

number of samples

wT

error probability for donor sample

wR

error probability for PoI sample

p

list of genotype probabilities (length is number of loci) or vector of length 3 for single locus

...

Passed on to add_errors_to_genotypes()

Value

list of two matrices, each of size n x loci with genotype in 0/1/2 format resembling the situation in real life.

Examples

sample_data_Hd_wTwR(n = 10, wT = 0.3, wR = 1e-6, p = c(0.25, 0.25, 0.5))
#> $xT
#>       [,1]
#>  [1,]    0
#>  [2,]    2
#>  [3,]    2
#>  [4,]    1
#>  [5,]    1
#>  [6,]    1
#>  [7,]    1
#>  [8,]    1
#>  [9,]    1
#> [10,]    2
#> 
#> $xR
#>       [,1]
#>  [1,]    0
#>  [2,]    2
#>  [3,]    0
#>  [4,]    0
#>  [5,]    1
#>  [6,]    2
#>  [7,]    0
#>  [8,]    0
#>  [9,]    1
#> [10,]    0
#> 
sample_data_Hd_wTwR(n = 10, wT = 0.3, wR = 1e-6, p = list(
  c(0.25, 0.25, 0.5), c(0.1, 0.8, 0.1)))
#> $xT
#>       [,1] [,2]
#>  [1,]    2    1
#>  [2,]    2    0
#>  [3,]    0    1
#>  [4,]    0    1
#>  [5,]    0    2
#>  [6,]    2    0
#>  [7,]    0    1
#>  [8,]    1    2
#>  [9,]    1    1
#> [10,]    0    1
#> 
#> $xR
#>       [,1] [,2]
#>  [1,]    2    2
#>  [2,]    2    1
#>  [3,]    1    1
#>  [4,]    2    1
#>  [5,]    2    1
#>  [6,]    2    1
#>  [7,]    0    1
#>  [8,]    1    1
#>  [9,]    1    1
#> [10,]    2    1
#> 
  
cases <- sample_data_Hd_wTwR(n = 1000, wT = 1e-1, wR = 1e-8, p = c(0.25, 0.25, 0.5))
tab <- table(xT = cases$xT, xR = cases$xR)
tab
#>    xR
#> xT    0   1   2
#>   0  62  45  94
#>   1  91  87 165
#>   2 114 122 220

cases <- sample_data_Hd_wTwR(n = 1000, wT = 0, wR = 0, p = c(0.25, 0.25, 0.5))
tab <- table(xT = cases$xT, xR = cases$xR)
tab
#>    xR
#> xT    0   1   2
#>   0  69  68 108
#>   1  64  60 112
#>   2 123 128 268