Re: P-value from chi-square value: source code
- From: "Reef Fish" <Large_Nassau_Grouper@xxxxxxxxx>
- Date: 9 Apr 2005 12:28:26 -0700
DZ wrote:
> P.S. The p-value is 1-chi_cdf(ChiSquare, df)
If so, why do you need any ChiSquare software, let along coding it?
Why wouldn't any standard normal software suffice?
>
> DZ wrote:
> > Dhruv <bhaveshrb@xxxxxxxxx> wrote:
> >> Ian Smith wrote:
> >>> "Dhruv" <bhaveshrb@xxxxxxxxx> wrote
> >>> > Could anyone send me a link to the source code in C++ for
> >>> > calculating the P-value from a chi-square value.
> >>> You are looking for code to evaluate the upper tail probability
of a
> >>> chi-squared distribution.
> >>> http://odin.mdacc.tmc.edu/anonftp/#DCDFLIB
> >>
> >> I actually tried the code and am having some problems with it. I
am
> >> sort of a newbie to programming and though I have managed to write
> >> some good code, I am unable to figure out the problem at present.
> >> What I need basically is a function which takes in Chi-square
value
> >> and returns the P-value. Please help me on this.
> >
> > You need to compile the library and use the function "cdfchi" ,
> > passing parameters as addresses, for example:
> >
> > double chi_cdf (double ChiSquare, double df) {
> > double q, p, bound;
> > int which=1, status;
> > cdfchi(&which, &p, &q, &ChiSquare, &df, &status, &bound);
> > return p;
> > }
And Ian Smith gave two links and said,
IS> both have C code which will do it and there is nothing better out
IS> there that I know of.
Nothing better? Use either or both those links and let us know
that the p-values (1-tail will do) for observed 1 df Chisquare
values of 1, 10, and 100, to at least 8 significant figures,
and then I'll tell you how many better ones there are. :-)
-- Bob.
.
- Follow-Ups:
- Re: P-value from chi-square value: source code
- From: Ian Smith
- Re: P-value from chi-square value: source code
- From: Richard Ulrich
- Re: P-value from chi-square value: source code
- References:
- P-value from chi-square value: source code
- From: Dhruv
- Re: P-value from chi-square value: source code
- From: Ian Smith
- Re: P-value from chi-square value: source code
- From: Dhruv
- P-value from chi-square value: source code
- Prev by Date: Re: P-value from chi-square value: source code
- Next by Date: Re: P-value from chi-square value: source code
- Previous by thread: Re: P-value from chi-square value: source code
- Next by thread: Re: P-value from chi-square value: source code
- Index(es):
Relevant Pages
|