This method gets the correlation value for two series of data.
This analysis tool and its formulas measure the relationship between two data sets that are scaled to be independent of the unit of measurement. The population correlation calculation returns the covariance of two data sets divided by the product of their standard deviations. You can use the Correlation tool 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).
Visual Basic (Declaration) | |
---|---|
Public Function Correlation( _ ByVal firstInputSeriesName As String, _ ByVal secondInputSeriesName As String _ ) As Double |
Visual Basic (Usage) | Copy Code |
---|---|
|
C# | |
---|---|
public double Correlation( string firstInputSeriesName, string secondInputSeriesName ) |
Parameters
- firstInputSeriesName
- The name of the series that stores the first group of data. Data must be stored in the first Y-values of the series' data points.
First Input Series Name - secondInputSeriesName
- The name of the series that stores the second group of data. Data must be stored in the first Y-values of the series' data points. An exception will be raised if both input series do not have the same number of data points.
Second Input Series Name
Return Value
Returns CorrelationVisual Basic | Copy Code |
---|---|
Imports Dundas.Charting.WebControl<CRLF>...<CRLF><CRLF>' Get the correlation<CRLF>Dim result As Double = Chart1.DataManipulator.Statistics.Correlation("Series1", "Series2") |
C# | Copy Code |
---|---|
using Dundas.Charting.WebControl;<CRLF>...<CRLF><CRLF>// Get correlation<CRLF>double result = Chart1.DataManipulator.Statistics.Correlation("Series1", "Series2"); |
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.
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family