statdivlab / rigr

Regression, Inference, and General Data Analysis Tools for R
Other
10 stars 3 forks source link

Ensure Chi-squared test is asymptotically equivalent to F test #157

Closed gthopkins closed 1 month ago

gthopkins commented 1 month ago

This PR fixes issue #156 where the Chi-squared test statistic needed to be scaled by the number of degrees of freedom in order to yield asymptotically valid p-values from the U(.) function. This ensures the p-values from the Chi-square test will be asymptotically equivalent to those from the F-test.

If X follows an F distribution with q and n degrees of freedom, then Y = \lim_{n \to \infty} {q * X} follows a Chi-squared distribution with q degrees of freedom.