Function to perform a Chi-Square Test for equal variance.
int ocmath_chi_square_test( UINT nSize, const double * pData, const HypotTestOptions * opt, tTestResults * pChiSqRes )
Returns STATS_NO_ERROR on successful exit and a non-zero STATS error code on failure.
EX1
void ocmath_chi_square_test_ex1() { vector vData = {1, 2, 3, 4}; double var = 2.0; int tail = 1; HypotTestOptions HTO; tTestResults chi2Res; HTO.HypotValue = var; HTO.TailType = tail; int nRet = ocmath_chi_square_test(vData.GetSize(), vData, &HTO, &chi2Res); out_int("nRet=", nRet); //nRet = 0; //print out Chi-Square Test Results. printf("chi2Res.DOF = %f, chi2Res.tValue = %f, chi2Res.Prob = %f", chi2Res.DOF, chi2Res.tValue, chi2Res.Prob); }
origin.h