mr_ratio {comorbidPGS}R Documentation

Mendelian Randomization ratio method with external PGS

Description

mr_ratio() takes a distribution of PGS, an Exposure (Phenotype), an Outcome (Phenotype). Returns a data frame showing the Mendelian Randomization ratio methods using PGS

Usage

mr_ratio(
  df = NULL,
  prs_col = "SCORESUM",
  exposure_col = NA,
  outcome_col = NA,
  scale = TRUE,
  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,

  • two Phenotype columns (for Exposure and Outcome), can be numeric (Continuous Phenotype), character, boolean or factors (Discrete Phenotype)

prs_col

a character specifying the PGS column name

exposure_col

a character specifying the Exposure (Phenotype) column name

outcome_col

a character specifying the Outcome (Phenotype) column name

scale

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

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 with the Mendelian Randomization association result using the ratio method with the following columns:

Examples

result <- mr_ratio(
  df = comorbidData,
  prs_col = "ldl_PGS",
  exposure_col = "log_ldl",
  outcome_col = "bmi",
  scale = TRUE
)
print(result)


[Package comorbidPGS version 1.0.0 Index]