Function to computer hypothetical Sample size for a one sample t-Test independently. This is an OriginPro only function.
int ocmath_tTest_samplesize( const double dSigLevel, int iTailType, 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_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); }
origin.h