Function to perform a One Sample t-Test.
int ocmath_one_sample_t_test( const double * pData, UINT nSize, const HypotTestOptions * opt, tTestMean1SampleResults * res )
Returns STATS_NO_ERROR on successful exit and a non-zero STATS error code on failure.
EX1
void ocmath_one_sample_t_test_ex1() { vector vData = { 1.7, 2.1, 3.9, 7.2, 8.6, 8.5, 7.3, 5.1, 2.8, 1.8, 1.7 }; HypotTestOptions HTO; tTestMean1SampleResults tRes; double mean = 0.0; int tail = 1; HTO.HypotValue = mean; HTO.TailType=tail; int nRet = ocmath_one_sample_t_test(vData, vData.GetSize(), &HTO, &tRes); out_int("nRet=", nRet); //nRet = 0; //print out tRes printf("value of tRes:\n"); printf("tRes.N=%d, tRes.Mean=%f, tRes.SD=%f, tRes.SEM=%f\n", tRes.N, tRes.Mean, tRes.SD, tRes.SEM); printf("tRes.DOF=%d, tRes.tValue=%f, tRes.Prob=%f\n", tRes.DOF, tRes.tValue, tRes.Prob); }
origin.h