2.1.24.3.4 ocmath_tTest_samplesize


Description

Function to computer hypothetical Sample size for a one sample t-Test independently. This is an OriginPro only function.

Syntax

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

Parameters

dSigLevel
[input] Significance level for power computations
iTailType
[input] Compute powers for a two-tailed, upper tailed, or lower tailed test
pPowers
[input] vector containing powers
nSizes
[input] the size of pPowers
tPowerOpts
[input] structure containing Power&SampleSize input options
pSampleSizes
[output] vector containing hypothetical sample sizes
pLowestPower
[output] value containing the lowest power

Return

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

Examples

EX1

void ocmath_tTest_samplesize_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);
    
    vPowers.SetSize(vSampleSizes.GetSize());
    vPowers[0]=0.2;
    vPowers[1]=0.4;
    vPowers[2]=0.6;
    
    double dLowestPow;
    
    int nRet = ocmath_tTest_samplesize(dSigLevel, iTailType, vPowers, vPowers.GetSize(), &powerOpts, vSampleSizes, &dLowestPow);
    out_int("nRet=", nRet);
}

Remark

See Also

Header to Included

origin.h

Reference