Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chi-Squared p-value calculation without using a chart [algorithm]

I'm trying to implement a Chi-Square test in combination with Marascuilo's procedure in JavaScript.

The hardest part about this is calculating the p-value for the Chi-Squared test. There are many calculators out there but I don't want to just plug in numbers, I want to know the math behind them.

This calculation in C looks like exactly what I'm looking for (besides needing to translate it to javascript), but the magic numbers make it hard to follow what is being computed.

On a higher level, what is the algorithm for calculating Chi-Squared p-value without using a chart?

like image 480
jessicaraygun Avatar asked Apr 22 '26 14:04

jessicaraygun


1 Answers

The code from

https://www.swogstat.org/stat/public/chisq_calculator.htm

could give you a hint

like image 169
bionicCat Avatar answered Apr 25 '26 03:04

bionicCat



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!