Link to home
Start Free TrialLog in
Avatar of gresty
gresty

asked on

Excel Chi ^2 function

Is there a Chi^2 function in Excel or some vb code I could use to pass in the significance level (alpha) and the critical value (chi_alpha) and return the degree of freedom?
Avatar of Elmo_
Elmo_
Flag of Ireland image

gresty,

What exactly are you looking for here?

Something like

5 to the power of 3

E.g. 5^3 or 5^2

If not what is CHI?

cheers,

Ed.
Avatar of blakeh1
blakeh1

There is a ChiDist function which returns the one-tailed probability of the chi squared distribution

Got to Insert, Function, and choose Statistical for the category, and it will be in the list

Note: You may have to enable to Analysis Toolpak add-in to have this function listed. If so go to Tools, Add-ins, and check off Analysis Toolpak.
I can't find any references to either of them. If you tell me exactly how it is calculated, I'll write a function for you.

Alternatively, search the net for 'mathematic function add - ins'

or something

Thanks

Jell
The arguments are as follows

CHIDIST(x,degrees_freedom)

X   is the value at which you want to evaluate the distribution.

Degrees_freedom   is the number of degrees of freedom.
Also, just found

>Chidist

>Chiinv

>Chitest

Thanks

James
In addition there are also these functions which may help

CHIINV(probability,degrees_freedom)

Probability   is a probability associated with the chi-squared distribution.

Degrees_freedom   is the number of degrees of freedom.


CHITEST(actual_range,expected_range)

Actual_range   is the range of data that contains observations to test against expected values.

Expected_range   is the range of data that contains the ratio of the product of row totals and column totals to the grand total.
Avatar of gresty

ASKER

OK let me try and explain a little clearer what I am after.

With Chi squared there are 3 parameters:

Degrees of freedom
Probability
Critical Value

There are 2 built in functions in excel.

CHIINV(probability,degrees_freedom)
This function takes in the probability and the degrees of freedom and returns the critical value

CHIDIST(x,deg_freedom)
This function takes in the critical value and the degrees of freedom and returns the probability

What I am looking for is a function that takes in the critical value and the probability and returns the degrees of freedom.

Is this possible?
Avatar of gresty

ASKER

OK let me try and explain a little clearer what I am after.

With Chi squared there are 3 parameters:

Degrees of freedom
Probability
Critical Value

There are 2 built in functions in excel.

CHIINV(probability,degrees_freedom)
This function takes in the probability and the degrees of freedom and returns the critical value

CHIDIST(x,deg_freedom)
This function takes in the critical value and the degrees of freedom and returns the probability

What I am looking for is a function that takes in the critical value and the probability and returns the degrees of freedom.

Is this possible?
The answer must be no. Why should there be a unique degrees of freedom for an arbitrary pair of critical value and probability?
leo
Hi gresty,

I can easily create a spreadsheet that will calculate that for you.

To how many degrees of freedom would you like to calculate?  30 is the usual arbitrary figure - due to the nature of the test - but I can make it calculate as high as you like.

Dave
ASKER CERTIFIED SOLUTION
Avatar of TigerMan
TigerMan
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gresty

ASKER

Thanks TigerMan,

This is exactly what I want.

I never thought of solving the problem using a look up list.  I was trying to solve the problem using Excel vba.
Pleased to be of help.

Thanks,

Dave