Get startedGet started for free

Testing for normality

1. Testing for normality

There are a lot of possible tests of normality. In this chapter, you'll learn about a graphical test and a numerical test.

2. How to test for normality

Let's start with the graphical test. It is called a Q-Q plot, which stands for quantile-quantile plot. That is because you effectively compare sample quantiles of the data and theoretical quantiles of a reference distribution. Because the objective is to test for normality, the reference distribution will be a standard normal. However, QQ plots can be used to compare data with any reference distribution. Let's look at the code which generates a Q-Qplot against normal and then discuss the interpretation of the data. First, let's look at some normal data and see what happens. You can generate normal data with the rnorm() function. In the code, the mean and standard deviation of the normal distribution have been set to 3 and 2, respectively, to show that the location and scaling of the distribution are not important. The function qqnorm plots the points, and qqline adds a straight line for reference. Since the data really are normal, the points are fairly close to a straight line.

3. Interpreting the Q-Q plot

If however, the data are heavier-tailed than normal you would tend to observe an inverted s-shape and if they were lighter-tailed you would tend to observe an s-shape. Skewed data would tend to give rise to a curved plot. Let's see what happens with the FTSE data. You get what I call the inverted s-shape. There is a steeper slope in the tails than in the middle. This indicates heavier tails.

4. Let's practice!

Now it's your turn to construct some Q-Qplots.