plot_p_histogram: Function to plot P histogram

View source: R/plots.R

plot_p_histogramR Documentation

Function to plot P histogram

Description

If no associations are found, by definition the pvalues should come from a uniform distribution. This can be checked with the function below.

Usage

plot_p_histogram(
  data,
  p_value = "p.value",
  title.to.plot = "P-values of the association study",
  gamma.hat = 1
)

Arguments

data

dataframe to use

p_value

character string. name of column containing p values

title.to.plot

title of the plot to produce

gamma.hat

gamma hat to use. Standard set to 1. In future versions, this value could be changed in order to get more accurate detection of associations.

Value

histogram

Examples

# Create random P values, possible result of an association study
pvals_data <- data.frame(
"p.value" = c(runif(1000, 0, .99999), runif(250, 1.0e-11, 1.0e-8))
)
plot_p_histogram(pvals_data)

LDSamson/associationstudies documentation built on April 14, 2025, 11:52 a.m.