ocmath_two_sample_tTest_samplesize_pair

 

Description

Function to compute hypothetical Sample Size for a pair t-Test. This is an OriginPro only function.

Syntax

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

Parameters

dSigLevel
[input] Significance level for power computations
opt
[input] structure containing t-Test options
pPowers
[input] vector containing hypothetical powers
nSizes
[input] number of hypothetical powers
tPowerOpts
[input] structure containing Power&SampleSize input options
pSampleSizes
[output] vector containing 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_two_sample_tTest_samplesize_pair_ex1()
{

    double dSigLevel = 0.05;
    HypotTestOptions htopt;
    vector vSampleSizes;
    vector<double> vPowers;
    
    PowerOpts powerOpts;
    powerOpts.Mean1=2.58;
    powerOpts.Mean2=2.85;
    powerOpts.SD=2.83049;
    
    htopt.HypotValue = 0;
    htopt.TailType = TAILED_TEST_TWO;
    
    vSampleSizes.SetSize(3);
    
    vPowers.SetSize(vSampleSizes.GetSize());
    vPowers[0]=0.2;
    vPowers[1]=0.4;
    vPowers[2]=0.6;
    
    double dLowestPow;
    
    int nRet = ocmath_two_sample_tTest_samplesize_pair(dSigLevel, &htopt, vPowers, vPowers.GetSize(), &powerOpts, vSampleSizes, &dLowestPow);    
    out_int("nRet=", nRet);
}

Remark

See Also

header to Included

origin.h

Reference