centileplot {comorbidPGS}R Documentation

Centiles Plot from a PGS Association

Description

centileplot() take a distribution of PGS, a Phenotype and eventual Confounders return a plot (ggplot2 object) with centiles (or deciles if not enough individuals) of PGS in x and Prevalence/Median/Mean of the Phenotype in y

Usage

centileplot(
  df = NULL,
  prs_col = "SCORESUM",
  phenotype_col = "Phenotype",
  decile = FALSE,
  continuous_metric = NA
)

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

decile

a boolean specifying if centiles or deciles should be used

continuous_metric

a facultative character specifying what metric to use for continuous Phenotype, only three options: NA, "median" or "mean"

Value

return a figure of results in the format ggplot2 object


[Package comorbidPGS version 0.3.4 Index]