ocmath_median_test

 

Description

Performs a Median test for identical population medians. This is an OriginPro only function.

Syntax

int ocmath_median_test( const double * pData, const uint nSize, const int iLevels, const double * pIndex, NPHFreqs * MdFreqs, NPHStats * MdStats )

Parameters

pData
[input] pointer to data points
nSize
[input] number of data points
iLevels
[input] number of groups
pIndex
[input] pointer to the data number of each group.
MdFreqs
[output] pointer to structure containing Statistics of Frequencies
MdFreqs[i-1]: Frequencies of i-th group
MdStats
[output] pointer to structure containing the test statistic and p-value, No corrected for ties.

Return

Returns STATS_NO_ERROR on successful exit or an STATS error code on failure.

Examples

EX1

void ocmath_median_test_ex1()
{
    vector pData = {1.0, 2.3, 4.5, 2.0, 5.3, 2.6};
    int nSize = pData.GetSize();
    int iLevels = 2;
    vector pIndex;
    pIndex.SetSize(iLevels);
    pIndex[0] = 3;
    pIndex[1] = 3;
    NPHFreqs MdFreqs[2];
    NPHStats MdStats[2];
    
    int nRet = ocmath_median_test(pData, nSize, iLevels, pIndex, MdFreqs, MdStats);
    out_int("nRet=", nRet);    
}

Remark

See Also

Header to Included

origin.h

Reference