estimate_liability_single estimates the genetic component of the full liability and/or the full liability for a number of individuals based on their family history.

estimate_liability_single(
  .tbl = NULL,
  family_graphs = NULL,
  h2 = 0.5,
  pid = "PID",
  fam_id = "fam_ID",
  family_graphs_col = "fam_graph",
  role = NULL,
  out = c(1),
  tol = 0.01
)

Arguments

.tbl

A matrix, list or data frame that can be converted into a tibble. Must have at least five columns that hold the family identifier, the personal identifier, the role and the lower and upper thresholds. Note that the role must be one of the following abbreviations

  • g (Genetic component of full liability)

  • o (Full liability)

  • m (Mother)

  • f (Father)

  • c[0-9]*.[0-9]* (Children)

  • mgm (Maternal grandmother)

  • mgf (Maternal grandfather)

  • pgm (Paternal grandmother)

  • pgf (Paternal grandfather)

  • s[0-9]* (Full siblings)

  • mhs[0-9]* (Half-siblings - maternal side)

  • phs[0-9]* (Half-siblings - paternal side)

  • mau[0-9]* (Aunts/Uncles - maternal side)

  • pau[0-9]* (Aunts/Uncles - paternal side). Defaults to NULL.

family_graphs

A tibble with columns pid and family_graph_col. See prepare_graph for construction of the graphs. The family graphs Defaults to NULL.

h2

A number representing the heritability on liability scale for a single phenotype. Must be non-negative. Note that under the liability threshold model, the heritability must also be at most 1. Defaults to 0.5.

pid

A string holding the name of the column in .tbl (or family and threshs) that hold the personal identifier(s). Defaults to "PID".

fam_id

A string holding the name of the column in .tbl or family that holds the family identifier. Defaults to "fam_ID".

family_graphs_col

Name of column with family graphs in family_graphs. Defaults to "fam_graph".

role

A string holding the name of the column in .tbl that holds the role. Each role must be chosen from the following list of abbreviations

  • g (Genetic component of full liability)

  • o (Full liability)

  • m (Mother)

  • f (Father)

  • c[0-9]*.[0-9]* (Children)

  • mgm (Maternal grandmother)

  • mgf (Maternal grandfather)

  • pgm (Paternal grandmother)

  • pgf (Paternal grandfather)

  • s[0-9]* (Full siblings)

  • mhs[0-9]* (Half-siblings - maternal side)

  • phs[0-9]* (Half-siblings - paternal side)

  • mau[0-9]* (Aunts/Uncles - maternal side)

  • pau[0-9]* (Aunts/Uncles - paternal side). Defaults to "role".

out

A character or numeric vector indicating whether the genetic component of the full liability, the full liability or both should be returned. If out = c(1) or out = c("genetic"), the genetic liability is estimated and returned. If out = c(2) or out = c("full"), the full liability is estimated and returned. If out = c(1,2) or out = c("genetic", "full"), both components are estimated and returned. Defaults to c(1).

tol

A number that is used as the convergence criterion for the Gibbs sampler. Equals the standard error of the mean. That is, a tolerance of 0.2 means that the standard error of the mean is below 0.2. Defaults to 0.01.

Value

If family and threshs are two matrices, lists or data frames that can be converted into tibbles, if family has two columns named like the strings represented in pid and fam_id, if threshs has a column named like the string given in pid as well as a column named "lower" and a column named "upper" and if the liability-scale heritability h2, out, tol and always_add are of the required form, then the function returns a tibble with either four or six columns (depending on the length of out). The first two columns correspond to the columns fam_id and pid ' present in family. If out is equal to c(1) or c("genetic"), the third and fourth column hold the estimated genetic liability as well as the corresponding standard error, respectively. If out equals c(2) or c("full"), the third and fourth column hold the estimated full liability as well as the corresponding standard error, respectively. If out is equal to c(1,2) or c("genetic","full"), the third and fourth column hold the estimated genetic liability as well as the corresponding standard error, respectively, while the fifth and sixth column hold the estimated full liability as well as the corresponding standard error, respectively.

Details

This function can be used to estimate either the genetic component of the full liability, the full liability or both. It is possible to input either

Examples

sims <- simulate_under_LTM(fam_vec = c("m","f","s1"), n_fam = NULL, 
add_ind = TRUE, h2 = 0.5, n_sim=10, pop_prev = .05)
#
estimate_liability_single(.tbl = sims$thresholds, 
h2 = 0.5, pid = "indiv_ID", fam_id = "fam_ID", role = "role", out = c(1), 
tol = 0.01)
#> The number of workers is 1
#> # A tibble: 10 × 4
#>    fam_ID    indiv_ID  genetic_est genetic_se
#>    <chr>     <chr>           <dbl>      <dbl>
#>  1 fam_ID_1  fam_ID_1       1.01      0.00154
#>  2 fam_ID_2  fam_ID_2      -0.0254    0.00378
#>  3 fam_ID_3  fam_ID_3      -0.0292    0.00390
#>  4 fam_ID_4  fam_ID_4       0.441     0.00348
#>  5 fam_ID_5  fam_ID_5       0.910     0.00294
#>  6 fam_ID_6  fam_ID_6      -0.0325    0.00427
#>  7 fam_ID_7  fam_ID_7      -0.0236    0.00402
#>  8 fam_ID_8  fam_ID_8      -0.0263    0.00419
#>  9 fam_ID_9  fam_ID_9      -0.0470    0.00454
#> 10 fam_ID_10 fam_ID_10     -0.0375    0.00387
# 
sims <- simulate_under_LTM(fam_vec = c(), n_fam = NULL, add_ind = TRUE, 
h2 = 0.5, n_sim=10, pop_prev = .05)
#> Warning message: 
#>  Neither fam_vec nor n_fam is specified...
#
estimate_liability_single(.tbl = sims$thresholds, 
h2 = 0.5, pid = "indiv_ID", fam_id = "fam_ID", role = "role",
out = c("genetic"), tol = 0.01)
#> The number of workers is 1
#> # A tibble: 10 × 4
#>    fam_ID    indiv_ID  genetic_est genetic_se
#>    <chr>     <chr>           <dbl>      <dbl>
#>  1 fam_ID_1  fam_ID_1     -0.00516    0.00360
#>  2 fam_ID_2  fam_ID_2     -0.00403    0.00368
#>  3 fam_ID_3  fam_ID_3     -0.00443    0.00370
#>  4 fam_ID_4  fam_ID_4     -0.00536    0.00382
#>  5 fam_ID_5  fam_ID_5     -0.00340    0.00390
#>  6 fam_ID_6  fam_ID_6     -0.00118    0.00404
#>  7 fam_ID_7  fam_ID_7      0.00346    0.00404
#>  8 fam_ID_8  fam_ID_8     -0.00582    0.00380
#>  9 fam_ID_9  fam_ID_9     -0.00856    0.00383
#> 10 fam_ID_10 fam_ID_10     0.00222    0.00404