| get_relatedness {LTFHPlus} | R Documentation |
Relatedness between a pair of family members
Description
get_relatedness returns the relatedness times the
liability-scale heritability for a pair of family members
Usage
get_relatedness(s1, s2, h2 = 0.5, from_covmat = FALSE)
Arguments
s1, s2 |
Strings representing the two family members. The strings must be chosen from the following list of strings:
|
h2 |
A number representing the squared heritability on liability scale. Must be non-negative and at most 1. Defaults to 0.5 |
from_covmat |
logical variable. Only used internally. allows for skip of negative check. |
Details
This function can be used to get the percentage of shared
DNA times the liability-scale heritability h^2 for two family members.
Value
If both s1 and s2 are strings chosen from the mentioned
list of strings and h2 is a number satisfying 0 \leq h2 \leq 1,
then the output will be a number that equals the percentage of shared
DNA between s1 and s2 times the squared heritability h2.
Note
If you are only interested in the percentage of shared DNA, set h2 = 1.
Examples
get_relatedness("g","o")
get_relatedness("g","f", h2 = 1)
get_relatedness("o","s", h2 = 0.3)
# This will result in errors:
try(get_relatedness("a","b"))
try(get_relatedness(m, mhs))