I am using the pchisq
function in R to calculate the cumulative distribution function for the chi-squared distribution. I would like to calculate very small values, such that 1-pchisq(...)
can have a value smaller than 2.2e-16 (which is the numerical precision limit for R's numeric format). Right now, these very small values simply become 0.
Things I've tried:
Setting the digits display option to 22 (max)
Using the
Rmpfr
package for increased precision, but that number format doesn't work with thepchisq
functionBreaking the CDF function into its component gamma functions, but that results in similar precision limits. Any ideas on how I can calculate what I want?
Background: I'm using Fisher's method to combine a bunch of p-values. Yes, I know these p-values are minuscule, but it is actually useful for what I'm analyzing.