odds2pq: Calculate p-values and q-values for odds

View source: R/oddscores.R

odds2pqR Documentation

Calculate p-values and q-values for odds

Description

Returns a data frame with p-values and q-values for a vector of odds. When using log odds, it keeps the p-values and q-values in the same log base.

Usage

odds2pq(odds, log = 10)

Arguments

odds

Numeric vector. List of odds

log

Integer or logical. Are the odds log-transformed or not? If not, specify FALSE. If TRUE, the odds are presumed to be transformed by the natural logarithm. Default = 10

Value

Returns a data frame with the odds, the p-values and the q-values

Note

The function basically calculates the probability of something being more extreme than the corresponding odds. Conversion uses the formula p = odds/(1+odds) or 1 - odds/(1+odds) if odds are higher than 1. The resulting value is multiplied by 2 to correct for 2-sided testing. For log odds, the absolute log value is subtracted from the log of 2 using the corresponding log base. Though not exact, this is a very close approximation with high or low odds, which is what this analysis is meant for. If you require precise answers or are interested in p-values of weak odds, use non-transformed odds and specify log = FALSE.

Author(s)

Jos B. Poell

See Also

oddscores, geneodds


tgac-vumc/CSSA documentation built on Oct. 10, 2022, 7:27 p.m.