The variance is a number that indicates how far a set of numbers lie apart. The variance is identical to the squared standard deviation and hence expresses “the same thing” (but more strongly).

## Variance - Example

A study has 100 people perform a simple speed task during 80 trials. For each participant, 80 reaction times (in seconds) are thus recorded. Part of these data are shown below.

In studies like these, we typically see that people get faster as they perform the speed task more often. That is, the average reaction time tends to decrease over trials.

Also, reaction times will typically *vary* less between different people insofar as they perform the task more often. Technically, we say that the **variance decreases over trials**. The table below illustrates this for trials 1,4,7 and 10.

## Variance and Histogram

A great way to visualize the data from our previous table is a histogram for each trial. Like so, the figure below illustrates that participants got faster over trials; from trial 1 to trial 10 the histogram bars move leftwards, towards 0 seconds.

A second finding is that the histograms become narrower (and therefore higher) as we move from trial 1 to trial 10; this illustrates that reaction times vary less and less between our participants as the experiment progresses. The variance decreases over trials.

## Variance - Population Formula

A basic formula for calculating the variance is

$$S^2 = \frac{\sum(X - \overline{X})^2}{n}$$

We recommend you try to understand what this formula does because this helps a lot in understanding ANOVA (= analysis of variance). We'll therefore demonstrate it on a mere handful of data.

## Variance - GoogleSheets

For the sake of simplicity, we'll cut down our data to the first trial for the first 5 participants. These 5 reaction times -and a manual calculation of their variance- are in this GoogleSheet.

## Variance - Calculation Steps

The formulas in the GoogleSheet show precisely how to calculate a variance. The basic steps are

- calculate the
**mean**reaction time (2.15); - calculate
**deviation scores**(reaction time minus mean reaction time); - calculate
**squared deviation**scores; - add squared deviation scores. The result (0.49) is a
**sum of squares**, the main building block of ANOVA; **divide**the sum of squares by the number of observations (5 reaction times).

Alternatively, calculate a variance by typing `=VARP(B2:B6)`

in some cell (B2:B6 are the cells that hold our 5 reaction times). `VARP`

is short for “variance population”. OpenOffice and MS Excel contain similar formulas.

## Variance - Sample Formula

Similarly to the standard deviation, if our data are a simple random sample from a much larger population, the aforementioned formula will systematically underestimate the population variance. In this case we'll use a slightly different formula:

$$S^2 = \frac{\sum(X - \overline{X})^2}{n - 1}$$

Which formula to use thus depends on our data: do they contain the entire population we'd like to investigate or are they a mere sample from this population?

Since our 100 participants are clearly a sample, we'll use the sample formula. In GoogleSheets, typing `=VAR(B2:B6)`

in some cell will return the sample variance.

## Variance in SPSS

Insofar as we know, the formula for the population variance is completely absent from SPSS and we consider this a serious flaw. Instead, **SPSS always uses the sample formula**.This goes for the between subjects variance (discussed in this tutorial) as well as the within subjects variance. Relevant output is shown below.

Regarding this output table, also note that the variance is indeed the squared standard deviation (apart from rounding).

Regarding the variance, that's about it. We hope you found this tutorial helpful in understanding what a variance is.

## This tutorial has 5 comments

## By William Peck on November 29th, 2018

Good one ...

## By Ruben Geert van den Berg on January 15th, 2018

Hi Kalinka, thanks for the compliment, happy to hear you liked it!

P.s. I love Bulgaria, especially Rila and Stara Planina are among my favorite destinations.

## By Kalinka Velichkova on January 15th, 2018

very understandable! Thank you!

## By Chamila on November 1st, 2017

Send more tutorials

## By agnesgorogodo on October 7th, 2016

Very educative