# Class BasicStatisticalFormulas

The BasicStatisticalFormulas class provides the functionality for the Basic Statistical formulas Mean,Median, .

##### Inheritance

##### Inherited Members

**Namespace**: Syncfusion.Windows.Forms.Chart.Statistics

**Assembly**: Syncfusion.Chart.Base.dll

##### Syntax

`public class BasicStatisticalFormulas`

### Constructors

#### BasicStatisticalFormulas()

Initializes a new instance of the BasicStatisticalFormulas class.

##### Declaration

`public BasicStatisticalFormulas()`

### Methods

#### Anova(Double, ChartSeries[])

Performs Anova (Analysis of variance test) on input series. All series should have the same number of points. The tests null hypothesis assumes that all series means are equal and that all variances of series are also equal. The alternative to null hypothesis is that there is one inequality between means of series. For better understanding of this test, we recommend to read: Dowdy, S. M. Statistics for research / Shirley Dowdy, Stanley Weardon, Daniel Chilko. p. cm. � (Wiley series in probability and statistics; 1345)

##### Declaration

`public static AnovaResult Anova(double probability, ChartSeries[] inputSeries)`

##### Parameters

Type | Name | Description |
---|---|---|

System.Double | probability | Probability that gives confidence level. (Typically 0.05) |

ChartSeries[] | inputSeries | Series array |

##### Returns

Type | Description |
---|---|

AnovaResult | AnovaResult class |

##### Remarks

An ANOVA test is used to test the difference between the means of two or more groups of data.

Two or more groups of data (series) must be specified, and each series must have the same number of data points otherwise an exception will be raised.

If a specified input series does not exist in the series collection at the time of the method call than an exception will be thrown.

##### Examples

The following code demonstrate how to calculate AnovaTest

```
using Syncfusion.Windows.Forms.Chart.Statistics;
........
AnovaResult ar = BasicStatisticalFormulas.Anova(0.5,new ChartSeries[]{ series1, series2, series3} );
```

```
Imports Syncfusion.Windows.Forms.Chart.Statistics
........
Dim ar As AnovaResult = BasicStatisticalFormulas.Anova(0.5, New ChartSeries(){ series1, series2, series3})
```

#### Anova(Double, ChartSeries[], Int32)

Performs Anova (Analysis of variance test) on input series. All series should have the same number of points. The tests null hypothesis assumes that all series means are equal and that all variances of series are also equal. The alternative to null hypothesis is that there is one inequality between means of series. For better understanding of this test, we recommend to read: Dowdy, S. M. Statistics for research / Shirley Dowdy, Stanley Weardon, Daniel Chilko. p. cm. � (Wiley series in probability and statistics; 1345)

##### Declaration

`public static AnovaResult Anova(double probability, ChartSeries[] inputSeries, int yIndex)`

##### Parameters

Type | Name | Description |
---|---|---|

System.Double | probability | Probability that gives confidence level. (Typically 0.05) |

ChartSeries[] | inputSeries | Series array |

System.Int32 | yIndex | Index of the Y value. |

##### Returns

Type | Description |
---|---|

AnovaResult | AnovaResult class |

##### Remarks

An ANOVA test is used to test the difference between the means of two or more groups of data.

Two or more groups of data (series) must be specified, and each series must have the same number of data points otherwise an exception will be raised.

If a specified input series does not exist in the series collection at the time of the method call than an exception will be thrown.

##### Examples

The following code demonstrate how to calculate AnovaTest

```
using Syncfusion.Windows.Forms.Chart.Statistics;
........
AnovaResult ar = BasicStatisticalFormulas.Anova(0.5,new ChartSeries[]{ series1, series2, series3}, 0 );
```

```
Imports Syncfusion.Windows.Forms.Chart.Statistics
........
Dim ar As AnovaResult = BasicStatisticalFormulas.Anova(0.5, New ChartSeries(){ series1, series2, series3}, 0)
```

#### Correlation(ChartSeries, ChartSeries)

Calculates correlation of series X values.

##### Declaration

`public static double Correlation(ChartSeries series1, ChartSeries series2)`

##### Parameters

Type | Name | Description |
---|---|---|

ChartSeries | series1 | The name of the Series object that stores the first group's data. |

ChartSeries | series2 | The name of the Series object that stores the second group's data. An exception will be raised if the input series do not have the same number of data points. |

##### Returns

Type | Description |
---|---|

System.Double | A double that represents the Correlation value between the two groups of data. |

##### Remarks

Correlation measures the relationship between two data sets that are scaled to be independent of the unit of measurement. This correlation method returns the covariance of two data sets divided by the product of their standard deviations, and always ranges from -1 to 1. Use correlation to determine whether two ranges of data move together that is, whether large values of one set are associated with large values of the other (positive correlation), whether small values of one set are associated with large values of the other (negative correlation), or whether values in both sets are unrelated (correlation near zero).

If a specified input series does not exist in the series collection at the time of the method call than an exception will be thrown. An exception will also be raised if the series do not have the same number of data points.

##### Examples

The following Code demonstrate how to gets the Correlation of the data points in a series

```
using Syncfusion.Windows.Forms.Chart.Statistics;
............
double Correlation1= Statistics.BasicStatisticalFormulas.Correlation(series1,series2);
```

```
Imports Syncfusion.Windows.Forms.Chart.Statistics
.............
Dim Correlation1 As Double
Correlation1=BasicStatisticalFormulas.Correlation(series1,series2)
```

#### Correlation(ChartSeries, ChartSeries, Int32)

Calculates correlation of series Y values.

##### Declaration

`public static double Correlation(ChartSeries series1, ChartSeries series2, int yIndex)`

##### Parameters

Type | Name | Description |
---|---|---|

ChartSeries | series1 | The name of the Series object that stores the first group's data. |

ChartSeries | series2 | The name of the Series object that stores the second group's data. An exception will be raised if the input series do not have the same number of data points. |

System.Int32 | yIndex | Index of the Y value. |

##### Returns

Type | Description |
---|---|

System.Double | A double that represents the Correlation value between the two groups of data. |

##### Remarks

Correlation measures the relationship between two data sets that are scaled to be independent of the unit of measurement. This correlation method returns the covariance of two data sets divided by the product of their standard deviations, and always ranges from -1 to 1. Use correlation to determine whether two ranges of data move together that is, whether large values of one set are associated with large values of the other (positive correlation), whether small values of one set are associated with large values of the other (negative correlation), or whether values in both sets are unrelated (correlation near zero).

If a specified input series does not exist in the series collection at the time of the method call than an exception will be thrown. An exception will also be raised if the series do not have the same number of data points.

##### Examples

The following Code demonstrate how to gets the Correlation of the data points in a series

```
using Syncfusion.Windows.Forms.Chart.Statistics;
............
double Correlation1= Statistics.BasicStatisticalFormulas.Correlation(series1,series2,0);
```

```
Imports Syncfusion.Windows.Forms.Chart.Statistics
.............
Dim Correlation1 As Double
Correlation1=BasicStatisticalFormulas.Correlation(series1,series2,0)
```

#### Covariance(ChartSeries, ChartSeries)

Calculates covariance of series X values.

##### Declaration

`public static double Covariance(ChartSeries series1, ChartSeries series2)`

##### Parameters

Type | Name | Description |
---|---|---|

ChartSeries | series1 | The name of the Series object that stores the first group's data. |

ChartSeries | series2 | The name of the Series object that stores the second group's data. An exception will be raised if the input series do not have the same number of data points. |

##### Returns

Type | Description |
---|---|

System.Double | A double that represents the covariance value between the two groups of data. |

##### Remarks

This method returns the average of the product of deviations of the data points from their respective means.

Covariance is a measure of the relationship between two ranges of data, and can be used to determine whether two ranges of data move together - that is, whether large values of one set are associated with large values of the other (positive covariance), whether small values of one set are associated with large values of the other (negative covariance), or whether values in both sets are unrelated (covariance near zero).

If a specified input series does not exist in the series collection at the time of the method call than an exception will be thrown. An exception will also be raised if the series do not have the same number of data points.

##### Examples

The following Code demonstrate how to gets the Covariance of the data points in a series

```
using Syncfusion.Windows.Forms.Chart.Statistics;
............
double Covariance1= Statistics.BasicStatisticalFormulas.Covariance(series1,series2);
```

```
Imports Syncfusion.Windows.Forms.Chart.Statistics
.............
Dim Covariance1 As Double
Covariance1=BasicStatisticalFormulas.Covariance(series1,series2)
```

#### Covariance(ChartSeries, ChartSeries, Int32)

Calculates covariance of series Y values.

##### Declaration

`public static double Covariance(ChartSeries series1, ChartSeries series2, int yIndex)`

##### Parameters

Type | Name | Description |
---|---|---|

ChartSeries | series1 | The name of the Series object that stores the first group's data. |

ChartSeries | series2 | |

System.Int32 | yIndex | Index of the Y index. |

##### Returns

Type | Description |
---|---|

System.Double | A double that represents the covariance value between the two groups of data. |

##### Remarks

This method returns the average of the product of deviations of the data points from their respective means.

Covariance is a measure of the relationship between two ranges of data, and can be used to determine whether two ranges of data move together - that is, whether large values of one set are associated with large values of the other (positive covariance), whether small values of one set are associated with large values of the other (negative covariance), or whether values in both sets are unrelated (covariance near zero).

##### Examples

The following Code demonstrate how to gets the Covariance of the data points in a series

```
using Syncfusion.Windows.Forms.Chart.Statistics;
............
double Covariance1= Statistics.BasicStatisticalFormulas.Covariance(series1,series2, 0);
```

```
Imports Syncfusion.Windows.Forms.Chart.Statistics
.............
Dim Covariance1 As Double
Covariance1=BasicStatisticalFormulas.Covariance(series1,series2, 0)
```

#### FTest(Double, ChartSeries, ChartSeries)

Performs F test on input series. This test looks whether first series variance is smaller than second series variance. If FValue in FTestResult is bigger than FCriticalValueOneTail than we can't deduce that it is truly smaller. The test tests ratio of two variances s1^2/s2^2 which is proved to be distributed according F distribution. The null hypothesis is that variances are equal.

##### Declaration

`public static FTestResult FTest(double probability, ChartSeries firstInputSeries, ChartSeries secondInputSeries)`

##### Parameters

Type | Name | Description |
---|---|---|

System.Double | probability | Probability that gives confidence level. (Typically 0.05) |

ChartSeries | firstInputSeries | The name of the series that stores the first group of data. |

ChartSeries | secondInputSeries | The name of the series that stores the second group of data. |

##### Returns

Type | Description |
---|---|

FTestResult | FTestResult class |

##### Remarks

This method returns the results of the F-test using an FTestResult object.

FTest performs a two-sample F-test to compare two population variances. For example, it can be used to determine whether the time scores in a swimming meet have a difference in variance for samples from two teams.

If a specified input series does not exist in the series collection at the time of the method call than an exception will be thrown.

##### Examples

The following code demonstrate how to calculate FTest.

```
using Syncfusion.Windows.Forms.Chart.Statistics;
........
FTestResult ftr = BasicStatisticalFormulas.FTest(0.05, series1, series2);
```

```
Imports Syncfusion.Windows.Forms.Chart.Statistics
........
Dim ftr As FTestResult = BasicStatisticalFormulas.FTest(0.05, series1, series2)
```

#### FTest(Double, ChartSeries, ChartSeries, Int32)

Performs F test on input series. This test looks whether first series variance is smaller than second series variance. If FValue in FTestResult is bigger than FCriticalValueOneTail than we can't deduce that it is truly smaller. The test tests ratio of two variances s1^2/s2^2 which is proved to be distributed according F distribution. The null hypothesis is that variances are equal.

##### Declaration

`public static FTestResult FTest(double probability, ChartSeries firstInputSeries, ChartSeries secondInputSeries, int yIndex)`

##### Parameters

Type | Name | Description |
---|---|---|

System.Double | probability | Probability that gives confidence level. (Typically 0.05) |

ChartSeries | firstInputSeries | The name of the series that stores the first group of data. |

ChartSeries | secondInputSeries | The name of the series that stores the second group of data. |

System.Int32 | yIndex | Index of the y. |

##### Returns

Type | Description |
---|---|

FTestResult | FTestResult class |

##### Remarks

This method returns the results of the F-test using an FTestResult object.

FTest performs a two-sample F-test to compare two population variances. For example, it can be used to determine whether the time scores in a swimming meet have a difference in variance for samples from two teams.

##### Examples

The following code demonstrate how to calculate FTest.

```
using Syncfusion.Windows.Forms.Chart.Statistics;
........
FTestResult ftr = BasicStatisticalFormulas.FTest(0.05, series1, series2, 0);
```

```
Imports Syncfusion.Windows.Forms.Chart.Statistics
........
Dim ftr As FTestResult = BasicStatisticalFormulas.FTest(0.05, series1, series2, 0)
```

#### Mean(ChartSeries)

Calculates mean value of series X values.

##### Declaration

`public static double Mean(ChartSeries series)`

##### Parameters

Type | Name | Description |
---|---|---|

ChartSeries | series | The name of the Series object that stores the first group's data for which an average is required. |

##### Returns

Type | Description |
---|---|

System.Double | Returns a double value that represents the average of all the data points in the given series. |

##### Remarks

Use this method to calculate the mean (i.e. average) of the points stored in a series.

If the specified input series does not exist in the SeriesCollection at the time of the method call than an exception will be thrown.

##### Examples

The following code demonstrate how to get the average of the data points in a series.

```
using Syncfusion.Windows.Forms.Chart.Statistics;
............
double Mean1=BasicStatisticalFormulas.Mean(series1);
```

```
Imports Syncfusion.Windows.Forms.Chart.Statistics
.............
Dim Mean1 As Double
Mean1=BasicStatisticalFormulas.Mean(series1)
```

#### Mean(ChartSeries, Int32)

Calculates mean value of series Y values.

##### Declaration

`public static double Mean(ChartSeries series, int yIndex)`

##### Parameters

Type | Name | Description |
---|---|---|

ChartSeries | series | The name of the Series object that stores the first group's data for which an average is required. |

System.Int32 | yIndex | Index of the Y value. |

##### Returns

Type | Description |
---|---|

System.Double | Returns a double value that represents the average of all the data points in the given series. |

##### Remarks

Use this method to calculate the mean (i.e. average) of the points stored in a series.

If the specified input series does not exist in the SeriesCollection at the time of the method call than an exception will be thrown.

##### Examples

The following code demonstrate how to get the average of the data points in a series.

```
using Syncfusion.Windows.Forms.Chart.Statistics;
............
double Mean1=BasicStatisticalFormulas.Mean(series1, 0);
```

```
Imports Syncfusion.Windows.Forms.Chart.Statistics
.............
Dim Mean1 As Double
Mean1=BasicStatisticalFormulas.Mean(series1, 0)
```

#### Median(ChartSeries)

Calculates Median of series X values.

##### Declaration

`public static double Median(ChartSeries series)`

##### Parameters

Type | Name | Description |
---|---|---|

ChartSeries | series | The input series |

##### Returns

Type |
---|

System.Double |

##### Remarks

Use this method to calculate the median of the points stored in a series. The median is the middle value of a sample set, where half of the members are greater in size and half the members are lesser in size.

if the specified input series does not exist in the SeriesCollection at the time of the method call than an exception will be thrown.

##### Examples

The following Code demonstrate how to gets the median of the data points in a series

```
using Syncfusion.Windows.Forms.Chart.Statistics;
............
double Median1= Statistics.BasicStatisticalFormulas.Median(series1);
```

```
Imports Syncfusion.Windows.Forms.Chart.Statistics
.............
Dim Median1 As Double
Median1=BasicStatisticalFormulas.Median(series1)
```

#### Median(ChartSeries, Int32)

Calculates Median of series Y values.

##### Declaration

`public static double Median(ChartSeries series, int yIndex)`

##### Parameters

Type | Name | Description |
---|---|---|

ChartSeries | series | The input series |

System.Int32 | yIndex | Index of the Y index. |

##### Returns

Type |
---|

System.Double |

##### Remarks

Use this method to calculate the median of the points stored in a series. The median is the middle value of a sample set, where half of the members are greater in size and half the members are lesser in size.

if the specified input series does not exist in the SeriesCollection at the time of the method call than an exception will be thrown.

##### Examples

The following Code demonstrate how to gets the median of the data points in a series

```
using Syncfusion.Windows.Forms.Chart.Statistics;
............
double Median1= Statistics.BasicStatisticalFormulas.Median(series1, 0);
```

```
Imports Syncfusion.Windows.Forms.Chart.Statistics
.............
Dim Median1 As Double
Median1=BasicStatisticalFormulas.Median(series1, 0)
```

#### StandardDeviation(ChartSeries, Boolean)

Calculates variance of series X values.

##### Declaration

`public static double StandardDeviation(ChartSeries series, bool sampleVariance)`

##### Parameters

Type | Name | Description |
---|---|---|

ChartSeries | series | The name of the Series object that stores the group of data. |

System.Boolean | sampleVariance | True if the data is a sample of a population, false if it is the entire population. |

##### Returns

Type | Description |
---|---|

System.Double | A double that represents the Standard Deviation within the group of data. |

##### Remarks

This method estimates the Standard Deviation for a sample.

If the specified input series does not exist in the series collection at the time of the method call than an exception will be thrown.

##### Examples

The following Code demonstrate how to gets the Standard Deviation of the data points in a series

```
using Syncfusion.Windows.Forms.Chart.Statistics;
............
double Standard1= Statistics.BasicStatisticalFormulas.StandartDeviation(series,false);
```

```
Imports Syncfusion.Windows.Forms.Chart.Statistics
.............
Dim Standard1 As Double
Standard1=BasicStatisticalFormulas.StandartDeviation(series,false)
```

#### StandardDeviation(ChartSeries, Int32, Boolean)

Calculates variance of series Y values.

##### Declaration

`public static double StandardDeviation(ChartSeries series, int yIndex, bool sampleVariance)`

##### Parameters

Type | Name | Description |
---|---|---|

ChartSeries | series | The name of the Series object that stores the group of data. |

System.Int32 | yIndex | Index of the Y value. |

System.Boolean | sampleVariance | True if the data is a sample of a population, false if it is the entire population. |

##### Returns

Type | Description |
---|---|

System.Double | A double that represents the Standard Deviation within the group of data. |

##### Remarks

This method estimates the Standard Deviation for a sample.

If the specified input series does not exist in the series collection at the time of the method call than an exception will be thrown.

##### Examples

The following Code demonstrate how to gets the Standard Deviation of the data points in a series

```
using Syncfusion.Windows.Forms.Chart.Statistics;
............
double Standard1= Statistics.BasicStatisticalFormulas.StandardDeviation(series,0,false);
```

```
Imports Syncfusion.Windows.Forms.Chart.Statistics
.............
Dim Standard1 As Double
Standard1=BasicStatisticalFormulas.StandardDeviation(series,0,false)
```

#### TTestEqualVariances(Double, Double, ChartSeries, ChartSeries)

Performs T test on input series. This test assumes that there is some difference between mean values of input series populations. Input series are regarded as samples from normally distributed populations. The population variances are assumed to be equal. This is a key feature of the test, because there is no exact T test for two samples from populations with different variances.

##### Declaration

`public static TTestResult TTestEqualVariances(double hypothesizedMeanDifference, double probability, ChartSeries firstInputSeries, ChartSeries secondInputSeries)`

##### Parameters

Type | Name | Description |
---|---|---|

System.Double | hypothesizedMeanDifference | Difference between populations means. |

System.Double | probability | Probability that gives confidence level. (Typically 0.05) |

ChartSeries | firstInputSeries | The name of the series that stores the first group of data. |

ChartSeries | secondInputSeries | The name of the series that stores the second group of data. |

##### Returns

Type | Description |
---|---|

TTestResult | TTestResult class |

##### Remarks

This method performs a T test for two groups of data, and assumes equal variances between the two groups (i.e. series).

If either input series does not exist in the series collection at the time of the method call an exception will be thrown.

##### Examples

The following code demonstrate how to calculate TTest Equal Variance

```
using Syncfusion.Windows.Forms.Chart.Statistics;
........
TTestResult ttr = BasicStatisticalFormulas.TTestEqualVariances (0.2, 0.05, series1, series2);
```

```
Imports Syncfusion.Windows.Forms.Chart.Statistics
........
Dim ttr As TTestResult = BasicStatisticalFormulas.TTestEqualVariances (0.2, 0.05, series1, series2)
```

#### TTestEqualVariances(Double, Double, ChartSeries, ChartSeries, Int32)

Performs T test on input series. This test assumes that there is some difference between mean values of input series populations. Input series are regarded as samples from normally distributed populations. The population variances are assumed to be equal. This is a key feature of the test, because there is no exact T test for two samples from populations with different variances.

##### Declaration

`public static TTestResult TTestEqualVariances(double hypothesizedMeanDifference, double probability, ChartSeries firstInputSeries, ChartSeries secondInputSeries, int yIndex)`

##### Parameters

Type | Name | Description |
---|---|---|

System.Double | hypothesizedMeanDifference | Difference between populations means. |

System.Double | probability | Probability that gives confidence level. (Typically 0.05) |

ChartSeries | firstInputSeries | The name of the series that stores the first group of data. |

ChartSeries | secondInputSeries | The name of the series that stores the second group of data. |

System.Int32 | yIndex | Index of the Y index. |

##### Returns

Type | Description |
---|---|

TTestResult | TTestResult class |

##### Remarks

This method performs a T test for two groups of data, and assumes equal variances between the two groups (i.e. series).

If either input series does not exist in the series collection at the time of the method call an exception will be thrown.

##### Examples

The following code demonstrate how to calculate TTest Equal Variance

```
using Syncfusion.Windows.Forms.Chart.Statistics;
........
TTestResult ttr = BasicStatisticalFormulas.TTestEqualVariances (0.2, 0.05, series1, series2, 0);
```

```
Imports Syncfusion.Windows.Forms.Chart.Statistics
........
Dim ttr As TTestResult = BasicStatisticalFormulas.TTestEqualVariances (0.2, 0.05, series1, series2, 0)
```

#### TTestPaired(Double, Double, ChartSeries, ChartSeries)

Performs T test on input series. This test assumes that there is some difference between mean values of input series populations. Input series are regarded as samples from normally distributed populations. The population variances are assumed to be unequal. So this method is not statistically exact, but it works well, and sometimes is called robust T test.

##### Declaration

`public static TTestResult TTestPaired(double hypothesizedMeanDifference, double probability, ChartSeries firstInputSeries, ChartSeries secondInputSeries)`

##### Parameters

Type | Name | Description |
---|---|---|

System.Double | hypothesizedMeanDifference | Difference between populations means. |

System.Double | probability | Probability that gives confidence level. (Typically 0.05) |

ChartSeries | firstInputSeries | The name of the series that stores the first group of data. |

ChartSeries | secondInputSeries | The name of the series that stores the second group of data. |

##### Returns

Type | Description |
---|---|

TTestResult | TTestResult class |

##### Remarks

This method performs a paired two-sample student's t-test to determine whether a sample's means are distinct. This form of the t-test does not assume that the variances of both populations are equal.

Use a paired test when there is a natural pairing of observations in the samples, such as a sample group that is tested twice (e.g. before and after an experiment).

If either input series does not exist in the series collection at the time of the method call an exception will be thrown.

##### Examples

The following code demonstrate how to calculate TTestPaired

```
using Syncfusion.Windows.Forms.Chart.Statistics;
........
TTestResult ttr = BasicStatisticalFormulas.TTestPaired(0.2, 0.05, series1, series2);
```

```
Imports Syncfusion.Windows.Forms.Chart.Statistics
........
Dim ttr As TTestResult = BasicStatisticalFormulas.TTestPaired (0.2, 0.05, series1, series2)
```

#### TTestPaired(Double, Double, ChartSeries, ChartSeries, Int32)

Performs T test on input series. This test assumes that there is some difference between mean values of input series populations. Input series are regarded as samples from normally distributed populations. The population variances are assumed to be unequal. So this method is not statistically exact, but it works well, and sometimes is called robust T test.

##### Declaration

`public static TTestResult TTestPaired(double hypothesizedMeanDifference, double probability, ChartSeries firstInputSeries, ChartSeries secondInputSeries, int yIndex)`

##### Parameters

Type | Name | Description |
---|---|---|

System.Double | hypothesizedMeanDifference | Difference between populations means. |

System.Double | probability | Probability that gives confidence level. (Typically 0.05) |

ChartSeries | firstInputSeries | The name of the series that stores the first group of data. |

ChartSeries | secondInputSeries | The name of the series that stores the second group of data. |

System.Int32 | yIndex | Index of the Y value. |

##### Returns

Type | Description |
---|---|

TTestResult | TTestResult class |

##### Remarks

This method performs a paired two-sample student's t-test to determine whether a sample's means are distinct. This form of the t-test does not assume that the variances of both populations are equal.

Use a paired test when there is a natural pairing of observations in the samples, such as a sample group that is tested twice (e.g. before and after an experiment).

##### Examples

The following code demonstrate how to calculate TTestPaired

```
using Syncfusion.Windows.Forms.Chart.Statistics;
........
TTestResult ttr = BasicStatisticalFormulas.TTestPaired(0.2, 0.05, series1, series2, 0);
```

```
Imports Syncfusion.Windows.Forms.Chart.Statistics
........
Dim ttr As TTestResult = BasicStatisticalFormulas.TTestPaired (0.2, 0.05, series1, series2, 0)
```

#### TTestUnEqualVariances(Double, Double, ChartSeries, ChartSeries)

Performs T test on input series. This test assumes that there is some difference between mean values of input series populations. Input series are regarded as samples from normally distributed populations. The population variances are assumed to be unequal. So this method is not statistically exact, but it works well, and sometimes is called robust T test.

##### Declaration

`public static TTestResult TTestUnEqualVariances(double hypothesizedMeanDifference, double probability, ChartSeries firstInputSeries, ChartSeries secondInputSeries)`

##### Parameters

Type | Name | Description |
---|---|---|

System.Double | hypothesizedMeanDifference | Difference between populations means. |

System.Double | probability | Probability that gives confidence level. (Typically 0.05) |

ChartSeries | firstInputSeries | The name of the series that stores the first group of data. |

ChartSeries | secondInputSeries | The name of the series that stores the second group of data. |

##### Returns

Type | Description |
---|---|

TTestResult | TTestResult class |

##### Remarks

This method performs a T test for two groups of data, and assumes unequal variances between the two groups (i.e. series).

This analysis tool is referred to as a heteroscedastic t-test, and can be used when the groups under study are distinct. Use a paired test when there is one group before and after a treatment.

##### Examples

The following code demonstrate how to calculate TTest UnEqual Variance

```
using Syncfusion.Windows.Forms.Chart.Statistics;
........
TTestResult ttr = BasicStatisticalFormulas.TTestUnEqualVariances (0.2, 0.05, series1, series2);
```

```
Imports Syncfusion.Windows.Forms.Chart.Statistics
........
Dim ttr As TTestResult = BasicStatisticalFormulas.TTestUnEqualVariances (0.2, 0.05, series1, series2)
```

#### TTestUnEqualVariances(Double, Double, ChartSeries, ChartSeries, Int32)

##### Declaration

`public static TTestResult TTestUnEqualVariances(double hypothesizedMeanDifference, double probability, ChartSeries firstInputSeries, ChartSeries secondInputSeries, int yIndex)`

##### Parameters

Type | Name | Description |
---|---|---|

System.Double | hypothesizedMeanDifference | Difference between populations means. |

System.Double | probability | Probability that gives confidence level. (Typically 0.05) |

ChartSeries | firstInputSeries | The name of the series that stores the first group of data. |

ChartSeries | secondInputSeries | The name of the series that stores the second group of data. |

System.Int32 | yIndex | Index of the Y value. |

##### Returns

Type | Description |
---|---|

TTestResult | TTestResult class |

##### Remarks

This method performs a T test for two groups of data, and assumes unequal variances between the two groups (i.e. series).

This analysis tool is referred to as a heteroscedastic t-test, and can be used when the groups under study are distinct. Use a paired test when there is one group before and after a treatment.

##### Examples

The following code demonstrate how to calculate TTest UnEqual Variance

```
using Syncfusion.Windows.Forms.Chart.Statistics;
........
TTestResult ttr = BasicStatisticalFormulas.TTestUnEqualVariances (0.2, 0.05, series1, series2, 0);
```

```
Imports Syncfusion.Windows.Forms.Chart.Statistics
........
Dim ttr As TTestResult = BasicStatisticalFormulas.TTestUnEqualVariances (0.2, 0.05, series1, series2, 0)
```

#### Variance(ChartSeries, Boolean)

Calculates variance of series X values.

##### Declaration

`public static double Variance(ChartSeries series, bool sampleVariance)`

##### Parameters

Type | Name | Description |
---|---|---|

ChartSeries | series | The name of the Series object that stores the group of data. |

System.Boolean | sampleVariance | True if the data is a sample of a population, false if it is the entire population. |

##### Returns

Type | Description |
---|---|

System.Double | A double that represents the variance within the group of data. |

##### Remarks

This method estimates the variance for a sample.

If the specified input series does not exist in the series collection at the time of the method call than an exception will be thrown.

##### Examples

The following Code demonstrate how to gets the Variance of the data points in a series

```
using Syncfusion.Windows.Forms.Chart.Statistics;
............
double Variance1= Statistics.BasicStatisticalFormulas.Variance(series,true);
```

```
Imports Syncfusion.Windows.Forms.Chart.Statistics
.............
Dim Variance1 As Double
Variance1=BasicStatisticalFormulas.Variance(series,true)
```

#### Variance(ChartSeries, Int32, Boolean)

Calculates variance of series Y values.

##### Declaration

`public static double Variance(ChartSeries series, int yIndex, bool sampleVariance)`

##### Parameters

Type | Name | Description |
---|---|---|

ChartSeries | series | The name of the Series object that stores the group of data. |

System.Int32 | yIndex | Index of the Y value. |

System.Boolean | sampleVariance | True if the data is a sample of a population, false if it is the entire population. |

##### Returns

Type | Description |
---|---|

System.Double | A double that represents the variance within the group of data. |

##### Remarks

This method estimates the variance for a sample.

##### Examples

The following Code demonstrate how to gets the Variance of the data points in a series

```
using Syncfusion.Windows.Forms.Chart.Statistics;
............
double Variance1= Statistics.BasicStatisticalFormulas.Variance(series,true);
```

```
Imports Syncfusion.Windows.Forms.Chart.Statistics
.............
Dim Variance1 As Double
Variance1=BasicStatisticalFormulas.Variance(series,true)
```

#### VarianceBiasedEstimator(ChartSeries)

Calculates variance of series X values.

##### Declaration

`public static double VarianceBiasedEstimator(ChartSeries series)`

##### Parameters

Type | Name | Description |
---|---|---|

ChartSeries | series | The name of the Series object that stores the group of data. |

##### Returns

Type | Description |
---|---|

System.Double | A double that represents the variance within the group of data. |

##### Remarks

This method estimates the variance for a sample.

##### Examples

The following Code demonstrate how to gets the VarianceBasedEstimator of the data points in a series

```
using Syncfusion.Windows.Forms.Chart.Statistics;
............
double VarianceBased1= Statistics.BasicStatisticalFormulas.VarianceBiasedEstimator(series);
```

```
Imports Syncfusion.Windows.Forms.Chart.Statistics
.............
Dim VarianceBased1 As Double
VarianceBased1=BasicStatisticalFormulas.VarianceBiasedEstimator(series)
```

#### VarianceBiasedEstimator(ChartSeries, Int32)

Calculates variance of series Y values.

##### Declaration

`public static double VarianceBiasedEstimator(ChartSeries series, int yIndex)`

##### Parameters

Type | Name | Description |
---|---|---|

ChartSeries | series | The name of the Series object that stores the group of data. |

System.Int32 | yIndex | Index of the Y value. |

##### Returns

Type | Description |
---|---|

System.Double | A double that represents the variance within the group of data. |

##### Remarks

This method estimates the variance for a sample.

##### Examples

The following Code demonstrate how to gets the VarianceBasedEstimator of the data points in a series

```
using Syncfusion.Windows.Forms.Chart.Statistics;
............
double VarianceBased1= Statistics.BasicStatisticalFormulas.VarianceBiasedEstimator(series, 0);
```

```
Imports Syncfusion.Windows.Forms.Chart.Statistics
.............
Dim VarianceBased1 As Double
VarianceBased1=BasicStatisticalFormulas.VarianceBiasedEstimator(series, 0)
```

#### VarianceUnbiasedEstimator(ChartSeries)

Calculates variance of series X values.

##### Declaration

`public static double VarianceUnbiasedEstimator(ChartSeries series)`

##### Parameters

Type | Name | Description |
---|---|---|

ChartSeries | series | The name of the Series object that stores the group of data. |

##### Returns

Type | Description |
---|---|

System.Double | A double that represents the variance within the group of data. |

##### Remarks

This method estimates the variance for a sample.

##### Examples

The following Code demonstrate how to gets the VarianceUnBasedEstimator of the data points in a series

```
using Syncfusion.Windows.Forms.Chart.Statistics;
............
double VarianceUnBased1= Statistics.BasicStatisticalFormulas.VarianceUnBiasedEstimator(series);
```

```
Imports Syncfusion.Windows.Forms.Chart.Statistics
.............
Dim VarianceUnBased1 As Double
VarianceUnBased1=BasicStatisticalFormulas.VarianceUnBiasedEstimator(series)
```

#### VarianceUnbiasedEstimator(ChartSeries, Int32)

Calculates variance of series Y values.

##### Declaration

`public static double VarianceUnbiasedEstimator(ChartSeries series, int yIndex)`

##### Parameters

Type | Name | Description |
---|---|---|

ChartSeries | series | The name of the Series object that stores the group of data. |

System.Int32 | yIndex | Index of the Y value. |

##### Returns

Type | Description |
---|---|

System.Double | A double that represents the variance within the group of data. |

##### Remarks

This method estimates the variance for a sample.

##### Examples

The following Code demonstrate how to gets the VarianceUnBasedEstimator of the data points in a series

```
using Syncfusion.Windows.Forms.Chart.Statistics;
............
double VarianceUnBased1= Statistics.BasicStatisticalFormulas.VarianceUnBiasedEstimator(series, 0);
```

```
Imports Syncfusion.Windows.Forms.Chart.Statistics
.............
Dim VarianceUnBased1 As Double
VarianceUnBased1=BasicStatisticalFormulas.VarianceUnBiasedEstimator(series, 0)
```

#### ZTest(Double, Double, Double, Double, ChartSeries, ChartSeries)

Performs Z test on input series. This test assumes that there is some difference between mean values of input series populations. Input series are regarded as samples from normally distributed populations with known variances.

##### Declaration

`public static ZTestResult ZTest(double hypothesizedMeanDifference, double varianceFirstGroup, double varianceSecondGroup, double probability, ChartSeries firstInputSeries, ChartSeries secondInputSeries)`

##### Parameters

Type | Name | Description |
---|---|---|

System.Double | hypothesizedMeanDifference | Difference between populations means. |

System.Double | varianceFirstGroup | Variance of the first series population. |

System.Double | varianceSecondGroup | Variance of the second series population. |

System.Double | probability | Probability that gives confidence level. (Typically 0.05) |

ChartSeries | firstInputSeries | The name of the series that stores the first group of data.. |

ChartSeries | secondInputSeries | The name of the series that stores the second group of data.. |

##### Returns

Type | Description |
---|---|

ZTestResult | ZTestResult Class |

##### Remarks

This method performs a Z test for two groups of data, and returns the results using a ZTestResult object.

Two and only two groups of data must be specified. If either input series does not exist in the series collection at the time of the method call than an exception will be thrown.

##### Examples

The following code demonstrate how to calculate Ztest

`ZTestResult ztr = BasicStatisticalFormulas.ZTest( Convert.ToDouble(TextBox6.Text.ToString()),sqrtVarianceOfFirstSeries*sqrtVarianceOfFirstSeries,sqrtVarianceOfSecondSeries* sqrtVarianceOfSecondSeries,0.05,series1,series2);`

`Dim ztr As ZTestResult = BasicStatisticalFormulas.ZTest(Convert.ToDouble(TextBox6.Text.ToString()), sqrtVarianceOfFirstSeries*sqrtVarianceOfFirstSeries, sqrtVarianceOfSecondSeries*sqrtVarianceOfSecondSeries, 0.05, series1, series2)`

#### ZTest(Double, Double, Double, Double, ChartSeries, ChartSeries, Int32)

Performs Z test on input series. This test assumes that there is some difference between mean values of input series populations. Input series are regarded as samples from normally distributed populations with known variances.

##### Declaration

`public static ZTestResult ZTest(double hypothesizedMeanDifference, double varianceFirstGroup, double varianceSecondGroup, double probability, ChartSeries firstInputSeries, ChartSeries secondInputSeries, int yIndex)`

##### Parameters

Type | Name | Description |
---|---|---|

System.Double | hypothesizedMeanDifference | Difference between populations means. |

System.Double | varianceFirstGroup | Variance of the first series population. |

System.Double | varianceSecondGroup | Variance of the second series population. |

System.Double | probability | Probability that gives confidence level. (Typically 0.05) |

ChartSeries | firstInputSeries | The name of the series that stores the first group of data.. |

ChartSeries | secondInputSeries | The name of the series that stores the second group of data.. |

System.Int32 | yIndex | Index of the Y value. |

##### Returns

Type | Description |
---|---|

ZTestResult | ZTestResult Class |

##### Remarks

This method performs a Z test for two groups of data, and returns the results using a ZTestResult object.

Two and only two groups of data must be specified. If either input series does not exist in the series collection at the time of the method call than an exception will be thrown.

##### Examples

The following code demonstrate how to calculate Ztest

`ZTestResult ztr = BasicStatisticalFormulas.ZTest( Convert.ToDouble(TextBox6.Text.ToString()),sqrtVarianceOfFirstSeries*sqrtVarianceOfFirstSeries,sqrtVarianceOfSecondSeries* sqrtVarianceOfSecondSeries,0.05,series1,series2, 0);`

`Dim ztr As ZTestResult = BasicStatisticalFormulas.ZTest(Convert.ToDouble(TextBox6.Text.ToString()), sqrtVarianceOfFirstSeries*sqrtVarianceOfFirstSeries, sqrtVarianceOfSecondSeries*sqrtVarianceOfSecondSeries, 0.05, series1, series2, 0)`