s-news
[Top] [All Lists]

Re: Exact p-values

To: "Spencer Graves" <spencer.graves@PDF.COM>
Subject: Re: Exact p-values
From: "David Smith" <dsmith@insightful.com>
Date: Thu, 13 Feb 2003 09:29:42 -0800
Cc: "S-News (E-mail)" <s-news@wubios.wustl.edu>
Thread-index: AcLTgx5mNr7TPNwpQzWKcs5SuKo1xwAAgTxg
Thread-topic: [S] Exact p-values
>  For example, pt(-1, Inf) = 0.5 in S-Plus 6.1, but 0.159 in 
> R;  clearly, 
> S-Plus gives a wrong answer without warning.  

I wasn't aware of this issue. However, for large, non-infinite values of df pt 
does give a sensible answer; it's only for the pathological case that it fails.

Nonetheless, I have asked for this issue to be fixed for the next version.

If you're aware of any other areas where the distribution functions have 
problems, please do let me know.

# David

-- 
David M Smith <dsmith@insightful.com>
Product Manager, Insightful Corp, Seattle WA
Tel: +1 (206) 802 2360
Fax: +1 (206) 283 6310

Insightful Corporation (www.insightful.com) provides analytical solutions for 
text and data using S-PLUS, Insightful Miner, InFact and consulting services. 

> -----Original Message-----
> From: Spencer Graves [mailto:spencer.graves@PDF.COM]
> Sent: Thursday, February 13, 2003 9:12 AM
> To: Jose María Fedriani Laffitte
> Cc: s-news@lists.biostat.wustl.edu
> Subject: Re: [S] Exact p-values
> 
> 
> 
> Try ( 1-pchisq(29.8, df=1)):  With S-Plus 6.1, I got  4.78992e-008.  
> 
>          By the way, the distribtion functions in R have more 
> arguments. 
>  For example,  pchisq(29.8, df=1, lower.tail=F) produces the same 
> answer, and pchisq(29.8, df=1, lower.tail=F, log=T) produces 
> its natural 
> logarithm.  Also, pchisq, dchisq, qchisq, and rchisq in R all have an 
> "ncp" noncentrality parameter argument;  only pchisq has such 
> in S-Plus 
> 6.1.  Similarly, none of the Student's t functions in S-Plus have a 
> non-centralitity parameter;  in R, pt has an argument ncp, 
> and from this 
> one can easily program ncp for dt, qt and rt.  Also, the distribution 
> functions in the current release of S-Plus are known to have 
> problems. 
>  For example, pt(-1, Inf) = 0.5 in S-Plus 6.1, but 0.159 in 
> R;  clearly, 
> S-Plus gives a wrong answer without warning.  
> 
> Best Wishes,
> Spencer Graves
> 
> Jose María Fedriani Laffitte wrote:
> 
> >Dear all,
> >
> >    I want to get the exact p-values, on 1 degree of 
> freedom, for an array
> >of chi-square values.  When my chi-square values are equal 
> or lower than
> >29.7, I get the exact associated p-values.  Thus, for instance:
> >
> >  
> >
> >>pchisq(29.7, df=1)
> >>    
> >>
> >[1] 0.9999999
> >
> >However, when my chi-square values are greater or equal to 
> 29.8 what I get
> >is:
> >
> >  
> >
> >>pchisq(29.8, df=1)
> >>    
> >>
> >[1] 1
> >
> >
> >    Could anyone tell me how to fix this trivial issue?  
> Very grateful, Jose
> >M. Fedriani
> >
> >****************************************
> >Jose Mª Fedriani Laffitte
> >Estacion Biologica de Donana (CSIC)
> >Avda. Mª Luisa s/n
> >41013-Sevilla
> >Spain
> >Tel. +34-954232340
> >Fax +34-954621125
> >http://ebd.csic.es
> >
> >--------------------------------------------------------------------
> >This message was distributed by s-news@lists.biostat.wustl.edu.  To
> >unsubscribe send e-mail to 
> s-news-request@lists.biostat.wustl.edu with
> >the BODY of the message:  unsubscribe s-news
> >  
> >
> 
> 
> --------------------------------------------------------------------
> This message was distributed by s-news@lists.biostat.wustl.edu.  To
> unsubscribe send e-mail to s-news-request@lists.biostat.wustl.edu with
> the BODY of the message:  unsubscribe s-news
> 

<Prev in Thread] Current Thread [Next in Thread>