Double ZTest(TVec Data, Double Mean, Double Sigma, ref THypothesisResult hRes, ref Double Signif, ref Double[] ConfInt, THypothesisType hType, Double Alpha)
Z Test.
| # | Name | Description |
|---|---|---|
| 1 | Data | The data samples to be analyzed. |
| 2 | Sigma | The standard deviation to compare the data to. |
| 3 | Mean | The mean to value to compare the data to. |
| 4 | hRes | Returns the result of the null hypothesis (default assumption is that the means are equal). |
| 5 | hType | Defines the type of the null hypothesis (left, right and two - tailed). |
| 6 | Signif | (Significance level) returns the probability of observing the given result by chance given that the null hypothesis is true. |
| 7 | ConfInt | Returns the 100*(1-Alpha) percent confidence interval for the mean. |
| 8 | Alpha | Defines the desired significance level. If the significance probability (Signif) is bellow the desired significance (Alpha), the null hypothesis is rejected. |
Returns: Double - Z statistics.
Remarks:
Compares the normally distributed Data elements mean value with known standard deviation Sigma, to a mean value Mean.
Examples
using Dew.Math;
using Dew.Stats;
using Dew.Stats.Units;
namespace Dew.Examples
{
private void Example()
{
Vector d1 = new Vector(0);
d1.SetIt(false, new double[] { 3, 3.5, 2, 3.1, 10, 9 });
double signif, ZStat;
double[] ci = new double[2];
THypothesisResult hres;
// don't use normal approximation
ZStat = Statistics.ZTest(d1, 5.0, 1.29, out hres, out signif, out ci, THypothesisType.htTwoTailed, 0.05);
// signif = 0.84940087229; hres = hrNotReject;
// ci=[4.06780398958, 6.13219601041]
// Comment : Since the SignRes is greater than Alpha (0.05), the
// null hypothesis (H0) that data mean is equal to 5.1 cannot be rejected
// the alternative (Ha) that data mean are NOT equal can therefore be
// rejected
}
}
See Also: Statistics.tTest