allPairsLR: LR calculations

Description Usage Arguments Value Author(s) References Examples

View source: R/allPairsLR.R

Description

Calculate LR between pairs of non-inbred individuals. The kappa for the numerator and denominator hypothesis are specified by user.

Usage

1
2
3
4
5
6
7
allPairsLR(
  x,
  kNumerator = c(0, 0),
  kDenominator = c(1, 0),
  ids = NULL,
  markers = NULL
)

Arguments

x

A 'ped' object or a list of such.

kNumerator

Double of length 2, kappa0 and kappa2 for numerator hypothesis

kDenominator

Double of length 2, kappa0 and kappa2 denominator hypothesis

ids

Either a vector with ID labels, or a data frame/matrix with two columns, where each row contains the ID labels of two individuals. The entries are coerced to characters, and must match uniquely against the ID labels of 'x'. If 'ids' is a vector, it is converted to a matrix containing all pairs. By default, all individuals of 'x' are included.

markers

A numeric indicating which marker(s) to include. If NULL (default), all markers are used.

Value

A data frame with 6 columns: 'ID1', 'ID2', 'N' (the number of markers with no missing alleles), 'loglik(Numerator)', 'loglik(Numerator)' and 'LR'.

Author(s)

Thore Egeland and Magnus Dehli Vigeland

References

To appear

Examples

1
2
3
4
5
6
7
8
### Example 1
library(forrel)
x = nuclearPed(2)
#' # Simluate 200 equifrequent SNPs
x = markerSim(x, N = 200, alleles = 1:2, verbose = FALSE)

# Parent offspring against unrelated
PO = allPairsLR(x, ids = NULL, kNumerator = c(0,0), kDenominator = c(1,0))

thoree/inbred documentation built on March 28, 2021, 7:42 p.m.