Edit

Share via


WorksheetFunction.Covariance_P(Object, Object) Method

Definition

Returns population covariance, the average of the products of deviations for each data point pair.

public:
 double Covariance_P(System::Object ^ Arg1, System::Object ^ Arg2);
public double Covariance_P (object Arg1, object Arg2);
Public Function Covariance_P (Arg1 As Object, Arg2 As Object) As Double

Parameters

Arg1
Object

The first cell range of integers.

Arg2
Object

The second cell range of integers.

Returns

Remarks

Use Covariance_P to determine the relationship between two data sets. For example, you can examine whether greater income accompanies greater levels of education.

The arguments must either be numbers or be names, arrays, or references that contain numbers.

If an array or reference argument contains text, logical values, or empty cells, those values are ignored; however, cells with the value zero are included.

If Arg1 and Arg2 have different numbers of data points, Covariance_P generates an error.

If either Arg1 or Arg2 is empty, Covariance_P generates an error.

The covariance is:

Figure 1: Equation for covariance

where x and y are the sample means AVERAGE(array1) and AVERAGE(array2), and n is the sample size.

Applies to