R.PTUKEY Function (Gnumeric)
Use Gnumeric R.PTUKEY for Studentized-range probabilities, with upper tails, multiple ranges, native examples and the large-df approximation explained.
Verification status: 23 selected reference, boundary and advanced-check expressions were recalculated with Gnumeric 1.12.57 ssconvert. Saved identities, the blank input and results were independently checked. Gnumeric 1.12.62 was source-checked only. How formula examples are checked
Large-df approximation: the inspected implementation replaces the finite-df calculation with its infinite-df limit when df exceeds 25,000. The table preserves the resulting difference at df = 30,000.
Quick answer: =R.PTUKEY(3,2,10) gives 0.940109675574 in Gnumeric 1.12.57.
Availability and version history
- Introduced: Introduced in Gnumeric 1.12.3 release notes.
- 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.PTUKEY returns
R.PTUKEY returns the probability that a Studentized range is at most x. For one range, this is the difference between the largest and smallest of nmeans independent standard-normal variables, divided by an independent estimate of their common standard deviation. It is a range-distribution calculation, not a Student t CDF. With several ranges, the implementation takes the maximum across those ranges using one shared denominator. Versioned function help.
Syntax and arguments
=R.PTUKEY(x,nmeans,df[,nranges[,lower_tail[,log_p]]])
| Argument | Meaning |
|---|---|
x |
Nonnegative Studentized-range statistic; the lower tail is zero for nonpositive values. |
nmeans |
Number of means; use an integer at least 2 for the statistical model. |
df |
Degrees of freedom of the variance estimate; this implementation requires at least 2 for positive x. |
nranges |
Number of ranges sharing the denominator; defaults to 1. Use a positive integer for the model. |
lower_tail |
Defaults to TRUE; FALSE requests the upper-tail probability. |
log_p |
Defaults to FALSE; TRUE returns the natural logarithm of the selected probability. |
Brackets mark optional arguments; do not type them. Current worksheet implementation.
Reproducible examples
The native column comes from saved recalculated formulas. The separate reference column evaluates the stated mathematical model, preserving approximation differences. Results are rounded to twelve decimal places, or thirteen significant digits for small nonzero values; printed precision is not a universal accuracy guarantee.
| Formula | Gnumeric 1.12.57 result | Independent mathematical reference |
|---|---|---|
=R.PTUKEY(3,2,10) |
0.940109675574 |
0.940109675574 |
=R.PTUKEY(3,3,10) |
0.86501658481 |
0.86501658481 |
=R.PTUKEY(3,5,10) |
0.717013452024 |
0.717013452024 |
=R.PTUKEY(3,3,10,2) |
0.762326010511 |
0.762326010511 |
=R.PTUKEY(3,3,10,1,FALSE()) |
0.13498341519 |
0.13498341519 |
=R.PTUKEY(3,3,10,1,TRUE(),TRUE()) |
-0.145006599043 |
-0.145006599043 |
=R.PTUKEY(3,3,30000) |
0.914457428345 |
0.914440370706 |
=R.PTUKEY(0,3,10) |
0 |
0 |
Practical worksheet
For an equal-size comparison, suppose the largest minus smallest group mean is 4, the pooled mean square is 16, and each group contains 9 observations. The statistic is =4/SQRT(16/9), which is 3. With three means and 10 residual degrees of freedom, =R.PTUKEY(3,3,10,1,FALSE()) gives about 0.134983415190. This worksheet calculation assumes independent normal errors and a justified common variance estimate; the function does not check those assumptions or construct the pooled estimate.
Store the statistic in A2, number of means in B2 and residual df in C2, then use =R.PTUKEY(A2,B2,C2,1,FALSE()). The cell layout is a reproducible recipe; the table contains the equivalent direct formulas.
Advanced interpretation and checks
The optional range count cannot generally be implemented by squaring a one-range result. At x = 3, three means and df = 10, two ranges give 0.762326010511, whereas the square of the one-range CDF is about 0.748253691997. The difference is about 0.014072318514, because both ranges use the same random variance estimate.
For two means and one range, the CDF equals 2*F_t(x/SQRT(2),df)-1. This provides a separate mathematical check. At df = 30,000, the exact finite-df reference for x = 3 and three means is about 0.914440370706; the native result is about 0.914457428345. Twelve printed decimals do not mean twelve accurate decimals in that approximation branch.
The saved advanced-check result for =R.PTUKEY(3,3,10,2)-R.PTUKEY(3,3,10)^2 was 0.014072318514.
Boundaries and troubleshooting
Positive x with nmeans below 2, df below 2 or nranges below 1 produced #NUM!. Nonpositive x is handled first: =R.PTUKEY(0,1,1,0) returned zero despite invalid model parameters. Validate the parameters independently. Fractional nmeans and nranges are accepted by the numerical formula but do not describe literal fractional counts of means or ranges.
Numeric text was converted, nonnumeric text produced #VALUE!, and the empty reference acted as zero. Too few or too many arguments produced #N/A in this test. These checks concern the selected scalar formulas, not every text or Boolean coercion.
F5 is genuinely empty, rather than a cell containing an empty string.
| Formula | Gnumeric 1.12.57 result |
|---|---|
=R.PTUKEY(-1,3,10) |
0 |
=R.PTUKEY(0,1,1,0) |
0 |
=R.PTUKEY(3,1,10) |
#NUM! |
=R.PTUKEY(3,3,1) |
#NUM! |
=R.PTUKEY(3,3,10,0) |
#NUM! |
=R.PTUKEY(3,2.5,10) |
0.903260742127 |
=R.PTUKEY(3,3,2.5) |
0.743939920344 |
=R.PTUKEY(3,3,10,1.5) |
0.810433034457 |
=R.PTUKEY(3,3,10,1,FALSE(),TRUE()) |
-2.002603358538 |
=R.PTUKEY("3",3,10) |
0.86501658481 |
=R.PTUKEY("abc",3,10) |
#VALUE! |
=R.PTUKEY(F5,3,10) |
0 |
=R.PTUKEY(3,3) |
#N/A |
=R.PTUKEY(3,3,10,1,1,0,1) |
#N/A |
Official evidence and checking scope
- Current worksheet callback
- Tested-version worksheet callback
- Current R_ptukey calculation
- Tested-version R_ptukey calculation
- Current ptukey_wprob calculation
- Tested-version ptukey_wprob calculation
- Nonfinite worksheet-value handling
- Statistical Functions From R plugin declaration
The complete callback and inspected calculation helpers are unchanged between these source versions. Both stale and uncached SUM controls recalculated correctly. Native XML retains the function identities; secondary ODF export does not establish execution in another product. GUI entry, other locales and newer-release numerical behavior were not tested.