# [R] chi2

Ben Bolker bolker at ufl.edu
Wed Oct 10 13:49:10 CEST 2007

```

elyakhlifi mustapha wrote:
>
> Hello,
> I want to use the quantile function so I read the doc but I don't
> understand with this
>
>> qchisq(seq(0.05,0.95,by=0.05),df=(length(don)-1))
>  [1] 62667.11 62795.62 62882.42 62951.47 63010.74 63064.00 63113.39
> 63160.27 63205.65 63250.33 63295.04 63340.48 63387.48 63437.03 63490.53
> 63550.14 63619.68
> [18] 63707.24 63837.16
>

I don't understand what your question is.  I infer that don is a vector
of length 63252:

1. find df to match the first result in the vector;

> uniroot(function(d) pchisq(62667.11,df=d)-0.05, c(1000, 1e9))
\$root
[1] 63251

\$f.root
[1] -1.483395e-11

\$iter
[1] 28

\$estim.prec
[1] 0.0001207690

recreate the results:

> qchisq(seq(0.05,0.95,by=0.05),df=63251)
[1] 62667.11 62795.62 62882.42 62951.47 63010.74 63064.00 63113.39 63160.27
[9] 63205.65 63250.33 63295.04 63340.48 63387.48 63437.03 63490.53 63550.14
[17] 63619.68 63707.24 63837.16

So what's the problem?

Ben Bolker

--
View this message in context: http://www.nabble.com/chi2-tf4600185.html#a13134124
Sent from the R help mailing list archive at Nabble.com.

```