2.1.24.2.2 ocmath_friedman_test


Description

Performs the Frieman two-way analysis of variance. The main engine is nag_friedman_test(g08aec). This is an OriginPro only function.

Syntax

int ocmath_friedman_test( const double * pData, const uint nSize, const double * dpTreaments, const uint nTreatmSize, const double * dpBlocks, const uint nBlockSize, NPHSummary * FriSummary, NPHRanks * FriRanks, NPHStats * FriStats )

Parameters

pData
[input] pointer to data points
nSize
[input] size of pData
dpTreaments
[input] pointer to integer treaments
nTreatmSize
[input] size of dpTreaments, it should equal to nSize
dpBlocks
[input] pointer to integer blocks.
nBlockSize
[input] size of dpBlocks. it should equal to nSize
FriSummary
[output] pointer to structure containing summary statistics of each groups
KruSummary[i-1]: Summary statistics of i-th group
FriRanks
[output] pointer to structure containing Statistics of Ranks
FriRanks[i-1]: Ranks of i-th group
FriStats
[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_friedman_test_ex1()
{
    vector pData;
    pData.Data(1.1,2.0,0.1);
    int nSize = pData.GetSize();
    
    vector dpTreaments;
    dpTreaments.Data(1.1,2,0.1);
    int nTreatmSize = dpTreaments.GetSize();
    
    vector dpBlocks;
    dpBlocks.Data(4.1,5,0.1);
    int nBlockSize = dpBlocks.GetSize();
    
    NPHSummary FriSummary[10];
    NPHRanks FriRanks[10];
    NPHStats FriStats;
    
    int nRet = ocmath_friedman_test(pData, nSize, dpTreaments, nTreatmSize, dpBlocks, nBlockSize, FriSummary, FriRanks, &FriStats);
    out_int("nRet", nRet);
}

Remark

See Also

Header to Included

origin.h

Reference