Accord.Statistics.Testing.Power.TwoSampleZTestPowerAnalysis.GetSampleSize C# (CSharp) Method

GetSampleSize() public static method

Estimates the number of samples necessary to attain the required power level for the given effect size.
public static GetSampleSize ( double delta, double standardDeviation = 1, double proportion = 1.0, double power = 0.8, double alpha = 0.05, TwoSampleHypothesis hypothesis = TwoSampleHypothesis.ValuesAreDifferent ) : TwoSampleZTestPowerAnalysis
delta double The minimum detectable difference.
standardDeviation double The difference standard deviation.
proportion double The proportion of observations in the second group /// when compared to the first group. A proportion of 2:1 results in twice more /// samples in the second group than in the first. Default is 1.
power double The desired power level. Default is 0.8.
alpha double The desired significance level. Default is 0.05.
hypothesis TwoSampleHypothesis The alternative hypothesis (research hypothesis) to be tested.
return TwoSampleZTestPowerAnalysis
        public static TwoSampleZTestPowerAnalysis GetSampleSize(double delta,
            double standardDeviation = 1, double proportion = 1.0, double power = 0.8, double alpha = 0.05,
            TwoSampleHypothesis hypothesis = TwoSampleHypothesis.ValuesAreDifferent)
        {
            var analysis = new TwoSampleZTestPowerAnalysis(hypothesis)
            {
                Effect = (delta) / standardDeviation,
                Size = alpha,
                Power = power,
            };

            analysis.ComputeSamples(proportion);

            return analysis;
        }