Normality Test function used to perform Chen-Shapiro test Analysis.
int ocmath_chen_shapiro_test( const double * pData, UINT nSize, const double dAlpha, double * dStat, double * dCriVal10, double * dCriVal5, double * dCriVal )
Returns STATS_ERROR_ARRAY_TOO_SMALL if the size of input array is too small. Otherwise returnsSTATS_WARNING_CANNOT_FIND_ALPHA if the alpha cannot be found in the gamma table(the Alpha would be assumed as default value 0.05) or returns STATS_NO_ERROR on successful exit.
EX1
void ocmath_chen_shapiro_test_ex1() { vector vecData = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; int nRet; double dStat, dCriVal10, dCriVal5, dCriVal; if( STATS_NO_ERROR == (nRet = ocmath_chen_shapiro_test(vecData, vecData.GetSize(), 0.1, &dStat, &dCriVal10, &dCriVal5, &dCriVal)) ) { out_double("Stat=", dStat); out_double("CriVal10=", dCriVal10); out_double("CriVal5=", dCriVal5); out_double("CriVal=", dCriVal); } else { out_int("Error, nRet=", nRet); } }
origin.h