A Robust Modification of the Goldfeld-Quandt Test for the Detection of Heteroscedasticity in the Presence of Outliers

Problem statement: The problem of heteroscedasticity occurs in regression analysis for many practical reasons. It is now evident that the heteroscedastic problem affects both the estimation and test procedure of regression analysis, so it is really important to be able to detect this problem for possible remedy. The existence of a few extreme or unusual observations that we often call outliers is a very common feature in data analysis. In this study we have shown how the existence of outliers makes the detection of heteroscedasticity cumbersome. Often outliers occurring in a homoscedastic model make the model heteroscedastic, on the other hand, outliers may distort the diagnostic tools in such a way that we cannot correctly diagnose the heteroscedastic problem in the presence of outliers. Neither of these situations is desirable. Approach: This article introduced a robust test procedure to detect the problem of heteroscedasticity which will be unaffected in the presence of outliers. We have modified one of the most popular and commonly used tests, the Goldfeld-Quandt, by replacing its nonrobust components by robust alternatives. Results: The performance of the newly proposed test is investigated extensively by real data sets and Monte Carlo simulations. The results suggest that the robust version of this test offers substantial improvements over the existing tests. Conclusion/Recommendations: The proposed robust Goldfeld-Quandt test should be employed instead of the existing tests in order to avoid misleading conclusion.


INTRODUCTION
It is a common practice over the years to use the Ordinary Least Squares (OLS) as the inferential technique in regression. Under the usual assumptions, the OLS possesses some nice and attractive properties. Among them homogeneity of error variances (homoscedasticity) is an important assumption for which the OLS estimators enjoy the minimum variance property. But there are many occasions [2] when the assumption of homoscedastic error variance is unreasonable. For example, if one is examining a cross section of firms in one industry, error terms associated with very large firms might have larger variance than those of error terms associated with smaller firms. If the error variance changes we call the error heteroscedastic. Heteroscedasticity often occurs when there is a large difference among the sizes of the observations. It is really important to detect this problem because if this problem is not eliminated the least squares estimators will still be unbiased, but they will no longer have the minimum variance property. This means that the regression coefficients will have larger standard errors than necessary.
A large number of diagnostic plots are now available in the literature [3,4,9,11,14] for detecting heteroscedasticity. But graphical methods are very subjective so we really need analytical methods to detect the problem of heteroscedasticity. Rigorous procedures for testing the homoscedasticity of data are available in the literature [1,5,15] . Most of these techniques are based on the least squares residuals but there is evidence that these residuals may not exhibit heteroscedastic pattern if outliers are present in the data. According to Hampel et al. [7] the existence of 1-10% outliers in a routine data is rather rule than exceptions. We suspect that these analytical tests may suffer from possessing poor power in the presence of outliers. In this study we first investigate how the commonly used heteroscedastic tests perform in the presence of outlier. We observe that all the tests considered in our study suffer in this situation and for this reason we robustify the Goldfeld-Quandt test. Real data sets and simulation experiments show that the proposed modified Goldfeld-Quandt test outperforms other tests in detecting heteroscedasticity in the presence of outliers.
An excellent review of different analytical tests for the detection of heteroscedasticity is available in Kutner, Nachtsheim and Neter [10] and in Chatterjee and Hadi [3] . In our study we consider the tests which are very popular and commonly used in econometrics. First we consider the Goldfeld-Quandt test. This test is applicable if one assumes that the heteroscedastic variance 2 t σ s is positively related to one of the explanatory variables in the model. For simplicity, let us consider the usual two-variable model: σ is positively related to X t as: where, σ 2 is a constant. Such an assumption has been found quite useful in family budgets. If (2) is appropriate, it would mean 2 t σ would be larger for the larger values of X. If that turns out to be the case, heteroscedasticity is most likely to be present in the model. To test this explicitly, Goldfeld and Quandt [9] suggest ordering the observations according to the values of X, beginning with the lowest X value. To possess better power they suggest omitting c central observations. OLS regressions are fitted separately to the first and last (n-c)/2 observations and the respective residual sum of squares RSS 1 and RSS 2 are obtained. Under normality of errors, each RSS follows a chisquare distribution with (n-c-2k)/2 degrees of freedom, where k is the number of parameters to be estimated, including the intercept. Then the ratio: Under the assumption of normality and homoscedasticity λ follows an F distribution with numerator and denominator d.f. each of (n-c-2k)/2.
The Goldfeld-Quandt test is a natural test to apply when one can order the observations in terms of the increasing variance of the error term (or one independent variable). An alternative test, which does not require such an ordering and is easy to apply, is the Breusch-Pagan test. To illustrate this test, consider the k-variable linear regression model: Assume that the error variance 2 t σ is described as: that is, 2 t σ is some function of the nonstochastic variable Z's; some or all of the X's can serve as Z's. We also assume that: that is, 2 t σ is a linear function of the Z's. If α 2 = α 2 = … = α m = 0, we get 2 t σ = α 1 , which is a constant.
Therefore, to test whether 2 t σ 's are homoscedastic, one can test the hypothesis that α 2 = α 3 = … = α m 0. This is the basic idea behind the Breusch-Pagan test. In this test we Estimate the model (6) by the least squares method and obtain the residuals. Then the mean of squared least square residuals 2 σ = 2 t u / n are computed and the variable 2 t t 2 u p= σ is constructed. Next we regress p t on the Z's to Obtain the SSE (error sum of squares). Finally we compute the test statistic: Under the assumption of normality and homoscedasticity T ~2 m 1 − χ and if the value of T exceeds the critical value, we conclude that heteroscedasticity is present in the data.
Unlike the Goldfeld-Quandt test, which requires reordering the observations with respect to the X variable that supposed to cause heteroscedasticity, or the Breusch-pagan test, which is sensitive to the normality assumption, the general test of heteroscedasticity proposed by White [20] does not rely on the normality assumption and is very easy to implement. As an illustration of the basic idea, consider the following three-variable regression model (the generalization to the k-variable model is straightforward). Given the data, we estimate regression parameters by the OLS method and obtain the residuals.
We then run the following (auxiliary) regression: where e t is the random error term. In other words, the squared residuals from the original regression are regressed on the original X variables or regressor, their squared values and the cross product(s) of the regressors. Higher power of the regressors can also be introduced. It is important here to note that there is a constant term in this equation even though the original regression may or may not contain it. Now we obtain the R 2 from this (auxiliary) regression. Under the null hypothesis that there is no heteroscedadticity, it can be shown that sample size (n) times the R 2 obtained from the auxiliary regression asymptotically follows the chisquare distribution with d.f. equal to the number regressors (excluding the constant term) in the auxiliary regression as given in (8). That is, for a regression model with p regressors: The degrees of freedom a = 2 p +p-1. If the chisquare value thus obtained exceeds the critical chisquare value at the chosen level of significance, the conclusion is that there exists heteroscedasticity.

MATERIALS AND METHODS
Modified Goldfield-Quandt test: we have briefly discussed some popular tests for heteroscedasticity detection. But there is evidence that all these tests suffer a huge setback when outliers are present in the data. So we need to develop a test which is not much affected by outliers. Here we propose a new test which is a modification of the Goldfeld-Quandt test. We first identify which components of the Goldfeld-Quandt test are affected by outliers and then replace these components by robust alternatives. It is worth mentioning that this kind of replacement does not help the other two tests that we consider in the previous section. We call this test the Modified Goldfeld-Quandt (MGQ) test which, we believe, will be more powerful than the existing tests in the presence of outliers.
Here we outline the proposed modified Goldfeld-Quandt test. This test contains the following steps: Step 1: Likewise the classical Goldfeld-Quandt test, we order or rank the observations according to the value of X, beginning with the lowest X values Step 2: We omit central c observations, where c is specified a priori and then we divide the remaining (n-c) observations into two groups each of (n-c)/2 observations Step 3: Check for the outliers by any robust regression technique. We prefer to use the robust Least Trimmed of Squares (LTS) method suggested by Rousseeuw and Leroy [13] to fit the regression line. We compute the deletion residuals [8] for the entire data set based on a fit without the points identified as outliers by the LTS fit.
where, MSDR 1 and MSDR 2 are the median of the squared deletion residuals for the smaller and the larger group variances respectively. Under normality, the MGQ statistic follows an F distribution with numerator and denominator degrees of freedom each of (n-c-2k)/2.

RESULTS AND DISCUSSION
Numerical examples: Here we present few examples to show the advantage of using the modified Goldfeld-Quandt test in the detection of heterogeneity of error variances problem.
Housing expenditures data: Our first example is the housing expenditures data given by Pindyck and Rubinfeld [12] . This single-predictor data set (Table 1) contains 20 observations that give housing expenditure for four different income groups. As expected, peoples with higher income have relatively more variation in their expenditures on housing. The scatter plot as shown in Fig. 1 clearly exhibits the heteroscedastic pattern of the data.     We now deliberately put two outliers into the data set by replacing the housing expenditures of the cases indexed by 1 and 20 (modified values are presented within the parentheses). Figure 2 shows the residuals-fits plot for the housing expenditures data. This plot is not as clear as Fig. 1 in exhibiting variance heteroscedasticity and we definitely need analytical tests to draw a definite conclusion.
We apply all the conventional tests like the Goldfeld-Quandt, the Breusch-Pagan and the White tests on the original and modified housing expenditures data and the results are presented in Table 2. We observe from this table that all the conventional tests variance when the data set is free from outliers. But all these tests fail to detect the problem of heteroscedasticity when outliers occur in the data set. We now apply our proposed modified Goldfeld-Quandt test on the original and modified housing expenditures data and these results are presented in Table 2. We observe from this table that the modified Goldfeld-Quandt test performs in a similar way as the Goldfeld-Quandt test when there is no outlier. But unlike the other tests, it can successfully detect the heteroscedasticity in the presence of outliers yielding a highly significant p-value.
Consumption expenditure data: Our next example is the consumption expenditure and income data given by Gujarati [6] . This data contains 30 observations and it shows that the expenditure of peoples vary with their income. So we can guess that in this data the variation is not constant. We now deliberately put three outliers into the data set by replacing the housing expenditures of the cases indexed by 1, 2 and 30 (modified values are presented within the parentheses). This data set together with the outliers is shown in Table 3. Figure 3 and 4 shows the residuals-fits plot for the original and modified consumption data. The variance heterogeneity is clearly visible with the original data but when outliers are present in the data this phenomenon is not clearly visible. Table 4 offers a comparison between the newly proposed modified Goldfeld-Quandt test and other existing tests in the detection of heteroscedasticity for the consumption data. Table 4 shows that the Goldfeld-Quandt, the Breusch-Pagan and the White tests can correctly identity the heteroscedastic pattern of variance when the data set is free from outliers but they become unsuccessful in the presence of outliers. The modified Goldfeld-Quandt test can successfully detect the heteroscedasticity on both the occasions. Table 3: Original and modified consumption expenditure data  Index  Expenditure  Income  Index  Expenditure  Income  Index  Expenditure  Income  1  55 (10)  80  11  74  105  21  152  220  2  65(10)  100  12  110  160  22  144  210  3  70  85  13  113  150  23  175  245  4  80  110  14  125  165  24  180  260  5  79  120  15  108  145  25  135  190  6  84  115  16  115  180  26  140  205  7  98  130  17  140  225  27  178  265  8  95  140  18  120  200  28  191  270  9  90  125  19  145  240  29  137  230  10  75  90  20  130  185  30 189 (100) 250   Restaurant food sales data: Finally we consider restaurant food sales data given by Montgomery et al. [11] In this data set there is a relation of income with advertising expense. Again we deliberately put three outliers into the data set by replacing the income of the cases indexed by 1, 27 and 30 (modified values are presented within the parentheses). The original and the modified data are shown in Table 5. Figure 5 and 6 show the residuals-fits plot for the original and modified consumption data. The varianc heterogeneity is clearly visible with the original data but when outliers are present in the data this phenomenon is not clearly visible.  Table 6 shows that the three conventional tests perform well in detection of heteroscedasticity but their performances become poor when outliers are present in the data.   The modified Goldfeld-Quandt test performs best. Irrespective of the presence of outliers it can successfully detect the heteroscedastic error variance in the data.
Simulation Study: Now from our experience with individual data sets we want to confirm our results by reporting a Monte Carlo simulation experiment. In our simulation experiment, we consider a design of 5 and 10% outliers in heteroscedastic data. Here we consider a simple but interesting heteroscedastic variance problem where the variance is the square of the mean of the response variable. Let us consider a simple two variable linear model: In our simulation study, all the values of X are being taken equally spaced such as 1, 2,…, 10 and these values are replicated several times to get higher sample sizes. We generate the random errors from Normal distributions with mean 0 and standard deviations X, 2X and 3X. We put outliers in the error term in every 20th or 10th position to generate 5 and 10% outliers respectively. The magnitude of the outlier is 5 times the standard deviation of the original errors. The Y values are obtained from the Eq. 11. We run this simulation experiment for five different sample sizes n = 20, 30, 40, 60 and 100. To assess which of the tests does the best in detecting heteroscedasticity in the presence of outliers we consider powers of four tests, the conventional Goldfeld-Quandt, Breusch-Pagan and White tests and the newly proposed modified Goldfeld-Quandt test. For each test we set the level of significance 0.05 and the results of this experiment are shown in Table 7-9 each of which is based on the average of 10,000 simulations. Table 7-9 offer comparisons between the newly proposed modified Goldfeld-Quandt test and conventional Goldfeld-Quandt, Breusch-Pagan and White tests in the detection of heteroscedasticity for the 5 and 10% outlier data. All the three conventional tests perform very poorly in simulation. The Goldfeld-Quandt test performs relatively well for 5% outliers. The Bruesch-Pagan test performs relatively well for 10% outlier cases but its performance tends to deteriorate with the increase in sample size. The White test performs worst in every situation. Throughout the simulation experiment each of the conventional tests shows inconsistence pattern for the sample size n = 30. But the newly proposed modified Goldfeld-Quandt test performs superbly throughout. For small sample size (n = 20) and lower contamination (5%) its performance is similar to the Goldfeld-Quandt test, but its power tends to increase with the increase in sample size. We also observe that the test is robust in the sense that it performs exactly in the same way when outliers occur in a data with different levels of error variances. Thus the modified Goldfeld-Quandt test outperforms the conventional tests in every respect and is proved to be the best overall.  -----------------------------------------------------------------------------------------------------------------------------------------------------Test  20  30  40  60  100  20  30  40  60

CONCLUSION
In this research we show that all commonly used tests for detecting heteroscedasticity fail when outliers are present in the data. We develop a new test in this regard which is a simple but robust modification of the Goldfeld-Quandt test. The real data sets and Monte Carlo simulations show that modified Goldfeld-Quandt test offers substantial improvements over the existing tests and performs superbly in the detection of heteroscedasticity in the presence of outliers.