Basic concepts of statistics
Statistics is the science of collecting, processing and evaluating data.
Population
The aim of statistics is to carry out an experiment that tells us something interesting about a given population. A population is, in general, any collection of items that we want to study. If we want to find out the average age of the people living in the United Kingdom, our population is everyone living in the United Kingdom.
But if we want to find out the average petrol consumption of cars per hundred kilometres, our population is the set of all cars (in a given area).
Sample
It is often impossible to work with every item in the population. Suppose we want to find out what people in the UK think about making maths compulsory for everyone up to the age of 18. To really find out, we would have to go from door to door and ask every single citizen what they think. That is not possible in practice. Some of the reasons:
- It is too expensive. Asking all of the roughly 68 million inhabitants is not cheap. For example, the first direct presidential election in the Czech Republic cost 625 million Czech koruna.
- It takes too long. An election surely takes several months to prepare – if you need the result of a statistical study within a week, that is far too slow.
- Not everyone will want to answer. Some people will refuse to answer your questions on principle. If our population is made up of machines, they can break down. If you were recording the number of kilometres cars have driven, a mileometer might break or someone might deliberately wind it back.
- The experiment may be too dangerous. Nobody is likely to have a heart attack from a question about compulsory maths, but take a different example – testing a new medicine, the “cure-all”. What would happen if we tested the cure-all on the whole population of the UK and found that 20% of the people tested immediately got dreadful diarrhoea? It would probably be better to test the medicine on a smaller group of people first, wouldn’t it?
To avoid these drawbacks, we choose only a part of the population, called a sample. If we have a population P, then a sample V is any subset of P, that is V ⊆ P. We then carry out our experiment only on the sample V and generalise the results to the whole population. These results will of course be inexact – how inexact depends mainly on how large the sample V is and on the method we used to choose the items in V.
Typical mistakes are:
- Too few items in V. If you ask the first seven people you see about compulsory maths, you cannot get meaningful results.
- An unrepresentative sample of the population. If you ask a thousand maths graduates about compulsory maths, you will get different answers from those you would get by asking a thousand Year 13 students.
Variables
During an experiment we study the items in the sample. The characteristics we record are called variables, and the values a variable takes are called its values. There are several basic types of variable:
- Categorical variable: it usually makes no sense to measure this variable – it is some kind of description in words. A typical example is a question about nationality. The values of such a variable are, for example, “British nationality” and “French nationality”. It makes no sense to measure or compare British and French nationality as such. We can compare the numbers of British and French people, but we cannot compare the nationalities themselves.
The question about compulsory maths belongs to this category too, where the expected answers are “yes, I want maths to be compulsory” or “no, I don’t want maths to be compulsory”, and these are the values of the variable. Again we can compare the numbers of answers, but it makes no sense to compare the “yes” and the “no” themselves.
- Numerical variable: we can measure this variable. It covers lengths, masses, times, counts and so on. Numerical variables are further divided into discrete and continuous variables:
Discrete variable
A discrete variable has either a finite number of values or a countable number of values (see below). Quite often they are integers. For example, the number of students in a class – in an ordinary class there will be somewhere between fifteen and forty children.
A discrete variable is characterised by the fact that we can always say what the next and previous values are. If class 3B has 28 children, the previous value is 27 children and the next is 29 children. With a categorical variable we usually cannot do this – what is the value that follows British nationality?
A discrete variable can also be infinite, but it must be countable – that is, we must still be able to say which values come before and after any given value. For example, we could introduce the variable “distance between two objects, to the nearest kilometre”. If we measure the distance between two objects, say a car and a barn, as 12 kilometres, then again the next and previous values are 13 and 11 kilometres. The distance is probably not limited in any way. If two objects are 1,500,000 kilometres apart, we can certainly find objects that are 1,500,001 kilometres apart.
The variable would still be discrete if we changed the precision to tenths of a kilometre (that is, to hundreds of metres). Then we could measure a distance of 15.7 km, and the next and previous values would be 15.8 and 15.6.
If a previous or next value does not exist, this does not contradict the variable being discrete. For example, for a distance of zero kilometres there is no previous value – we do not define a distance of minus one kilometre. Even so, distance to the nearest kilometre is a discrete variable.
Continuous variable
A continuous variable always has infinitely many values. The values are typically real numbers, so an example is distance (with no mention of precision). With continuous variables we cannot name the previous or the next value. If we measure something as 3.58745 metres long, we cannot find the number that comes immediately after it.
The real numbers also include the irrational numbers, with infinite decimal expansions. Of course, we have no instruments that could measure a distance to such precision, so in reality every such variable is discrete after all – precisely because every instrument has some precision. If you measure something with a ruler, you can read it to the nearest millimetre. So you can find that a book is 167 mm or 168 mm wide, but nothing in between – unless you estimate it somehow.
If you have a more scientific instrument, you might be able to measure to the nearest micrometre. But even that probably will not be enough to measure an object absolutely exactly.
In spite of all this, we usually talk about distance or mass as continuous variables. In practice this kind of simplification is necessary and usually does no harm.
Random variable
A random variable is a discrete or continuous variable whose resulting value we cannot determine before carrying out the experiment. So the result of rolling a six-sided dice can be a random variable. Until we roll the dice, we cannot know which number will come up.
We may be able to predict that some values are more likely than others – that does not matter, we just must not be completely sure that we will get a particular value. For example, if we picked one inhabitant of the UK at random and asked them which town or city they live in, it is more likely that they live in London than somewhere like Wetwang. Simply, more people live in London.
If we had a dice with six spots on five faces and two spots on the remaining sixth face, we would be far more likely to roll six spots. But it is still a random variable, because it is not certain that six spots will come up.
If we altered this dice so that all six faces had six spots, rolling it would not be a random variable, because we would always get six spots.