Function to compute actual or hypothetical powers for a t-Test.
int ocmath_two_sample_tTest_powers1( const double dSigLevel, HypotTestOptions * opt, const double * pSampleSizes, UINT nSizes, PowerOpts * tPowerOpts, double * pPowers )
Returns STATS_NO_ERROR on successful exit and a non-zero STATS error code on failure.
EX1
void ocmath_two_sample_tTest_powers1_ex1() { double dSigLevel = 0.05; HypotTestOptions htopt; vector vSampleSizes; PowerOpts powerOpts; vector<double> vPowers; htopt.HypotValue = 0; htopt.TailType = TAILED_TEST_TWO; powerOpts.Mean1=2.58; powerOpts.Mean2=2.85; powerOpts.SD=2.83049; vSampleSizes.SetSize(3); vSampleSizes[0]=2; vSampleSizes[1]=4; vSampleSizes[2]=6; vPowers.SetSize(vSampleSizes.GetSize()); int nRet = ocmath_two_sample_tTest_powers1(dSigLevel, &htopt, vSampleSizes, vSampleSizes.GetSize(), &powerOpts, vPowers); out_int("nRet=", nRet); }
origin.h