Mathematics

Two-dimensional statistics

Study of two-dimensional distributions, scatter plots, marginal statistical parameters, covariance, Pearson correlation and regression lines.

They are those in which two variables of each element of the population are studied: for example weight and height, denoted as a pair of values (xi,yi)(x_i, y_i).
Example: Let the following distribution of weight and height of a population of 10 basketball players:
Height (x)186189190192193193198201203205
Weight (y)85858690879193103100101

Scatter plot

It is the representation in the x-y plane of the points of the distribution. It gives an idea of the relationship between the two variables.
Scatter plot
xix_iyiy_ifif_ixifix_i \cdot f_iyifiy_i \cdot f_ixi2fix_i^2 \cdot f_iyi2fiy_i^2 \cdot f_ixiyifix_i y_i \cdot f_i
1868511868534596722515810
1898511898535721722516065
1908611908636100739616340
1929011929036864810017280
1938711938737249756916791
1939111939137249828117563
1989311989339204864918414
2011031201103404011060920703
2031001203100412091000020300
2051011205101420251020120705
∑ = 1950921N=10195092138061885255179971
Being fif_i the number of times each data point is repeated. In the example all data points are unique.
Correlation
Indicates the dependence of one variable on the other.
  • Strong: the two variables are highly related. In the scatter plot, the points are aligned.
  • Weak: there is no appreciable relationship between the variables. The scatter plot is dispersed.
  • Direct: when one variable increases, the other also does. The slope of the correlation line is positive.
  • Inverse: as one variable increases, the other decreases. The slope of the correlation line is negative.

Pearson's correlation coefficient, r
Measures numerically the value of the correlation between the two variables. It takes a value between [-1, 1]. See the formula box to calculate it.
  • If r±1r \approx \pm 1 functional (perfect) correlation.
  • If rr is close to ±1\pm 1 strong correlation.
  • If rr is close to 00 weak correlation.
Marginal means:
xˉ=xifiNyˉ=yifiN\bar{x} = \frac{\sum x_i \cdot f_i}{N} \quad \quad \bar{y} = \frac{\sum y_i \cdot f_i}{N}
In our example xˉ=195\bar{x} = 195, yˉ=92.1\bar{y} = 92.1
The point (xˉ,yˉ)(\bar{x}, \bar{y}) is called the centroid

Marginal variances:
σx2=xi2fiNxˉ2σy2=yi2fiNyˉ2\sigma_x^2 = \frac{\sum x_i^2 \cdot f_i}{N} - \bar{x}^2 \quad \quad \sigma_y^2 = \frac{\sum y_i^2 \cdot f_i}{N} - \bar{y}^2
In our example σx2=36.8\sigma_x^2 = 36.8, σy2=43.09\sigma_y^2 = 43.09

Marginal standard deviations: positive square root of the marginal variances:
σx=+σx2σy=+σy2\sigma_x = +\sqrt{\sigma_x^2} \quad \quad \sigma_y = +\sqrt{\sigma_y^2}

Covariance
σxy=xiyifiNxˉyˉ\sigma_{xy} = \frac{\sum x_i \cdot y_i \cdot f_i}{N} - \bar{x} \cdot \bar{y}

Correlation coefficient:
r=σxyσxσyr = \frac{\sigma_{xy}}{\sigma_x \cdot \sigma_y}
  • If r>0\mathbf{r > 0}, the correlation is direct.
  • If r<0\mathbf{r < 0}, the correlation is inverse.
Direct and inverse correlation
It is the line that best fits the scatter plot, passing through the centroid (xˉ,yˉ)(\bar{x}, \bar{y}). There are two regression lines: y on x, and x on y:
Regression lines
Y on X:
yyˉ=σxyσx2(xxˉ)y - \bar{y} = \frac{\sigma_{xy}}{\sigma_x^2}(x - \bar{x})

X on Y:
xxˉ=σxyσy2(yyˉ)x - \bar{x} = \frac{\sigma_{xy}}{\sigma_y^2}(y - \bar{y})