### Example 1: Comparing the power of 3 reference families ###
# Frequencies for 2 STR markers
db = NorwegianFrequencies[1:2] # Increase!
# Define pedigrees and simulate data
PAR = nuclearPed(1, child = "MP") |>
profileSim(markers = db, ids = 1)
SIB = nuclearPed(2) |> relabel(old = 4, new = "MP") |>
profileSim(markers = db, ids = 3)
GRA = linearPed(2) |> relabel(old = 5, new = "MP") |>
profileSim(markers = db, ids = 1)
# Collect in list and plot
peds = list(PAR = PAR, SIB = SIB, GRA = GRA)
plotPedList(peds, marker = 1, hatched = typedMembers, frames = FALSE,
col = list(red = "MP"))
# Compute exclusion/inclusion powers:
ep = lapply(peds, function(y)
missingPersonEP(y, missing = "MP", verbose = FALSE))
ip = lapply(peds, function(y) # increase nsim!
missingPersonIP(y, missing = "MP", nsim = 5, threshold = 10, verbose = FALSE))
# Plot
powerPlot(ep, ip, size = 2)
# Different plot type, not dependent of `threshold`
powerPlot(ep, ip, size = 2, type = 3)
# \donttest{
### Example 2: Exploring powers for different sets of available relatives
# Create trio pedigree
ref = nuclearPed(father = "fa", mother = "mo", child = "MP")
# Add empty marker with 5 alleles
ref = addMarker(ref, alleles = 1:5)
# Alternatives for genotyping
sel = list("fa", c("fa", "mo"))
# Simulate power for each selection
simData = MPPsims(ref, selections = sel, nProfiles = 3, lrSims = 5,
thresholdIP = 2, seed = 123, numCores = 1)
# Power plot 1: EP vs IP
powerPlot(simData, type = 1)
powerPlot(simData, type = 1, minorpoints = FALSE, hline = 0.8)
# }
# \donttest{
# Change shape, and modify legend order
powerPlot(simData[3:1], type = 1, shape = c("ci", "sq", "di"))
# Zoom in, and add threshold lines
powerPlot(simData, type = 1, xlim = c(0.2, 1), ylim = c(0.5, 1),
hline = 0.8, vline = 0.8)
# Power plot 3: Expected number of exclusions vs E[log LR]
powerPlot(simData, type = 3)
# With horizontal/vertical lines
powerPlot(simData, type = 3, hline = log10(2), vline = 1)
# Plot 4: Illustrating the general inequality ELR > 1/(1-EP)
powerPlot(simData, type = 4)
# }
Run the code above in your browser using DataLab