Coariance for ungrouped data
Use this calculator to find the covariance between $X$ and $Y$ for ungrouped (raw) data.
Covariance Calculator | |
---|---|
Enter the X Values (Separated by comma,) | |
Enter the Y Values (Separated by comma,) | |
Results | |
Number of Obs. (n): | |
Sample Mean of X : ($\overline{x}$) | |
Sample Mean of Y : ($\overline{y}$) | |
Sample variance of X: ($s^2_x$) | |
Sample variance of Y : ($s^2_y$) | |
Sample covariance between X and Y : ($s_{xy}$) | |
Covariance between X and Y for ungrouped data
Let $(x_i, y_i), i=1,2, \cdots , n$
be $n$ pairs of observations then the covariance between two variables $X$ and $Y$ is denoted by $cov(x,y)$ or $s_{xy}$ and is given by
$$ \begin{aligned} Cov(x,y)=s_{xy} &=\frac{1}{n-1}\sum_{i=1}^{n}(x_i -\overline{x})(y_i -\overline{y})\\ & =\frac{1}{n-1}\bigg(\sum_{i=1}^n xy - \frac{(\sum_{i=1}^n x)(\sum_{i=1}^n y)}{n}\bigg) \end{aligned} $$