Basics of statistics
Statistics is a science that tries to study real data and, with the help of probability theory, to describe that data.
A separate section for statistics
This is an old and out-of-date article. Statistics now has its own section with the introductory article Basic concepts of statistics.
Basic concepts
In statistics we work with several basic concepts, which we will describe here.
First of all there is the data set (statistical population), which is a finite set of data that we want to study. The data can be of any kind – it can be more or less anything. If you want to study the average salary in the United Kingdom, the data set will be the set of all people in the United Kingdom. The number of elements in a data set is called the sample size. The sample size of the data set we have defined would therefore be equal to the population of the United Kingdom.
Next there is the concept of an individual, which is a specific element of the data set. In our case an individual would be one particular person.
Finally we have the variable, which is what we want to measure. In our example the variable would be the salary. A variable can be either categorical or numerical. A numerical (quantitative) variable is one that can be expressed with numbers (for example that same salary, height, number of children, …), while a categorical (qualitative) variable can be expressed in words (colour, yes/no, occupation, …).
Frequencies
A frequency can be either relative or absolute, and tells you how many values of a given variable occur in the data set – either absolutely, or relative to the total number of elements in the set.
It is important that when we count a frequency we must apply a variable, because if we wanted to work out the absolute frequency of an individual, we would necessarily arrive at either zero or one, since a data set is a set and a set as such does not allow the same element to appear in it more than once.
So the absolute frequency of a value z of the variable tells you the number of occurrences of z in the data set S. Example: take a class of ten pupils. Each pupil received a grade in maths on their school report, from 1 to 9. The grades are recorded in the following table:
Note: the data set for this example would be the ten classmates, something like
For simplicity, the first row of the table holds a numerical identifier of the pupil, so the first row contains the individuals, that is, the elements of the data set. The second row holds the values of the variable, that is, the values of “final maths grade” for that pupil.
The absolute frequency of the value (the grade on the school report) z = 5 would therefore be equal to two – only two pupils received a 5 on their report (they are “pupils” 3 and 10). The absolute frequency of the value z = 9 would be three (“pupils” 5, 6 and 9).
The relative frequency tells you what percentage of the values of the variable in the data set are equal to the value z. We work out the relative frequency of z as follows:
where za is the absolute frequency of z and |S| is the size of the data set, that is, the number of elements. The relative frequency of the grade 5 would therefore be:
The size of our data set is ten, because there are ten pupils in the class. We get the percentage by multiplying by one hundred, so we would get 20%. The relative frequency of the grade 9 would be
Arithmetic mean
The arithmetic mean, or often just the mean, is the average of all the values in the data set. By the word value we mean the value after applying the variable. We work out the mean by adding up all the values and dividing by the number of values in the set. Roughly like this:
I have also added an expression using sigma notation, in case you find it easier to read. But the previous expression with the fraction is enough. The values x represent all the values in our data set.
Example: let’s take the data from the previous table and work out the mean grade per pupil.
In our class the mean grade is 6.2. As you can see, the arithmetic mean can give us a value that is not actually valid at all – you cannot be given a grade of 6.2.
The arithmetic mean is also hard to use when part of the data has a fundamentally different value from the rest. So if we have a data set with the values 1, 3, 2, 5, 4, 2, 75, the arithmetic mean comes out as
We see that the resulting value is far from all the values in the set. It is several times larger than the first six numbers and several times smaller than the last value. This is a problem that the median, for example, can solve – see below. At least now you know why two thirds of people do not reach the average salary – there is a small group of people with exceptionally high salaries, which raise the arithmetic mean.
Geometric mean
The geometric mean is worked out similarly to the arithmetic mean, except that instead of addition we use multiplication and instead of division we use a root. So we work out the geometric mean like this:
The geometric mean can be used as an indicator of growth. For example, suppose the price of a product rose by 10% in one year, by 15% the next year and by 5% the year after. The original price c would then be, after those three years,
The geometric mean of these multipliers would be:
What does that mean? That if the price were multiplied by exactly 1.0992419 every year (that is, increased by roughly 9.92%), the final price would be the same:
Mode and median
The mode of a variable is the value with the highest frequency, written Mod(x). Returning to the example with grades, the modes are the values 9 and 7, because they occur most often – both have an absolute frequency of 3.
The median is the middle value, written Med(x). If we can arrange the values into a non-decreasing sequence
then the median is the value in the middle of this sequence. The middle value differs depending on whether the sequence has an odd or an even number of elements. If it is odd, the median is the element in position
If the sequence has an even number of elements, it has no element exactly in the middle (for example, the sequence 1, 2, 3, 4 simply has no middle element). So we take the mean of the two middle values (the mean of the values 2 and 3). So the formula for even n is:
Let’s go back to the example that illustrated the badly used arithmetic mean. We had the data set s=1, 3, 2, 5, 4, 2, 75. The mode would be equal to two – it is the only number that repeats. To work out the median we put the numbers in a sequence in order:
The sequence has seven elements, so the middle element is a4 and that is equal to three.