TTest Class 
Namespace: Accord.Statistics.Testing
The TTest type exposes the following members.
Name  Description  

TTest 
Creates a TTest.
 
TTest(Double, Double, OneSampleHypothesis) 
Tests the null hypothesis that the population mean is equal to a specified value.
 
TTest(Double, Double, OneSampleHypothesis) 
Tests the null hypothesis that the population mean is equal to a specified value.
 
TTest(Double, Double, Double, Double, OneSampleHypothesis) 
Tests the null hypothesis that the population mean is equal to a specified value.
 
TTest(Double, Double, Int32, Double, OneSampleHypothesis) 
Tests the null hypothesis that the population mean is equal to a specified value.

Name  Description  

Analysis 
Gets the power analysis for the test, if available.
 
Confidence 
Gets the 95% confidence interval for the EstimatedValue.
 
CriticalValue 
Gets the critical value for the current significance level.
(Inherited from HypothesisTestTDistribution.)  
EstimatedValue 
Gets the estimated parameter value, such as the sample's mean value.
 
Hypothesis 
Gets the alternative hypothesis under test. If the test is
Significant, the null hypothesis can be rejected
in favor of this alternative hypothesis.
 
HypothesizedValue 
Gets the hypothesized parameter value.
 
PValue 
Gets the Pvalue associated with this test.
(Inherited from HypothesisTestTDistribution.)  
Significant 
Gets whether the null hypothesis should be rejected.
(Inherited from HypothesisTestTDistribution.)  
Size 
Gets the significance level for the
test. Default value is 0.05 (5%).
(Inherited from HypothesisTestTDistribution.)  
StandardError 
Gets the standard error of the estimated value.
 
Statistic 
Gets the test statistic.
(Inherited from HypothesisTestTDistribution.)  
StatisticDistribution 
Gets the distribution associated
with the test statistic.
(Inherited from HypothesisTestTDistribution.)  
Tail 
Gets the test type.
(Inherited from HypothesisTestTDistribution.) 
Name  Description  

Compute(Double, Double, OneSampleHypothesis) 
Computes the Ttest.
 
Compute(Int32, Double, Double, Double, OneSampleHypothesis) 
Computes the TTest.
 
Equals  Determines whether the specified object is equal to the current object. (Inherited from Object.)  
Finalize  Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)  
GetConfidenceInterval 
Gets a confidence interval for the estimated value
within the given confidence level percentage.
 
GetHashCode  Serves as the default hash function. (Inherited from Object.)  
GetType  Gets the Type of the current instance. (Inherited from Object.)  
MemberwiseClone  Creates a shallow copy of the current Object. (Inherited from Object.)  
OnSizeChanged  Update event. (Overrides HypothesisTestTDistributionOnSizeChanged.)  
PValueToStatistic(Double) 
Converts a given pvalue to a test statistic.
(Overrides HypothesisTestTDistributionPValueToStatistic(Double).)  
PValueToStatistic(Double, TDistribution, DistributionTail) 
Converts a given pvalue to a test statistic.
 
StatisticToPValue(Double) 
Converts a given test statistic to a pvalue.
(Overrides HypothesisTestTDistributionStatisticToPValue(Double).)  
StatisticToPValue(Double, TDistribution, DistributionTail) 
Converts a given test statistic to a pvalue.
 
ToString 
Converts the numeric PValue of this test to its equivalent string representation.
(Inherited from HypothesisTestTDistribution.)  
ToString(String, IFormatProvider) 
Converts the numeric PValue of this test to its equivalent string representation.
(Inherited from HypothesisTestTDistribution.) 
Name  Description  

HasMethod 
Checks whether an object implements a method with the given name.
(Defined by ExtensionMethods.)  
IsEqual  Compares two objects for equality, performing an elementwise comparison if the elements are vectors or matrices. (Defined by Matrix.)  
ToT  Overloaded.
Converts an object into another type, irrespective of whether
the conversion can be done at compile time or not. This can be
used to convert generic types to numeric types during runtime.
(Defined by ExtensionMethods.)  
ToT  Overloaded.
Converts an object into another type, irrespective of whether
the conversion can be done at compile time or not. This can be
used to convert generic types to numeric types during runtime.
(Defined by Matrix.) 
The onesample ttest assesses whether the mean of a sample is statistically different from a hypothesized value.
This test supports creating power analyses through its Analysis property.
References:
// Consider a sample generated from a Gaussian // distribution with mean 0.5 and unit variance. double[] sample = { 0.849886940156521, 3.53492346633185, 1.22540422494611, 0.436945126810344, 1.21474290382610, 0.295033941700225, 0.375855651783688, 1.98969760778547, 1.90903448980048, 1.91719241342961 }; // One may rise the hypothesis that the mean of the sample is not // significantly different from zero. In other words, the fact that // this particular sample has mean 0.5 may be attributed to chance. double hypothesizedMean = 0; // Create a TTest to check this hypothesis TTest test = new TTest(sample, hypothesizedMean, OneSampleHypothesis.ValueIsDifferentFromHypothesis); // Check if the mean is significantly different test.Significant should be true // Now, we would like to test if the sample mean is // significantly greater than the hypothesized zero. // Create a TTest to check this hypothesis TTest greater = new TTest(sample, hypothesizedMean, OneSampleHypothesis.ValueIsGreaterThanHypothesis); // Check if the mean is significantly larger greater.Significant should be true // Now, we would like to test if the sample mean is // significantly smaller than the hypothesized zero. // Create a TTest to check this hypothesis TTest smaller = new TTest(sample, hypothesizedMean, OneSampleHypothesis.ValueIsSmallerThanHypothesis); // Check if the mean is significantly smaller smaller.Significant should be false