User:Ecn eva/sandbox

Basic examples
McLave et al. give the following example. The table and figure shows two samples. Each sample has five observations. Each sample has a mean of 3. But the spread of the observations around the mean is different for the two samples.



The sample variance of Sample 1 is calculated as follows. The formula for the sample variance is


 * $$s^2 = \frac{\sum_{i=1}^N (x_i - \overline{x})^2}{N-1} .$$

where $$\textstyle\{x_1,\,x_2,\,\ldots,\,x_N\}$$ are the observed values, $$\textstyle\overline{x}$$ is the mean value of these observations, and N is the number of observations in the sample.

In the sample variance formula the numerator is the sum of the squared deviation of each observation from the mean. The table below shows the calculation of this sum of squared deviations for Sample 1. For Sample 1, the sum of squared deviations from the mean is 10.

The denominator in the sample variance formula is N – 1, where N is the number of observations. In this example, there are N = 5 observations, so the denominator is 5 – 1 = 4. The sample variance for Sample 1 is therefore


 * $$s^2 = \frac{\sum_{i=1}^N (x_i - \overline{x})^2}{N-1} = \frac{10}{4} = 2.5.$$

The next table shows the calculation for Sample 2. For Sample 2, the sum of squared deviations from the mean is 2.

As for Sample 1, the denominator is N - 1 = 5 – 1 = 4. The sample variance for Sample 2 is therefore


 * $$s^2 = \frac{\sum_{i=1}^N (x_i - \overline{x})^2}{N-1} = \frac{2}{4} = 0.5.$$

The sample standard deviation is the positive square root of the sample variance.

The sample standard deviation of Sample 1 is $$s = \sqrt{2.5} = 1.581$$.

The sample standard deviation of Sample 2 is $$s = \sqrt{0.5} = 0.707$$.