Function to compute hypothetical Sample Size for a pair t-Test. This is an OriginPro only function.
int ocmath_two_sample_tTest_samplesize_pair( const double dSigLevel, HypotTestOptions * opt, const double * pPowers, UINT nSizes, PowerOpts * tPowerOpts, double * pSampleSizes, double * pLowestPower )
Returns STATS_NO_ERROR on successful exit and a non-zero STATS error code on failure.
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); }
origin.h