2.1.24.7.4 ocmath_k_squared_test


Description

Normality Test function used to perform D'Agostino-K squared tests Analysis.

Syntax

int ocmath_k_squared_test( const double * pData, UINT nSize, NormTestResults2 * Chi2Res, NormTestResults2 * SkewRes, NormTestResults2 * KrutRes )

Parameters

pData
[input] Pointer of the dataset to analyse
nSize
[input] the number of the elements of the dataset
Chi2Res
[output] D Agostino's Chi2 test result
SkewRes
[output] Skewness test result
KrutRes
[output] Krutosis test result

Return

Returns STATS_ERROR_ARRAY_TOO_SMALL if the size of input array is too small or returns STATS_NO_ERROR on successful exit.

Examples

EX1

void ocmath_k_squared_test_ex1()
{
	vector vecData = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
	
	int nRet;	
	NormTestResults2 stChi2Res, stSkewRes, stKrutRes;	
	if( STATS_NO_ERROR == (nRet = ocmath_k_squared_test(vecData, vecData.GetSize(), &stChi2Res, &stSkewRes, &stKrutRes)) )
	{
		printf("stChi2Res.TestStat = %f, stChi2Res.Prob = %f\n", stChi2Res.TestStat, stChi2Res.Prob);
		printf("stSkewRes.TestStat = %f, stSkewRes.Prob = %f\n", stSkewRes.TestStat, stSkewRes.Prob);
		printf("stKrutRes.TestStat = %f, stKrutRes.Prob = %f\n", stKrutRes.TestStat, stKrutRes.Prob);
	}
	else
	{
		out_int("Error, nRet=", nRet);
	}
}

Remark

See Also

Header to Included

origin.h

Reference