Overload List
| # | Signature | Description |
|---|---|---|
| 1 | function tTest(const Data1: TVec; const Data2: TVec; out hRes: THypothesisResult; out Signif: Double; var ConfInt: TDoubleArray; Paired: Boolean; hType: THypothesisType; Alpha: Double): Double; | Performs the two sample pooled or paired t-test. |
| 2 | function tTest(const Data: TVec; Mean: Double; out hRes: THypothesisResult; out Signif: Double; var ConfInt: TDoubleArray; const hType: THypothesisType; const Alpha: Double): Double; | One or two sample paired or pooled T-test. |
Overload 1: function tTest(const Data1: TVec; const Data2: TVec; out hRes: THypothesisResult; out Signif: Double; var ConfInt: TDoubleArray; Paired: Boolean; hType: THypothesisType; Alpha: Double): Double;
Performs the two sample pooled or paired t-test.
| # | Name | Description |
|---|---|---|
| 1 | Data1 | First set of data from which to compute the mean. |
| 2 | Data2 | Second set of data from which to compute the mean. |
| 3 | hRes | Returns the result of the null hypothesis (default assumption is that the means are equal). |
| 4 | hType | Defines the type of the null hypothesis (left, right and two - tailed). |
| 5 | Paired | If true, tTest routine will perform Two-Sample Paired t-Test. If false, tTest will perform Two-Sample Pooled (unpaired) t-Test. |
| 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 - The T-test statistics.
Remarks:
It compares Data1 mean value with Data2 mean value. The assumption is Data1 and Data2 variances are equal, but unknown. The null hypothesis is that Data1 mean is equal to Data2 mean.
See Also: Statistics.ZTest
Overload 2: function tTest(const Data: TVec; Mean: Double; out hRes: THypothesisResult; out Signif: Double; var ConfInt: TDoubleArray; const hType: THypothesisType; const Alpha: Double): Double;
One or two sample paired or pooled T-test.
| # | Name | Type | Description |
|---|---|---|---|
| 1 | Data | TVec | |
| 2 | Mean | Double | scalar |
| 3 | hRes | THypothesisResult | |
| 4 | Signif | Double | |
| 5 | ConfInt | TDoubleArray | |
| 6 | hType | THypothesisType | |
| 7 | Alpha | Double |
Returns: Double
Remarks:
Performs the one sample T-test. It compares Data mean value with the Mean. The null hypothesis is that Data mean value is equal to the Mean.
Examples
Uses Math387, MtxExpr, Statistics;
procedure Example;
var d1,d2: Vector;
Signif : double;
HypRes : THypothesisResult;
MeanCI : TTwoElmReal;
begin
d1.SetIt(false,[2, 3, 5, 2.5]); // mean = 3.125
d2.SetIt([5, 7, 8]); // mean = 6.6666666667
tTest(d1,d2, HypRes, Signif, MeanCI, false, htLeftTailed);
// Signif = 0.01070092300; HypRes = hrReject;
// MeanCI=[ -5.702239060933, +INF ]
// Comment : Since the signf is smaller than Alpha (0.05), the
// null hypothesis (H0) that data means are equal is rejected and
// the alternative (Ha) that d1 mean is smaller than d2 mean
// CANNOT be rejected
end;