Close Home Forum Sign up / Log in

Chi-Squared

C

I have a programme that fits a distribution model to my data's distribution, and gives me a value of chi square for the goodness-of-fit of the model. I need to find out whether this is significant but am struggling to figure out the degrees of freedom in order to look up my chi-squre values in a table.

Is it one - as comparing two models (so df = n-1)
Or is it based on the number of observations that make up my data distibution ~75
Or is it based on the number of bins in the histogram that I am comparing accross. I constrained the histograms run from 800-3000 and have a bin size of 100 so have 22 bins.
Or is there something else I'm not thinking of....

Cheers for any suggestions

C

Hmm, if it helps this is what the manual says it is doing...

Even when search is not problematic it is important to ensure that the Ex-Gaussian distribution provides an adequate model of the data. RTSYS allows evaluation of the Ex-Gaussian model, both graphically, through plotting the Ex-Gaussian curve on a histogram of the data (see Figure 5), and inferentially, through a c2 test. The c2 is calculated by comparing the observed and expected number of RTs in each of a series of categories which span the range of the RT distribution.

A difficulty with c2 testing is choosing the width of the categories, especially when the scale of distributions may vary widely. D'Angostino and Stephens (1986, p. 69) recommend the use of c2 cells with equal probabilities under the fitted distribution, citing a reduction in bias and better small sample properties. Unfortunately, determination of the width of equal probability bins requires search using the integral of the Ex-Gaussian pdf, an operation more computationally expensive than parameter fitting itself. Instead, RTSYS uses categories with equal numbers of data points, approximating equally likely Ex-Gaussian categories for reasonable fits. The user may select the number of categories or allow RTSYS to automatically select 2n^2/5 categories (a heuristic suggested by D'Angostino & Stephens, p.70). When a category produces less than 5 expected or observed values, RTSYS collapses the category with the following category to ensure that the assumptions of c2 testing are not violated.

T

Hi Catalinbond,

it's been a while but if I remember correctly, degrees of freedom are the product (r1 - 1) * (r2 - 1) * ... * (rn - 1) where n is the number of independent variables and rk is the number of bins of variable k. In your case 21 * 21 = 441. However, are you sure the software returns chi square value and not the probability of obtaining the value given your data?

16809