PC Review


Reply
Thread Tools Rate Thread

CHITEST worksheet function - bug?

 
 
=?Utf-8?B?ZnJlZF95X09oaW8=?=
Guest
Posts: n/a
 
      22nd Feb 2006
I am experiencing the same problem in both Excel 2002 and 2003.

The CHITEST worksheet function is "sometimes" returning #NUM! instead of a
number.

CHITEST syntax is CHITEST(actual_range,expected_range)

I am running CHITEST against 6 ranges of numbers - 10,000 numbers in each
range. The expected range is always the same, for all of my CHITEST
instances.

One of the six ranges is returning #NUM!, the other 5 return a number(as I
expect).

I looked up the meaning of #NUM! - one listed cause is that some of the
arguments are not numbers.

I ran the COUNT function against the range - COUNT thinks they are all
numbers.

So, I ran CHITEST on a some sub-ranges of the range where CHITEST returns
#NUM!.

Example:

Range of numbers RESULT

1-10,000 #NUM!

1-30 number
1-100 number
1-1000 number

1-2000 #NUM!

1001-2000 #NUM!

1001-1500 number
1501-2000 number

I am stumped about why CHITEST would return a number for the sub-ranges
1001-1500 AND 1501-2000 but NOT for the sub-range 1001-2000.

What am I missing?
 
Reply With Quote
 
 
 
 
=?Utf-8?B?SmVycnkgVy4gTGV3aXM=?=
Guest
Posts: n/a
 
      22nd Feb 2006
You have not given enough information to diagnose the problem. As a guess,
your data puts you into an area where CHIDIST fails.

Help for CHITESTdocuements the calculation for the chi-square statistic and
its degrees of freedom. For more information, reply back with the calculated
chi-square statistic and degrees of freedom, if you don't want to reply back
with the actual data.

Those are passed to CHIDIST to evaluate the p-value. However
CHIDIST(df-e,df) returns #VALUE instead of a p-value near 0.5 for even
moderately large df and small e>0. For example, =CHIDIST(799,800) returns
#NUM.

If you manually calculate the chi-square statistic and degrees of freedom,
you could use comp_cdf_chi_sq() from Ian Smith's probability function library
at
http://members.aol.com/iandjmsmith/examples.xls

Jerry

"fred_y_Ohio" wrote:

> I am experiencing the same problem in both Excel 2002 and 2003.
>
> The CHITEST worksheet function is "sometimes" returning #NUM! instead of a
> number.
>
> CHITEST syntax is CHITEST(actual_range,expected_range)
>
> I am running CHITEST against 6 ranges of numbers - 10,000 numbers in each
> range. The expected range is always the same, for all of my CHITEST
> instances.
>
> One of the six ranges is returning #NUM!, the other 5 return a number(as I
> expect).
>
> I looked up the meaning of #NUM! - one listed cause is that some of the
> arguments are not numbers.
>
> I ran the COUNT function against the range - COUNT thinks they are all
> numbers.
>
> So, I ran CHITEST on a some sub-ranges of the range where CHITEST returns
> #NUM!.
>
> Example:
>
> Range of numbers RESULT
>
> 1-10,000 #NUM!
>
> 1-30 number
> 1-100 number
> 1-1000 number
>
> 1-2000 #NUM!
>
> 1001-2000 #NUM!
>
> 1001-1500 number
> 1501-2000 number
>
> I am stumped about why CHITEST would return a number for the sub-ranges
> 1001-1500 AND 1501-2000 but NOT for the sub-range 1001-2000.
>
> What am I missing?

 
Reply With Quote
 
=?Utf-8?B?ZnJlZF95X09oaW8=?=
Guest
Posts: n/a
 
      23rd Feb 2006
Based on Jerry's advice,...

For my set of 10,000 numbers, using Excel's CHITEST help documentation, I
manually calculated the chi-square statistic (9,717) and degrees of freedom
(9,999).

I then used those values as parameters for Excel's CHIDIST function,
CHIDIST(9717,9999). Result from Excel is #NUM! .

Excel's help documentation for CHITEST and CHIDIST do not state any
limitations for those two functions' parameters.

Smells like a bug to me.......
.....(....or is Microsoft gonna dismiss this an "undocumented FEATURE".)

Conclusion: CHITEST and CHIDIST do not always work as documented.

"Jerry W. Lewis" wrote:

> You have not given enough information to diagnose the problem. As a guess,
> your data puts you into an area where CHIDIST fails.
>
> Help for CHITESTdocuements the calculation for the chi-square statistic and
> its degrees of freedom. For more information, reply back with the calculated
> chi-square statistic and degrees of freedom, if you don't want to reply back
> with the actual data.
>
> Those are passed to CHIDIST to evaluate the p-value. However
> CHIDIST(df-e,df) returns #VALUE instead of a p-value near 0.5 for even
> moderately large df and small e>0. For example, =CHIDIST(799,800) returns
> #NUM.
>
> If you manually calculate the chi-square statistic and degrees of freedom,
> you could use comp_cdf_chi_sq() from Ian Smith's probability function library
> at
> http://members.aol.com/iandjmsmith/examples.xls
>
> Jerry
>
> "fred_y_Ohio" wrote:
>
> > I am experiencing the same problem in both Excel 2002 and 2003.
> >
> > The CHITEST worksheet function is "sometimes" returning #NUM! instead of a
> > number.
> >
> > CHITEST syntax is CHITEST(actual_range,expected_range)
> >
> > I am running CHITEST against 6 ranges of numbers - 10,000 numbers in each
> > range. The expected range is always the same, for all of my CHITEST
> > instances.
> >
> > One of the six ranges is returning #NUM!, the other 5 return a number(as I
> > expect).
> >
> > I looked up the meaning of #NUM! - one listed cause is that some of the
> > arguments are not numbers.
> >
> > I ran the COUNT function against the range - COUNT thinks they are all
> > numbers.
> >
> > So, I ran CHITEST on a some sub-ranges of the range where CHITEST returns
> > #NUM!.
> >
> > Example:
> >
> > Range of numbers RESULT
> >
> > 1-10,000 #NUM!
> >
> > 1-30 number
> > 1-100 number
> > 1-1000 number
> >
> > 1-2000 #NUM!
> >
> > 1001-2000 #NUM!
> >
> > 1001-1500 number
> > 1501-2000 number
> >
> > I am stumped about why CHITEST would return a number for the sub-ranges
> > 1001-1500 AND 1501-2000 but NOT for the sub-range 1001-2000.
> >
> > What am I missing?

 
Reply With Quote
 
=?Utf-8?B?SmVycnkgVy4gTGV3aXM=?=
Guest
Posts: n/a
 
      23rd Feb 2006
I agree that CHIDIST (and hence CHITEST) should be able to handle this
calculation, but thus far, MS has not seen fit to use a better algorithm. As
I noted previously, there is a freely availabe VBA library of probability
functions that are as good or better than any double precision implementation
I have seen (including those in dedicated statistics packages and commercial
numerical libraries).
http://members.aol.com/iandjmsmith/examples.xls
Using that library, =comp_cdf_chi_sq(9717,9999) returns 0.977703672596211,
which is correct to all figures that Excel can display.

Jerry

"fred_y_Ohio" wrote:

> Based on Jerry's advice,...
>
> For my set of 10,000 numbers, using Excel's CHITEST help documentation, I
> manually calculated the chi-square statistic (9,717) and degrees of freedom
> (9,999).
>
> I then used those values as parameters for Excel's CHIDIST function,
> CHIDIST(9717,9999). Result from Excel is #NUM! .
>
> Excel's help documentation for CHITEST and CHIDIST do not state any
> limitations for those two functions' parameters.
>
> Smells like a bug to me.......
> ....(....or is Microsoft gonna dismiss this an "undocumented FEATURE".)
>
> Conclusion: CHITEST and CHIDIST do not always work as documented.
>
> "Jerry W. Lewis" wrote:
>
> > You have not given enough information to diagnose the problem. As a guess,
> > your data puts you into an area where CHIDIST fails.
> >
> > Help for CHITESTdocuements the calculation for the chi-square statistic and
> > its degrees of freedom. For more information, reply back with the calculated
> > chi-square statistic and degrees of freedom, if you don't want to reply back
> > with the actual data.
> >
> > Those are passed to CHIDIST to evaluate the p-value. However
> > CHIDIST(df-e,df) returns #VALUE instead of a p-value near 0.5 for even
> > moderately large df and small e>0. For example, =CHIDIST(799,800) returns
> > #NUM.
> >
> > If you manually calculate the chi-square statistic and degrees of freedom,
> > you could use comp_cdf_chi_sq() from Ian Smith's probability function library
> > at
> > http://members.aol.com/iandjmsmith/examples.xls
> >
> > Jerry
> >
> > "fred_y_Ohio" wrote:
> >
> > > I am experiencing the same problem in both Excel 2002 and 2003.
> > >
> > > The CHITEST worksheet function is "sometimes" returning #NUM! instead of a
> > > number.
> > >
> > > CHITEST syntax is CHITEST(actual_range,expected_range)
> > >
> > > I am running CHITEST against 6 ranges of numbers - 10,000 numbers in each
> > > range. The expected range is always the same, for all of my CHITEST
> > > instances.
> > >
> > > One of the six ranges is returning #NUM!, the other 5 return a number(as I
> > > expect).
> > >
> > > I looked up the meaning of #NUM! - one listed cause is that some of the
> > > arguments are not numbers.
> > >
> > > I ran the COUNT function against the range - COUNT thinks they are all
> > > numbers.
> > >
> > > So, I ran CHITEST on a some sub-ranges of the range where CHITEST returns
> > > #NUM!.
> > >
> > > Example:
> > >
> > > Range of numbers RESULT
> > >
> > > 1-10,000 #NUM!
> > >
> > > 1-30 number
> > > 1-100 number
> > > 1-1000 number
> > >
> > > 1-2000 #NUM!
> > >
> > > 1001-2000 #NUM!
> > >
> > > 1001-1500 number
> > > 1501-2000 number
> > >
> > > I am stumped about why CHITEST would return a number for the sub-ranges
> > > 1001-1500 AND 1501-2000 but NOT for the sub-range 1001-2000.
> > >
> > > What am I missing?

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I interpret the result of a chitest? Anne Microsoft Excel Misc 1 22nd May 2008 04:44 PM
Reference the worksheet from a multiple worksheet range function ( =?Utf-8?B?REJpY2tlbA==?= Microsoft Excel Worksheet Functions 1 28th May 2005 03:49 AM
chitest and interpretation of the result =?Utf-8?B?Q2hyaXN0aW5l?= Microsoft Excel Worksheet Functions 1 5th May 2005 02:00 AM
formula/function to copy from worksheet to worksheet =?Utf-8?B?SmVu?= Microsoft Excel Programming 5 11th Jan 2005 08:22 PM
CHITEST =?Utf-8?B?U2hhbW15?= Microsoft Excel Worksheet Functions 1 9th Apr 2004 08:28 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:02 AM.