| ocmath_mann_whitney  DescriptionPerforms a Mann-Whitney U test for on two independent samples of possibley unequal size. The main engine is nag_mann_whitney. This is an OriginPro only function. Syntax
int ocmath_mann_whitney( const double * pData1, const int nSize1, const double * pData2, const int nSize2, const int nTailType, NPHSummary * MannSummary, NPHRanks * MannRanks, NPHStats * MannStats, bool bExact = false )
 Parameters
    pData1[input] pointer to 1st data points for Wilcoxon Rank Sum testnSize1[input] number of pData1pData2[input] pointer to 2nd data points for Wilcoxon Rank Sum testnSize2[input] number of pData2nTailType[input] value indicates Tail Type. which containing 3 types:TAILED_TEST_TWO is 0,TAILED_TEST_UPPER is 1,TAILED_TEST_LOWER is 2MannSummary[output] structure containing summary statistics of the 2 groupsMannSummary[0]: Summary statistics of 1st groupMannSummary[1]: Summary statistics of 2nd groupMannRanks[output] structure containing Statistics of RanksMannRanks[0]: Ranks of 1st groupMannRanks[1]: Ranks of 2nd groupMannStats[output] structure containing the test statistic and p-valuebExact[input] Optional Input flag indicates if exact probalility to computed. return false if exact probability fail to be computedbExact is true: compute the exact probabilitybExact is false: compute the approximate probability. ReturnReturns STATS_NO_ERROR on successful exit or an STATS error code on failure. ExamplesEX1 
void ocmath_mann_whitney_ex1()
{
    vector pData1 = {1.0, 2.3, 4.5, 2.0, 5.3};
    int nSize1 = pData1.GetSize();
    vector pData2 = {2.2, 5.6, 4.3, 1.7, 3.8, 1.2};
    int nSize2 = pData2.GetSize();
    int nTailType = TAILED_TEST_TWO;
    NPHSummary MannSummary[2]; 
    NPHRanks MannRanks[2]; 
    NPHStats MannStats;
    bool bExact = true;
    
    int nRet = ocmath_mann_whitney(pData1, nSize1, pData2, nSize2, nTailType, MannSummary, MannRanks, &MannStats, bExact);
    out_int("nRet=", nRet);
}
RemarkSee Alsoheader to Includedorigin.h Reference |