Re: P-value from chi-square value: source code



"Dhruv" <bhaveshrb@xxxxxxxxx> wrote in message news:<1112757036.767719.202850@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>...
> Hello,
>
> Could anyone send me a link to the source code in C++ for calculating
> the P-value from a chi-square value.
>
> Thanks n Wishes,
> Dhruv

You are looking for code to evaluate the upper tail probability of a
chi-squared distribution.

http://odin.mdacc.tmc.edu/anonftp/#DCDFLIB

and

http://cvs.gnome.org/viewcvs/*checkout*/gnumeric/src/mathfunc.c

both have C code which will do it and there is nothing better out
there that I know of. I do not know the licencing arrangements. That
will probably depend on how you want to use it. If there are any
licencing problems then I have code which can be translated to C++
without too much effort.

Ian Smith
.



Relevant Pages

  • Re: diehard and ent results quesion
    ... > Can you tell me, please, what is the smallest N for which the p-value ... > given by the chi-square statistic is good without any correction? ... and calculating the info_freq) suggest that the mean and variance are ... be a correction to apply - though, of course, this correction will get ...
    (sci.crypt)
  • Re: p-value issue
    ... This makes me think that the p-value must be very significant (less ... 0.05), but if I run Chi-Square, I get p-value = 0.3021. ... Rich Ulrich, wpilib@xxxxxxxx ... is another test to confirm the similarity. ...
    (sci.stat.math)
  • Re: Variable Importance
    ... A chi-square with more than 1 d.f. ... Given two factors with the same p-value ... you need to look at both the univariate tests ... the validity of measurements. ...
    (sci.stat.consult)
  • Re: p-value issue
    ... Richard Ulrich wrote: ... This makes me think that the p-value must be very significant (less ... 0.05), but if I run Chi-Square, I get p-value = 0.3021. ... is another test to confirm the similarity. ...
    (sci.stat.math)
  • Re: p-value issue
    ... Richard Ulrich wrote: ... This makes me think that the p-value must be very significant (less ... 0.05), but if I run Chi-Square, I get p-value = 0.3021. ... is another test to confirm the similarity. ...
    (sci.stat.math)