2.1.24.3.3 ocmath_tTest_powers1


Description

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

Syntax

int ocmath_tTest_powers1( const double dSigLevel, int iTailType, const double * pSampleSizes, UINT nSizes, PowerOpts * tPowerOpts, double * pPowers )

Parameters

dSigLevel
[input] significance level for power computations
iTailType
[input] Compute powers for a two-tailed, upper tailed, or lower tailed test. iTailType could be TAILED_TEST_TWO, TAILED_TEST_UPPER, or TAILED_TEST_LOWER.
pSampleSizes
[input] pointer 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_tTest_powers1_ex1()
{
    double dSigLevel;
    int iTailType;
    vector vSampleSizes;
    PowerOpts powerOpts;
    vector<double> vPowers;
    
    dSigLevel=0.05;
    
    iTailType = TAILED_TEST_TWO;
    
    powerOpts.Mean1=2.58;
    powerOpts.Mean2=2.85;
    powerOpts.SD=2.83049;
    
    vSampleSizes.SetSize(3);
    vSampleSizes[0]=2;
    vSampleSizes[1]=4;
    vSampleSizes[2]=6;
    
    vPowers.SetSize(vSampleSizes.GetSize());
    
    int nRet = ocmath_tTest_powers1(dSigLevel, iTailType, vSampleSizes, vSampleSizes.GetSize(), &powerOpts, vPowers);
    out_int("nRet=", nRet);
}

Remark

See Also

Header to Included

origin.h

Reference