R.PCHISQ Function (Gnumeric)
Use Gnumeric R.PCHISQ for lower or upper chi-square probabilities. Check log output, real-valued degrees of freedom and zero endpoints.
Verification status: 19 reference, boundary and advanced-check formulas were recalculated with Gnumeric 1.12.57 ssconvert. Saved identities, the blank input and numerical results were independently checked. Gnumeric 1.12.62 was source-checked only. How formula examples are checked
Quick answer: =R.PCHISQ(0,2) gives 0 in Gnumeric 1.12.57.
Availability and version history
- Introduced: First release not established; present in the retained 1.12.57 source.
- Supported in: Gnumeric 1.12.62; no retirement is established.
- Scope: Desktop Gnumeric with its Statistical Functions From R plugin. English comma-separated formulas are shown.
- Checked: October 14, 2026. Tables and the named advanced check use 1.12.57 ssconvert. Current 1.12.62 source was inspected; that release was not executed.
What R.PCHISQ returns
R.PCHISQ returns a chi-square cumulative probability by default. Setting lower_tail to FALSE selects the right tail. This differs from a legacy function whose name may imply a fixed right-tail convention, so set the tail explicitly when translating formulas. Versioned function help.
Syntax and arguments
=R.PCHISQ(x,degrees_freedom[,lower_tail[,log_p]])
- x: cutoff; ordinary positive-degree models have lower-tail probability zero for x≤0.
- degrees_freedom: required positive real value; fractional values are used without integer truncation.
- lower_tail: optional TRUE; FALSE returns P(X>x).
- log_p: optional FALSE; TRUE returns the natural logarithm of the selected probability.
Brackets mark optional arguments; do not type them. Current worksheet implementation.
Reproducible examples
These self-contained formulas were recalculated natively. Ordinary-domain results were checked against independent mathematics; invalid-model observations are identified separately below. Results are rounded to twelve decimal places, or thirteen significant digits for small nonzero values. This is presentation precision, not a universal accuracy guarantee.
| Formula | Gnumeric 1.12.57 result |
|---|---|
=R.PCHISQ(0,2) |
0 |
=R.PCHISQ(2,2) |
0.632120558829 |
=R.PCHISQ(4,4) |
0.59399415029 |
=R.PCHISQ(6,6) |
0.576809918873 |
=R.PCHISQ(2,2.5) |
0.526211220357 |
=R.PCHISQ(2,2,FALSE()) |
0.367879441171 |
=R.PCHISQ(2,2,TRUE(),TRUE()) |
-0.458675145387 |
=R.PCHISQ(2,2,FALSE(),TRUE()) |
-1 |
Practical worksheet
At x=2 with 2 degrees of freedom, the lower tail is approximately 0.632120558829, and the upper tail is 0.367879441171. The upper-tail expression reduces to EXP(−1).
At x=4 with 4 degrees of freedom, the cumulative probability is approximately 0.593994150290. With x=2 and 2.5 degrees of freedom it is approximately 0.526211220357; substituting 2 or 3 degrees would change the model.
Advanced interpretation and checks
The chi-square CDF is the gamma CDF with shape ν/2 and scale 2. The saved advanced check compares these parameterizations at x=4 and ν=4.
A right-tail chi-square test can use =R.PCHISQ(statistic,df,FALSE()) when its model and degrees of freedom are appropriate. This function only evaluates the supplied distribution; it does not establish the test assumptions. For the x=2,ν=2 example, the log upper-tail probability is exactly −1 to the shown precision.
The saved advanced-check result for =R.PCHISQ(4,4)-R.PGAMMA(4,2,2) was 0.
Boundaries and troubleshooting
Require degrees_freedom>0 for the continuous distribution. The source’s zero-degree limit branch returned 0 at x=0 and 1 at x=1; those are not ordinary chi-square probabilities for a valid positive-degree model. Negative degrees produced #NUM!.
For valid degrees, log lower-tail probability at zero is −∞ and appears as #NUM!; log upper-tail probability there is 0. A blank cutoff is converted to zero. The boundary rows distinguish these cases from text and argument-count errors.
F5 is genuinely empty, rather than a cell containing an empty string. #NUM! can represent an unrepresentable infinite mathematical endpoint as well as an invalid numeric domain; the distinctions above matter.
| Formula | Gnumeric 1.12.57 result |
|---|---|
=R.PCHISQ(-1,2) |
0 |
=R.PCHISQ(1,0) |
1 |
=R.PCHISQ(0,0) |
0 |
=R.PCHISQ(1,-1) |
#NUM! |
=R.PCHISQ(0,2,TRUE(),TRUE()) |
#NUM! |
=R.PCHISQ(0,2,FALSE(),TRUE()) |
0 |
=R.PCHISQ("abc",2) |
#VALUE! |
=R.PCHISQ(F5,2) |
0 |
=R.PCHISQ(1) |
#N/A |
=R.PCHISQ(1,2,1,0,1) |
#N/A |
Official evidence and checking scope
- Current worksheet callback
- Tested-version worksheet callback
- Current pchisq calculation
- Tested-version pchisq calculation
- Current pgamma calculation
- Tested-version pgamma calculation
- Nonfinite worksheet-value handling
- Statistical Functions From R plugin declaration
The relevant complete worksheet callback and main calculation helper are unchanged between the inspected versions. That does not establish later-version numerical execution. Both stale and uncached SUM controls recalculated correctly. Native XML preserves the R.* identities. Secondary ODF export maps two-argument R.DCHISQ to CHISQDIST with FALSE, R.PCHISQ to CHISQDIST, and R.QCHISQ to CHISQINV; additional arguments retain ORG.GNUMERIC names. These storage mappings do not establish execution in another product. GUI entry, other locales and other spreadsheet products were not tested.