[R] Fitting chi-squared distribution

Uwe Ligges ligges at statistik.tu-dortmund.de
Mon Mar 1 16:28:19 CET 2010



On 01.03.2010 16:15, Trafim Vanishek wrote:
> Dear all,
>
> I have a question regarding performing test if the data fits chi-squared
> distribution.
> For example, using ks.test()
>
> I found in the examples how to fit it to gamma or weibull
> x<-rnorm(100)
> ks.test(x, "pweibull", shape=2,scale=1)
>
> for the gamma, pgamma can be used
>
> But I cannot find the value of this second parameter for the chi-squared
> distribution.
> Maybe someone experienced the similar problem?


So you are dealing with pchisq? About which parameter are you unsure? 
The second of pchisq is df (degrees of freedom).
If you do not know the distribution to compare with, I doubt the KS test 
is the best one for you.

Best,
Uwe Ligges



> Thanks a lot!
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.



More information about the R-help mailing list