assoc {comorbidPGS}R Documentation

Association of a PGS distribution with a Phenotype

Description

assoc() take a distribution of PGS, a Phenotype and eventual Confounders return a data frame showing the association of PGS on the Phenotype

Usage

assoc(
  df = NULL,
  prs_col = "SCORESUM",
  phenotype_col = "Phenotype",
  scale = TRUE,
  covar_col = NA,
  verbose = TRUE,
  log = ""
)

Arguments

df

a dataframe with individuals on each row, and at least the following columns:

  • one ID column,

  • one PGS column, with numerical continuous values following a normal distribution,

  • one Phenotype column, can be numeric (Continuous Phenotype), character, boolean or factors (Discrete Phenotype)

prs_col

a character specifying the PGS column name

phenotype_col

a character specifying the Phenotype column name

scale

a boolean specifying if scaling of PGS should be done before testing

covar_col

a character vector specifying the covariate column names (facultative)

verbose

a boolean (TRUE by default) to write in the console/log messages.

log

a connection, or a character string naming the file to print to. If "" (by default), it prints to the standard output connection, the console unless redirected by sink.

Value

return a data frame showing the association of the PGS on the Phenotype with the following columns:

Examples

results <- assoc(
  df = comorbidData,
  prs_col = "ldl_PGS",
  phenotype_col = "log_ldl",
  scale = TRUE,
  covar_col = c("age", "sex", "gen_array")
)
print(results)


[Package comorbidPGS version 0.3.4 Index]