ocmath_two_sample_tTest_powers_pair

 

Description

Function to compute actual or hypothetical powers for a paired t-Test.

Syntax

int ocmath_two_sample_tTest_powers_pair( const double dSigLevel, const HypotTestOptions * opt, const double * vSampleSizes, UINT nSizes, tTestMean2SampleResults * tTestRes, double * vPowers )

Parameters

dSigLevel
[Input] Significance level for power computations
opt
[Input] structure containing t-Test options
vSampleSizes
[Input] pointers to actual and hypothetical sample sizes
nSizes
[Input] number of sample size in pSampleSizes
tTestRes
[Input] structure containing t-Test results output from ocmath_two_sample_t_test_pair
vPowers
[Output] pointers to powers

Return

Returns STATS_NO_ERROR on successful exit or a non-zero STATS error code on failure.

Examples

EX1

void ocmath_two_sample_tTest_powers_pair_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 };  
       HypotTestOptions HTO;
    tTestMean2SampleResults tRes;
    HTO.HypotValue = 1;
    HTO.TailType = TAILED_TEST_TWO;
    //get t-Test results from ocmath_two_sample_t_test_pair
    int nRet = ocmath_two_sample_t_test_pair(vData1, vData1.GetSize(), vData2, vData2.GetSize(), &HTO, &tRes);
        
    const double dSigLevel = 0.5;
    vector vOutput;
    vOutput.SetSize(vData1.GetSize());
    
    nRet = ocmath_two_sample_tTest_powers_pair(dSigLevel, &HTO, vData1, vData1.GetSize(), &tRes, vOutput);
    out_int("nRet=", nRet); //nRet = 0;

    //print out powers
    printf("vOutput = {");
    for(int ii=0; ii<vOutput.GetSize(); ii++)
    {
        printf("%f\t", vOutput[ii]);
    }
    printf("}\n");                                                    
}

Remark

See Also

Header to Included

origin.h

Reference