http://www.graphpad.com/quickcalcs/PValue1.cfm stat computation Chi Square gives probability that a random sample gives no better fit. chi square= (n-1)* s^2/d^2 n=number of samples s^2= sample variance d^2=population variance Statistics books give tables but not the formula generating it. xx= Chi Square value n = degrees of freedom = cases-1 Define gam(n)=Integral e^(-x)*x^(n-1),x,0,30) 1 P= ---------------------- * Integral(x2 to 70) e^[(-x/2)) * (n/2) 2 * gam(n/2) x^(n-2)/2) ) dx HP program 2^(-n/2) / ((n/2)-1)! ) * Integral (xx,60, EXP(-x/2)*x^((n-3)/2),x)' Degrees of freedom= 4-1=3 Example Observed Expected A 70 75 B 80 75 C 85 75 D 84 70 chi square = x2 = Sum (observed-expected)^2 / expected) x2=2.33 alpha=area x2 to oo = p n=3 If x2=7.81473 alpha=.05 9.34830 .025 11.34830 .01 12.8382 .005 16.266 .001 Example The probality there is no significant difference in the A B C D cases is between .001 and .005 so the assumption there is no significant difference bwtween A B C D is accepted. Normally 0.05 is the rejection critical value. ======================================= Graph Clear F= menu 0.242- * | | * * | | |* | * |*** n=3 P=Area under curve from xx to 14 | |***** |******* | |*********** |* |*************** ------------------------------*------ x=0 x2 = 2.333 oo ========= Go to Stats F6 Chi2 GOF Enter Observed List {70,80,85,70} Expected List {75,75,75,75} df=Deg of Freedom 3 = 4-1 Calculate Chi-2.333 P value 0.506 = probability the results is random and not significant In Stats select Inverse Chi-square = Deg of freedom= 3 Area = 0.95 = 1 -.05 Inverse 7.8147 which is xx for 0.05 probability = area