ocmath_f_test
Description
Function to perform a F Test for equal variance.
Syntax
int ocmath_f_test( UINT nSize1, const double * pData1, UINT nSize2, const double * pData2, const HypotTestOptions * opt, FVarResults * res )
Parameters
- nSize1
- [Input] number of data points in pData1
- pData1
- [Input] pointers to 1st data points for Two Sample t-Test
- nSize2
- [Input] number of data points in pData2
- pData2
- [Input] pointers to 2nd data points for Two Sample t-Test
- opt
- [Input] structure containing t-Test options
- res
- [Output] structure containing Chi-Square Test Results
Return
Returns STATS_NO_ERROR on successful exit and a non-zero STATS error code on failure.
Examples
EX1
void f_test_ex1()
{
vector vData1 = { 1.7, 2.1, 3.9, 7.2, 8.6, 8.5, 7.3, 5.1, 2.8, 1.8, 1.7 };
vector vData2 = { 3.2, 3.9, 4.9, 5.3, 5.5, 6.2, 6.5, 6.9, 7.5, 8.3, 9.4 };
vector vLevels = { 90.0, 95.0, 99.0 };
HypotTestOptions opt;
FVarResults res;
double nSize1 = vData1.GetSize();
double nSize2 = vData2.GetSize();
opt.TestType = 0;
opt.HypotValue = 0;
opt.TailType = TAILED_TEST_LOWER;
ocmath_f_test(nSize1, vData1, nSize2, vData2, &opt, &res);
printf("NUM = %d\nDEN = %d\nFValue = %f\nFProb = %f\n", res.FDOFNum, res.FDOFDen, res.FValue, res.FProb );
ASSERT( res.FDOFNum == 10 );
ASSERT( res.FDOFDen == 10 );
ASSERT( round( res.FValue, 2 ) == 2.35 );
ASSERT( round( res.FProb, 4 ) == 0.9026 );
}
Remark
See Also
header to Include
origin.h
Reference
|