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
|