2.1.24.7.2 ocmath_chen_shapiro_test


Description

Normality Test function used to perform Chen-Shapiro test Analysis.

Syntax

int ocmath_chen_shapiro_test( const double * pData, UINT nSize, const double dAlpha, double * dStat, double * dCriVal10, double * dCriVal5, double * dCriVal )

Parameters

pData
[input] Pointer of the dataset to analyse
nSize
[input] the number of the elements of the dataset
dAlpha
[input] Alpha the significance level
dStat
[output] Chen-Shapiro test statistic
dCriVal10
[output] Chen-Shapiro test 10% critical value
dCriVal5
[output] Chen-Shapiro test 5% critical value
dCriVal
[output] Chen-Shapiro test 0.1% critical value

Return

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.

Examples

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);
	}
}

Remark

See Also

Header to Included

origin.h

Reference