ocmath_two_sample_tTest_powers_pair1

 

Description

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

Syntax

int ocmath_two_sample_tTest_powers_pair1( const double dSigLevel, HypotTestOptions * opt, const double * pSampleSizes, UINT nSizes, PowerOpts * tPowerOpts, double * pPowers )

Parameters

dSigLevel
[input] Significance level for power computations
opt
[input] structure containing t-Test options
pSampleSizes
[input] pointers to actual and hypothetical sample sizes
nSizes
[input] number of sample size in pSampleSizes
tPowerOpts
[input] structure containing Power&SampleSize input options
pPowers
[output] pointers to powers

Return

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

Examples

EX1

void ocmath_two_sample_tTest_powers_pair1_ex1()
{
    double dSigLevel = 0.05;
    HypotTestOptions htopt;
    vector vSampleSizes;
    vector<double> vPowers;
    
    htopt.HypotValue = 0;
    htopt.TailType = TAILED_TEST_TWO;
    
    vSampleSizes.SetSize(3);
    vSampleSizes[0]=2;
    vSampleSizes[1]=4;
    vSampleSizes[2]=6;
    
    PowerOpts powerOpts;
    powerOpts.Mean1=1.23;
    powerOpts.Mean2=3.21;
    powerOpts.SD=2.22;
     
    vPowers.SetSize(vSampleSizes.GetSize());
    
    int nRet = ocmath_two_sample_tTest_powers_pair1(dSigLevel, &htopt, vSampleSizes, vSampleSizes.GetSize(), &powerOpts, vPowers);  
    out_int("nRet=", nRet);
}

Remark

See Also

header to Included

origin.h

Reference