> On 19 May 2026, at 15.25, Kurt Hornik <[email protected]> wrote:
> 
>>>>>> Martin Maechler writes:
> 
>>>>>> Stephanie Evert 
>>>>>>    on Sun, 17 May 2026 09:03:52 +0200 writes:
> 
>>>> I will revise my feature request to "have an
>>>> easily-discoverable fast p-value-only calculation" for
>>>> those who aren't using the odds ratio or confidence
>>>> interval.
> 
>>> fisher.pval() in the "corpora" package.
> 
>>> Best, Steph
> 
>> Thank you Steph;
> 
>> However, I still agree with Chris  that it would be nice to have
>> an easy way to basically just get the p-value, in a case where
>> neither the ESTIMATE nor the confidence interval is needed.
> 
>> Indeed, I've not unfrequently seen R code snippets
> 
>> <some>.test(.........)$p.value
> 
>> also in CRAN package R code  and I think  base R should provide
>> a simple documented way to get only the pvalue in cases where
>> the full test costs a factor of 1000 more,  even if is still
>> only microseconds in case of small data sets.
> 
>> My svn commit to the  R sources, > 22 years ago (!)
> 
>>   r29551 | maechler | 2004-05-24 21:34 |
> 
>> did introduce the optional argument 'conf.int = TRUE' for the
>> 2x2 case _and_ the  NEWS entry (of svn rev 29551) has been
> 
>>> o   fisher.test(*, conf.int=FALSE) allows to skip the confidence interval 
>>> computation
> 
>> However, Chris is (indirectly) correct -- he did not mention the
>> 'conf.int' option -- but in this very large case,  conf.int=FALSE
>> does not help much, as indeed, the unconditionalized
> 
>>     logdc <- dhyper(support, m, n, k, log = TRUE)
> 
>> is already expensive, and also the computation of the sample OR (odds ratio)
> 
>>     ESTIMATE <- mle(x)
> 
>> is costly.  Indeed, I will add a new argument to  fisher.test()  to allow 
>> skipping
>> the expensive parts and get the p.value and *still* a valid result
>> of class "htest".
>> For now, this will only be fast when as by default the null
>> hypothesis is  `or = 1`
> 
> Perhaps we could simply take `or = NULL` or `or = NA` to say "do not
> even estimate the OR"?
> 

Hm, no. A simple testonly=TRUE would be better. Double-dutying an argument just 
makes it trickier to explain. And you might actually want to get the p-value 
for other values of OR.

-p


> -k
> 
>> Martin Maechler
> 
>> ______________________________________________
>> [email protected] mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
> 
> ______________________________________________
> [email protected] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel


-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: [email protected]  Priv: [email protected]

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to