Function to compute hypothetical Sample Size for a two sample t-Test. This is an OriginPro only function.
int ocmath_two_sample_tTest_samplesize( 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_ex1() { double dSigLevel; HypotTestOptions htopt; vector vSampleSizes; PowerOpts powerOpts; vector<double> vPowers; double dLowestPow; dSigLevel=0.05; htopt.HypotValue = 0; htopt.TailType = 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; int nRet = ocmath_two_sample_tTest_samplesize(dSigLevel, &htopt, vPowers,vPowers.GetSize(), &powerOpts, vSampleSizes, &dLowestPow); out_int("nRet=", nRet); }
origin.h