# Testing for Normality

Your book, Principles of Econometrics, discusses the Jarque-Bera test for normality which is computed using the skewness and kurtosis of the least squares residuals. To compute the Jarque- Bera statistic, you’ll first need to estimate your model using least squares and then save the residuals to the data set.

From the gretl console

1 ols food_exp const income

2 series uhatl = \$uhat

3 summary uhatl

The first line is the regression. The next accesses the least squares redsiduals, \$uhat, and places
them into a new series called uhatl.5 You could also use the point-and-click method to add the residuals to the data set. This is accomplished from the regression’s output window. Simply choose Save>Residuals from the model pull-down menu to add the estimated residuals to the dataset. The last line of the script produces the summary statistics for the residuals and yields the output in Figure 4.12. One thing to note, gretl reports excess kurtosis rather than kurtosis. The excess

Summary Statistics, using the observations 1-40 for the variable ’uhat!’ (40 valid observations)  Mean

Median

Minimum

Maximum

Standard deviation C. V.

Skewness Ex. kurtosis

Figure 4.12: The summary statistics for the least squares residuals.

kurtosis is measured relative to that of the normal distribution which has kurtosis of three. Hence, your computation is

JB = T ^Skewness2 + (Excess Kurt°sis)^ (4.7) 0.063

 (4.8)

 6

Normal random variables have no skewness nor any excess kurtosis. The JB statistic is zero in this case. It gets larger the higher the skewness and the greater the degree of excess kurtosis displayed by the data. In section C.1 hansl is used to compute skewness and excess kurtosis and you could use these computations to compute your own JB test. Fortunately, there is no need to compute your own because gretl will compute the Jarque-Bera test for you. After saving the residuals into \$uhat1 issue the command

ols food_exp const income series uhatl = \$uhat normtest uhatl —jbera normtest uhat1 —all This yields a value of Jarque-Bera test = 0.0633401, with p-value 0.968826, which is exactly what the manual calculation yields. Gretl performs other tests for the normality of residuals including one by Doornik and Hansen (2008). Computationally, it is more complex than the Jarque-Bera test. The Doornik-Hansen test has a x2 distribution if the null hypothesis of normality is true. It can be produced from normtest along with several others using the –all option. Output from normtest —all is shown in Figure 4.13. Obviously, one of the advantages of using normtest is

that you can test for the normality of any series, not just residuals.

Another possibility is to use the modtest function after estimating a model using least squares.

ols food_exp const income modtest —normality

The modtest command is actually is a generic function that allows you to test a number of different hypotheses regarding the specification of your model. This function operates on the residuals of

the last model estimated. Using it after a regression with the —normality option produces the following output

Frequency distribution for uhat2, obs 1-40

number of bins = 7, mean = -2.45137e-014, sd = 89.517

 interval midpt frequency rel. cum. < -186.77 -223.03 1 2.50% 2.50% -186.77 – -114.26 -150.51 3 7.50% 10.00% ** -114.26 – -41.747 -78.002 8 20.00% 30.00% ******* -41.747 – 30.765 -5.4907 14 35.00% 65.00% ************ 30.765 – 103.28 67.021 8 20.00% 85.00% ******* 103.28 – 175.79 139.53 5 12.50% 97.50% **** >= 175.79 212.04 1 2.50% 100.00%

Test for null hypothesis of normal distribution: Chi-square(2) = 0.694 with p-value 0.70684

The distribution of the residuals is collected and plotted in a basic graph and the results for the DH test are given. If modtest is executed from GUI using Tests>Normality of residuals in the model results window, a gnuplot histogram of the errors is generated with a normal density overlaid. The results of the DH test are again printed on the graph.