Function to compute descriptive statistics other than basic ones from raw data, like Mode, Geometric Standard Deviation, The dConfLevel confidence interval of mean, etc.
OCMATH_API int ocmath_opt_summary_stats(UINT nSize, const double *pData, const double dConfLevel, double* pMode = NULL, bool* pmultimodes = NULL, double* pGSD = NULL, double* pLCL = NULL, double* pUCL = NULL, double* pSDx2 = NULL, double* pSDx3 = NULL, int MomentDenFlag = DS_SAS1_DOF, const double *pWt = NULL)
Return STATS_NO_ERROR (0) on success. Otherwise returns error.
EX1
//This example is to calculate Mode and Geometric Standard Deviation ocmath_opt_summary_stats_ex1() { vector vData={3,2,1,4,2,5,4,6,9}; int nSize = vData.GetSize(); double dConfLevel = 0.95; bool bMultiModes = TRUE; double dMode, dGSD; int nRet = ocmath_opt_summary_stats(nSize, vData, dConfLevel, &dMode, &bMultiModes, &dGSD); if(0 == nRet) { out_double("Mode = ",dMode); out_double("GSD = ",dGSD); } }
EX2
//This example is to calculate upper and lower limit of the 95% confidence interval of mean ocmath_opt_summary_stats_ex2() { vector vData={3.1,3.2,4.1,4.2,5.4,6.9}; int nSize = vData.GetSize(); double dConfLevel = 0.95; bool bMultiModes = TRUE; double dLCL, dUCL; int nRet = ocmath_opt_summary_stats(nSize, vData, dConfLevel, NULL, &bMultiModes, NULL, &dLCL, &dUCL); if(0 == nRet) { out_double("LCL = ",dLCL); out_double("UCL = ",dUCL); } }
Function to compute descriptive statistics other than basic ones.
origin.h