Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Chi Square Areas

  • To: mathgroup at smc.vnet.net
  • Subject: [mg110943] Re: Chi Square Areas
  • From: Steve <s123 at epix.net>
  • Date: Tue, 13 Jul 2010 05:26:26 -0400 (EDT)
  • References: <i199d5$q45$1@smc.vnet.net> <i1c5vc$cgf$1@smc.vnet.net>

On Jul 11, 6:21 am, Norbert Marxer <mar... at mec.li> wrote:
> On Jul 10, 10:01 am, Steve <s... at epix.net> wrote:
>
>
>
>
>
> > Hi,
>
> > Can someone show me how to get Mathematica to provide the areas to the
> > right of a given critical value of the Chi Square distribution ?
>
> > The table entries shown athttp://www2.lv.psu.edu/jxm57/irp/chisquar.html
> > are what I need to compute.
>
> > For example, given 8 degrees of freedom and a probability value of
> > 0.05 the result would be 15.51.
>
> > And given 5 degrees of freedom with probability 0.1 the result is
> > 9.24.
>
> > How can I produce these results in Mathematica ?
>
> > Thanks so much.
>
> Hello
>
> You can use the built-in functions:
>
> InverseCDF[ChiSquareDistribution[8], 0.95]
> InverseCDF[ChiSquareDistribution[5], 0.9]
>
> which will give you the numbers 15.5073 and 9.23636.
>
> But note, these numbers represent the critical values! The areas (to
> the right) are given by 0.05 (5%) and 0.10 (10%) respectively.
>
> Best Regards
> Norbert Marxer- Hide quoted text -
>
> - Show quoted text -

Thanks to everyone who replied. 15 minutes after posting my question,
I figured it out on my own, albeit a not too elegant solution.

Norbert provided a particularly elegant solution and also pointed out
a small inconsistency in my question. The values I needed returned
were the critical values not the areas as I had stated at the
beginning of my post.

Below is a parameter-consistent comparison of my solution and
Norbert's.

Thanks again to all,
Steve

DOF = 8;
confidence = .90;
p = (1 - confidence)/2
ChiPDF = PDF[ChiSquareDistribution[DOF], x]
Plot[ChiPDF, {x, 0, 50}]
guessvalue = 2.5;
stevesolution =
  FindRoot[NIntegrate[ChiPDF, {x, CriticalValue, Infinity}] ==
    p, {CriticalValue, guessvalue}];
stevesolution = stevesolution[[1, 2]]
norbertsolution =
 InverseCDF[ChiSquareDistribution[DOF], confidence + p]
difference = stevesolution - norbertsolution




  • Prev by Date: File names and strings
  • Next by Date: Re: Restricting file type with SystemDialogInput
  • Previous by thread: Re: Chi Square Areas
  • Next by thread: Re: Chi Square Areas