qqchisq1: Creates a Q-Q plot from chi-squared statistics

View source: R/qq.R

qqchisq1R Documentation

Creates a Q-Q plot from chi-squared statistics

Description

Accepts \chi^2 test statistics as input and converts them to -\log_{10}(p) values assuming 1 degree of freedom. The conversion uses log-space computation via pchisq(..., log.p = TRUE), which avoids floating-point underflow for very large test statistics and is numerically precise well beyond .Machine$double.xmin. Produces the same style of plot as qq and qqlog.

Usage

qqchisq1(chisq_vector, ...)

Arguments

chisq_vector

A numeric vector of \chi^2 statistics (non-negative). Negative, infinite, NA, and NaN values are excluded.

...

Other arguments passed to plot()

Value

No return value, called for plotting side effects.

Examples

chisq_vals <- stats::rchisq(1e5, df = 1)
qqchisq1(chisq_vals)

fastqq documentation built on March 13, 2026, 9:08 a.m.