A fully nonparametric diagnostic test for homogeneity of variances

14
The Canadian Journal of Starisrics VoI. 33, No. 4,2005, Pages 545-558 Ia revue canadienne de sratisrique 545 A fully nonparametric diagnostic test for homogeneity of variances Lan WANG and Xiao-Hua ZHOU Key words andphrases: Analysis of variance; constant variance; health care costs; heteroscedastic errors; nearest-neighbourwindows; nonparametric regression; residual. MSC 2000: Primary 62G10; secondary 62620,62102. Abstract: The authors propose a new nonparametric diagnostic test for checking the constancy of the con- ditional variance function ~‘(5) in the regression model Y, = m(z,) + u(zi)ei, i = 1,. . . , m. Their test, which does not assume a known parametric form for the conditional mean function m(z), is inspired by a recent asymptotic theory in the analysis of variance when the number of factor levels is large. The authors demonstrate through simulationsthe good finite-sampleproperties of the test and illustrate its use in a study on the effect of drug utilization on health care costs. Une procedure diagnostique completement non parametrique pour tester I’hornogeneite de la variance RbumC : Les auteurs proposent un nouveau test diagnostique non paramktrique permettant de verifier si la variance conditionnelle a2(z) est constante dans le modhle de dgression X = m(z,) + u(si)ei, i = 1, . . . , m. Leur test, qui ne suppose rien quant 21 la forme parametrique de I’esp6rance conditionnelle m(z), s’inspire de r6sultats rrkents sur le comportementde l’analyse de la variance lorsque croft le nombre de modalit& par facteur. Les auteurs confirment par simulation les bonnes propri6t6s du test 21 taille finie et ils en illustrent I’emploi dans le cadre d’une etude sur I’effet de la consommation de maicaments sur les coats de sant6. 1. INTRODUCTION Homoscedasticity or constant variance is a standard assumption in regression models. Ignor- ing heteroscedasticity can lead to inefficient estimation or incorrect inference (Ruppert, Wand & Carroll 2003, ch. 14). Heteroscedasticity in linear models can result in substantial inefficiency in ordinary least squares estimation (Greens 2000). In many applications, however, it is not uncommon to find the assumption of homoscedasticity violated. Examples include calibration experiments in the physical and biological sciences, radioimmunoassay, econometrics, pharma- cokinetic modelling (Davidian & Carroll 1987) and prospective payment modelling (Maciejew- ski, Zhou, Fortney & Burgess 2004). It is therefore important to be able to assess the adequacy of this assumption. Graphical diagnostic procedures, such as plotting the residuals versus the fitted value (or the covariate), often provide useful visual aid (e.g., Cook & Weisberg 1982, § 2.3). Formal tests are needed to evaluate whether the patterns observed are due to random fluctuations. Consider the following nonparametric regression model: Y,i = g(xmi) + o(xmi)&mi, i = 1,. . m, (1) where Ymi is the response, g(x) is an unknown regression function, xml,. . . , x , are fixed design points on [0,1], 02(x) is the variance function, and the form a triangular array of row-wise independent random variables with mean 0 and variance 1. For simplicity in notation, the sample size m in the subscript will be omitted whenever feasible. Of interest is to test if this regression model is homoscedastic. The null hypothesis thus is: HO : 02(x) = 2 for all x, (2)

Transcript of A fully nonparametric diagnostic test for homogeneity of variances

Page 1: A fully nonparametric diagnostic test for homogeneity of variances

The Canadian Journal of Starisrics VoI. 33, No. 4,2005, Pages 545-558 Ia revue canadienne de sratisrique

545

A fully nonparametric diagnostic test for homogeneity of variances Lan WANG and Xiao-Hua ZHOU

Key words andphrases: Analysis of variance; constant variance; health care costs; heteroscedastic errors; nearest-neighbour windows; nonparametric regression; residual.

MSC 2000: Primary 62G10; secondary 62620,62102.

Abstract: The authors propose a new nonparametric diagnostic test for checking the constancy of the con- ditional variance function ~ ‘ ( 5 ) in the regression model Y, = m(z,) + u(zi)ei, i = 1 , . . . , m. Their test, which does not assume a known parametric form for the conditional mean function m(z), is inspired by a recent asymptotic theory in the analysis of variance when the number of factor levels is large. The authors demonstrate through simulations the good finite-sample properties of the test and illustrate its use in a study on the effect of drug utilization on health care costs.

Une procedure diagnostique completement non parametrique pour tester I’hornogeneite de la variance RbumC : Les auteurs proposent un nouveau test diagnostique non paramktrique permettant de verifier si la variance conditionnelle a2(z) est constante dans le modhle de dgression X = m(z,) + u(si)ei, i = 1, . . . , m. Leur test, qui ne suppose rien quant 21 la forme parametrique de I’esp6rance conditionnelle m(z), s’inspire de r6sultats rrkents sur le comportement de l’analyse de la variance lorsque croft le nombre de modalit& par facteur. Les auteurs confirment par simulation les bonnes propri6t6s du test 21 taille finie et ils en illustrent I’emploi dans le cadre d’une etude sur I’effet de la consommation de maicaments sur les coats de sant6.

1. INTRODUCTION Homoscedasticity or constant variance is a standard assumption in regression models. Ignor- ing heteroscedasticity can lead to inefficient estimation or incorrect inference (Ruppert, Wand & Carroll 2003, ch. 14). Heteroscedasticity in linear models can result in substantial inefficiency in ordinary least squares estimation (Greens 2000). In many applications, however, it is not uncommon to find the assumption of homoscedasticity violated. Examples include calibration experiments in the physical and biological sciences, radioimmunoassay, econometrics, pharma- cokinetic modelling (Davidian & Carroll 1987) and prospective payment modelling (Maciejew- ski, Zhou, Fortney & Burgess 2004). It is therefore important to be able to assess the adequacy of this assumption.

Graphical diagnostic procedures, such as plotting the residuals versus the fitted value (or the covariate), often provide useful visual aid (e.g., Cook & Weisberg 1982, § 2.3). Formal tests are needed to evaluate whether the patterns observed are due to random fluctuations.

Consider the following nonparametric regression model:

Y,i = g(xmi) + o(xmi)&mi , i = 1,. . m, (1)

where Ymi is the response, g ( x ) is an unknown regression function, xml,. . . , x,, are fixed design points on [0,1], 02(x) is the variance function, and the form a triangular array of row-wise independent random variables with mean 0 and variance 1. For simplicity in notation, the sample size m in the subscript will be omitted whenever feasible. Of interest is to test if this regression model is homoscedastic. The null hypothesis thus is:

HO : 02(x) = 2 for all x, (2)

Page 2: A fully nonparametric diagnostic test for homogeneity of variances

546 WANG & ZHOU Vol. 33, No. 4

for some unknown positive constant 02. We will allow for a general nonparametric alternative which only assumes 0 2 ( x ) to be any nonconstant smooth function. We will propose a fully nonparametric approach for testing (2) . The test will not require direct estimation of g(x), which can be any Lipschitz continuous function. It also allows flexible distributions for the ~ , i .

When the functional form of 0 2 ( x ) is restricted to some parametric class, various paramet- ric and semiparametric tests were proposed (Bickel 1978; Cook & Weisberg 1983; Davidian & Carroll 1987; Carroll & Ruppert 1988, among others). These tests generally assume a known parametric form for g(x). An assumption of normality is often imposed, too. For the general situation when 0 2 ( x ) belongs to an infinite-dimensional space of smooth functions, Eubank & Thomas (1993) propose a test but their method assumes normality and requires the choice of some weight function. The approach of Muller & Zhao (1995) requires that the relation be- tween g(x) and 0 2 ( x ) follow a generalized linear model. Zheng (1996) provides a nonpara- metric Lagrange Multiplier (LM) test using kernel estimation of the score function. Diblasi & Bowman (1997) construct a test based on nonparametric smoothing of the residuals on a suitably transformed scale but they have not derived the asymptotic distribution of the test. Instead, they approximate the critical value numerically. The method of Dette & Munk (1998) is based on an estimator for the best L2 approximation of the variance function by a constant. When the regres- sion function is estimated via wavelet thresholding methods and the error variances depend on the observed covariates through a parametric relationship of some known form, a score test is given by Cai, Hurvich & Tsai (1998).

In Section 2, we introduce the statistic for testing (2), present the main asymptotic results under the null hypothesis and local alternatives and discuss generalizations to other settings. Results from simulation studies to investigate the finite sample behaviour of the test statistic are reported in Section 3. In Section 4, we illustrate our method with a set of real data from a study of health care costs. Technical details are given in the Appendix.

2. TEST STATISTIC

2.1. Notation. Let ~ ( x ) denote a Lipschitz continuous positive density function defined on [0,1]. Assume that the design points x1, . . . , x, satisfy a standard assumption for the fixed-design nonparametric regression model

(3)

Define R: = (Y,+l - Y , ) 2 / 2 , j = 1,. . . , n, where n = m - 1. If 02(x ) and m(x) defined in (1) are Lipschitz continuous, we can easily show E (R;) = 02(s j ) + O(n-'). This provides a simple asymptotically unbiased local estimator for the variance function. The main advantage of this estimator is that it does not require one to estimate the regression function m(x) .

Let b2 be an estimate of the variance under the null hypothesis, which can be taken, for example, as the estimator of Rice (1984), namely

Then Bj = R: - G2 provides an asymptotically centered version of R:.

2.2. Analysis of variance with a large number of factor levels.

To introduce our test statistic, we will briefly review some related results in the analysis of variance (ANOVA) when the number of cells becomes large as the sample size becomes large. We consider a balanced one-way ANOVA of n cells and k, observations K l , . . . , l&, in cell

Page 3: A fully nonparametric diagnostic test for homogeneity of variances

2005 HOMOGENEITY OF VARIANCES 547

i = 1, . . . , n. To test the null hypothesis of no cell effects, the following F-type statistic can be used:

where

M S T F -- I t - M S E '

N = nk , is the total number of observations and

Classical large sample results for the F-test assume that the number of observations per cell goes to infinity but the number of cells is fixed. Recently, a different type of asymptotic frame- work has been studied: the number of cells goes to infinity, the number of observations per cell can either be fixed or goes to infinity at a slower rate; see Akritas & Papadatos (2004), Wang & Akritas (2006) and the references therein. In this new framework, Akritas & Papadatos (2004) shows the asymptotic normality of f i (F , - 1) as n + 00 under the assumption of no cell effects. They assume Kj, i = 1,. . . , n, j = 1,. . . , k,, are independent random variables, but allow them to be nonnormal and have heteroscedastic errors. Since M S E converges to a constant, by Slutsky's theorem, the problem reduces to studying the asymptotic distribution of

2.3. An artificial analysis of van'ance.

For the nonparametric regression model (l), we describe here how a hypothetical one-way layout is formed from (zj, Bj) , j = 1, . . . , n. In Section 2.4 below, we state a test statistic computed from this artificial ANOVA.

In the artificial ANOVA, a cell is constructed using the nearest neighbour method. More specifically, a symmetrized window Wi is created around each covariate value zi, i = 1,. . . , n, by including the k, nearest covariate values. In what follows, the windows Wi will also be understood as sets containing the indices j of the covariate values that belong to the window, i.e.

JSE(MST - M S E ) .

where pz(t) = n-l'& I(si 5 t), and I ( A ) is an indicator function for event A. Using these nearest neighbour windows, we construct an artificial balanced one-way ANOVA

with n categories. The responses in the ith category are those Bi-values associated with the covariate values in Wi. To separate the hypothetical observations from the original observations, let Ke, l = 1,. . . , k,, denote the kn responses in the ith category of the above hypothetical ANOVA, and let

( 5 )

be the vector of the N x 1 vector of observations in the hypothetical one-way layout. We also use (5 ) to denote the operator which creates the above vector by augmenting Bj, j = 1,. . . , n, according to the covariate x = ( 2 1 , . . . , Zn)T.

2.4. The rest statistic.

The new test we propose is based on the simple idea that under the assumption of homoscedas- ticity, Bj should fluctuate around zero. A test statistic for testing the approximate constancy of

V =V(X,(Bj,j = 1,. . ,n) T ) = (V11,. . . ,V1kn,- - . ,Vnl, ,V&,)T

Page 4: A fully nonparametric diagnostic test for homogeneity of variances

548 WANG 8 ZHOU Vol. 33, No. 4

Bj can be naturally constructed by applying the test statistic of Section 2.2 to the hypothetical one-way layout formed in Section 2.3. Although the Bj are not independent, we expect that the dependence is asymptotically negligible.

Consider the following test statistic

T = T ( X , (Bj,j = 1,. . . , n)T) MST - M S E (6)

where MST and M S E are defined in (4) and are calculated from the hypothetical ANOVA. The statistic T ( X , (B j , j = 1,. . . , n)T) can be written as a quadratic form VTAV, where

In the above expression, Ik, is the k,-dimensional identity matrix, J k , = lk, lL,, where lk, is the kn-dimensional column vector of ones, and @ is the notation for Kronecker (direct) sum.

The test statistic (6) is related to the one used by Wang, Akritas & Van Keilegom (2002) for testing whether the regression function in (1) is constant. Wang, Akritas and Van Keilegom as- sume independent data. Here the sequence Rj, j = 1,. . . , n, is two-dependent. The asymptotic variance of T is rather complicated. We consider the modified test statistic T*,

T* = T*(X , (B j , j = 1 ,..., n)T)

m n n-1

The term subtracted from T is an estimate of the mean value of T under ( 2 ) . Therefore T* is a centered version of T . In the next section, we will present large sample properties of T*(X , (Bj, j = 1,. . . , n)T) under both the null and local alternative hypotheses.

3. LARGE SAMPLE RESULTS Assume that the design points ~ 1 , . . . ,z, satisfy (3). Let E ( E ! ) = pk(zi). k = 3, 4, 5, 6, be the higher moments of E ~ . For some positive constant L and for all 1 5 i, j I n, we have

Ig(Q) - g(Zj)l I LIZ2 - q l , 12(Zz) - 2 ( Z j ) ( I LIZ2 - Zjl,

IPk(Z2) - P k ( Z j ) l I LIZ2 - Z j l , k = 3,475.

We start with some results on asymptotic equivalence under the null hypothesis ( 2 ) . Lemma 1 below shows that the test statistic T* calculated from the hypothetical one-way ANOVA aug- mented from (Bj , j = 1, . . . , n)T is asymptotically equivalent to the one calculated from the hypothetical one-way ANOVA augmented from (Z j , j = 1,. . . , n)T, where

zj = 0 2 1 {&+I - E j ) 2 - 1).

d We let -% denote convergence in probability, and - denote convergence in distribution.

LEMMA 1. Under the above assumptions, $kn + co and knn-’ + 0, then under 3-10,

Page 5: A fully nonparametric diagnostic test for homogeneity of variances

2005 HOMOGENEITY OF VARIANCES 549

Lemma 2 below suggests that the above test statistic has the same asymptotic distribution when A in (7) is replaced by the simpler block diagonal matrix AD below.

LEMMA 2. Denote the N x 1 vector V* = V(X, (Zj, j = 1,. . . , n)T), where V is the operator defined in ( 5 ) and assume the conditions of Lemma I hold. Then under ?lo,

{T*(X, ( Z j , j = 1 , . . . , n)T) - T**(X, ( Z j , j = 1,. . * , 4')) -% 0, (n) lJ2

1 where with the block diagonal matrix AD = diag (B1,. . . , Bn), Bi = (Jk, - Ikn) ,

n(kn - 1)

As a direct result of Lemma 1 and Lemma 2, to derive the asymptotic distribution of T*, we may work directly with T**(X, (Z j , j = 1,. . . , n)'). Direct calculation yields

n n

The next theorem presents the asymptotic distribution of T* under the null hypothesis.

THEOREM 1. Assume the conditions of Lemma I . Then under ?lo,

T*(X, (Bj,j = 1,. . . n)') 5 N ( O , T ~ ) , (

Remark 1. The term J p i (a : )~(z ) da: in the expression of T~ can be consistently estimated by

m - 3 1 I(% - Y 3 - 1 ) ~ ( % + 2 - %+I)* - 6 m 4 - 9,

j = 2 4(m - 3 ) ( 6 2 ) 4

where m

Remark 2. The asymptotic normality of T* still holds if the nearest-neighbourhood window size kn is taken to be fixed: kn = k. In this case, T~ has a more complex expression,

T 2 = a1(k)08 Jp:( . )r(s)dr + a2(k)08 p*(Z)T(a:)da: I where

Page 6: A fully nonparametric diagnostic test for homogeneity of variances

550 WANG & ZHOU Vol. 33, No. 4

Remark 3. It can be shown that the above asymptotic results still hold in a random design set- ting where the covariates xi, i = 1,. . . , n, should be understood as a random sample from a distribution with a positive density function r(x).

We next examine the power of our test against local alternatives of the form

2 ( z ) = c2 + (nkn)-”4h(z), (8)

where h(z) is a Lipschitz continuous nonconstant function. The asymptotic distribution is given in the following theorem.

THEOREM 2. Assume the conditions of Lemma 1 under the local alternative sequence (8), if n-3k: = o(l), then

T*(X, ( B j , j = 1,. . . (E) 1/2

where r2 is de$ned in Theorem 1 and

1 Y2 =h h2(t)r(t) d t - (1’ h( t ) r ( t )d t ) z

Remark 4. By appropriately choosing the rate k,, the test can detect local alternatives converging to a null at a rate arbitrarily close to the parametric rate n-*l2.

4. MONTE CARL0 SIMULATIONS In this section, we investigate the finite sample behaviour of the proposed test. The conver- gence of the test statistic to a normal distribution is often quite slow (see, for example, H;irdle & Mammen 1993). For finite sample sizes, the critical value of our test statistic is obtained using the bootstrap. More specifically, let E i = Y, - g(zi), where g represents some estimate of the regression function, for example, by using least squares method or nonparametric smoothing. Let E:, i = 1,. . . , m, be a bootstrap sample from centered residuals &, i = 1,. . . , m, and let r,. = g(xi) + E:. For each bootstrap sample (xi, Y), i = 1,. . . , m, calculate the test sta- tistic T*. The critical value is then determined from the appropriate quantile of the bootstrap distribution of the test statistic T*. In the Monte Car10 study, we generate 500 simulated data sets for each scenario. For each data set, 500 bootstrap samples are drawn. Different values of the sample size n, different forms of variance function and different distributions of the error term ~i are allowed.

For the purpose of comparison, we include results from applying the parametric test of Cook & Weisberg (1983, abbreviated as CW test), which is a very powerful test when all the parametric assumptions required are satisfied. Their test requires correct specification of the variance function. Here, we adopt the assumption that c2(z) = cz exp(Xz), where 00” and X are unknown parameters. Thus X = 0 corresponds to the null hypothesis.

In order to make fair comparisons, we take the regression function g(z) = 1 + z to be linear in our simulations. The design points are taken to be uniform on the interval [0,1]: zi = 0 : l / (m - 1) : 1. The random data are generated by the software package MatLab 6.1. We also include results from applying the nonparametric test of Dette & Munk (1998, abbreviated as DM test), which is based on an estimator for the best L2-approximation of the variance function by a constant.

First, we investigate the level of the tests. Sample sizes 50 and 70 are considered. We are particularly interested in the situation when the ~i are not normally distributed, which is assumed for the CW test (although it is possible to modify their test for other types of error distributions).

Page 7: A fully nonparametric diagnostic test for homogeneity of variances

2005 HOMOGENEITY OF VARIANCES 55 1

Three different distributions for &i are considered: N(0, l), t(8) and t(4), where N(p, u2) repre- sents a normal distribution with mean 0 and variance u2, t (b ) represents a Student distribution with b degrees of freedom; the smaller the b, the heavier the tail of the distribution. The results are summarized in Table 1. In Table 1 and Table 2, our nonparametric test is calculated for several window sizes (kn). The test is abbreviated as NP(k,) test.

TABLE 1 : Empirical level of the tests when m(x) = 1 + x.

0.040 0.046 0.046 0.054 0.040 0.066

0.042 0.046 0.048 0.046 0.044 0.044 0.058

0.056 0.066 0.064 0.072 0.098 0.076

0.038 0.044 0.050 0.054 0.050 0.118 0.070

0.050 0.044 0.036 0.044 0.184 0.054

0.066 0.076 0.066 0.060 0.048 0.196 0.052

Observe from Table 1 that the NP test maintains the specified nominal level very well, as does the DM test. The NP test is not very sensitive to the window size. The CW test, while behaving well when the distribution of &(xi) is normal or only slightly heavy tailed, could become very liberal when the tail is heavy, for example, if the true distribution of &(xi) is t (4 ) .

TABLE 2: Empirical power of the tests.

n test alternative 1 alternative 2 alternative 3

NP(3) 0.444 0.382 0.496 NP(5) 0.516 0.474 0.530 NP(7) 0.596 0.536 0.530

50 NP(9) 0.628 0.590 q.490 cw 1 .om 0.160 0.450 DM 0.414 0.348 0.366

NP(7) 0.668 0.642 0.692 NP(9) 0.726 0.726 0.698 NP(11) 0.752 0.770 0.672

70 NP(13) 0.786 0.808 0.660 cw 1 .Ooo 0.178 0.416 DM 0.454 0.418 0.466

Page 8: A fully nonparametric diagnostic test for homogeneity of variances

552 WANG & ZHOU Vol. 33, No. 4

To investigate the power of the tests, we consider the following three alternatives:

alternative 1: Y = 1 + z + 0.5exp(2z)&; alternative 2: Y = 1 + z + 0.5{1 + sin(l0z)E); alternative 3: Y = 1 + z + D ~ ( Z ) E ,

where E has the standard normal distribution, 03(z) = 0.5 if z < 0.5, ~ ( 5 ) = 0 . 5 ( ~ - 0 . 5 ) ~ oth- erwise. Table 2 summarizes the results. It is observed that if all the assumptions of the parametric test are satisfied (linear relationship in the mean function, normal error and correct specification of the form of the variance function), then the CW test is the most powerful. This is the price the nonparametric test has to pay in order to be omnibus. However, when the assumptions of parametric test are violated, the nonparametric tests can be more powerful. This small-scale simulation study is certainly not exhaustive. It would be of interest to cany out more extensive simulations in the future.

From the power study, we observe that the influence of the local window size k, is small when the sample size is moderately large: n = 70. When n is relatively small (n = 50), the finite sample power is more sensitive to k,. Choosing a bandwidth to maximize the power of smoothing-based tests is an ongoing area of research. In general, this optimal bandwidth is differ- ent from the optimal one to estimate the nonparametric curve. Some discussions of this problem are given in Hart (1997,s 6.4). King, Hart & Wehrly (1991) and Young & Bowman (1995) sug- gest that the P-value be calculated for several different choices of the smoothing parameter, and they call the plot of P-values versus the smoothing parameters a “significant trace.” The modest goal of the present paper is to provide a simple nonparametric diagnostic test that can be used to help determine if more sophisticated procedures, such as estimating the variance function, are needed.

5. DATA EXAMPLE We illustrate the application of our bootstrap test on a clinical trial data set to investigate the effects of a drug utilization review on health care costs (Tierney et al., 1998). The drug utiliza- tion review involves comparing drug prescribing with accepted standards to identify potential problems. The response variable is the total health care cost of a patient. Health care costs are highly skewed due to high utilization by a few patients. To “normalize” the data, costs are often log-transformed prior to analysis (Manning 1998; Zhou, Stroupe & Tierney 2001). However, a complication is that the transformation may normalize the skewed data but may not stabilize the variance (Manning 1998). Hence, log-transformed data may also have a heteroscedastic variance.

From our preliminary analysis, we suspected that the heteroscedasticity may depend on the satisfaction level of a patient with hisher pharmacist. A scatter plot of log-transformed health cost versus patient satisfaction level is given in Figure 1. We apply our bootstrap test to this data set, which consists of 160 data points. The response variable is log transformed and the covariate is transformed to the interval [0,1]. The residuals are obtained using kernel smoothing with Epanechnikov kernel K ( z ) = (4/3)(1- z2)1(1z1 5 1) and bandwidth h. The results of our test for different combinations of bandwidth h and window size Ic, are summarized in Table 3, which indicates the possible presence of heteroscedasticity. In contrast, the CW test gives a P-value of 0.356.

6. CONCLUSION We have proposed a fully nonparametric diagnostic test for testing the null hypothesis of ho- moscedasticity or constant variance. The test is motivated by recent developments in the analysis of variance with large numbers of factor levels. The test is asymptotically normal under the null hypothesis. It can detect local alternative converging to the null at a rate arbitrarily close to the parametric rate n-1/2. The simulation results demonstrate that by using a critical value obtained from the bootstrap, the proposed test has a satisfactory finite sample performance.

Page 9: A fully nonparametric diagnostic test for homogeneity of variances

2005 HOMOGENEITY OF VARIANCES 553

11

10

9Q

8 - 8 5 3 7 -

-0 6 -

9) L: 0 Y

5 -

12 I I I I I I i i i i 1

-

-

0

0

€3

0

0 0 0

0

0 0 0 0 8

0 0 0 0 0

OO 0 0 0 0

OO 0 8

0 0

0 0 0 0

0 0

8

0 s : 0 0 0

0 0

0

8 Q 0 0 0

0 z o o 0 0

0 0

0 0

0 0 0

0 0 0

0

0

0

0 0 0

0

Q 0 0

; c ? 8 0 0

0 O O

0 0

0 0 0 0

3 .I 0 0

-0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 satisfication level of the patient

FIGURE 1 : Scatter plot of the health care cost data.

TABLE 3: Empirical power of the tests.

k n = 3 k n = 5 k n = 7

h = 0.1 0.034 0.082 0.186 h = 0.2 0.036 0.076 0.202 h = 0.3 0.018 0.084 0.188 h = 0.4 0.028 0.122 0.216

APPENDIX: DERIVATIONS

We give here an outline of the proofs. More details are given in a technical report available from the authors.

Proof of Lemma 1. The proof is done by combining the following two steps:

1/2 (k) { T ( X , ( B j , j = 1,. . . ,n)T) - T(X, ( Z j , j = 1,. . . , n)T)}

1/2 n n-1 (e) n(kn - 1) i=l j=l

0, (9)

(10) y p j B , + l - ZjZj+l)I(j,j + 1 E WZ) 2J+ 0.

We will first prove (10). Notice that

= zj + i{S(Zj+l) - 9(.j)}2 + .M.j+l) - S(Zj)}(&j+l - E j ) + (c2 - c?."),

Page 10: A fully nonparametric diagnostic test for homogeneity of variances

554 WANG & ZHOU Vol. 33, No. 4

so that we can write the product B,Bj+l as the sum of sixteen terms, one of which is ZjZj+,. Therefore, the left-hand side of (10) can be decomposed into fifteen terms:

where

and D,, i = 3 , . . . ,15, are defined similarly. One can easily check that each D,, i = 1 , . . . ,15, is op(l) by making use of the fact that g(z,+l) - g(2,) = O,(n-') uniformly in j ; for those terms involving random variables 2, and E,, we can easily check the mean and variance.

Now we check (9). Define <, = g(z ,+l) - g(z,) and let t = V(X, (<,",j = 1 , . . . , r ~ ) ~ ) , q = V(X, (<,(&,+I - ~ , ) , j = 1 , . . . , n)T), where V is the operator defined in (5) and V* is defined as before. Then

T(X, ( ~ j , j = 1 , . . . , n ) T ) - T(X, ( ~ j , j = 1 , . . . , nlT) = ;tTA< + a2vTAq + (a2 - c ? ' ) ~ ~ & A ~ N + V*TA< + Z C T V * ~ A ~

+ 2(a2 - ~ ' ) v * ~ A I N + a t T ~ v + (a2 - b 2 ) t T ~ l N + 2a(a2 - 6 2 ) q T ~ i N .

We can show that each of the above terms is o,(n-1/2kk/2) as in the proof of Theorem 2.3 of Wang, Akritas & Van Keilegom (2002).

Proof of Lemma 2. We have

n - E (T* - T**)2 kn

= - n E { v * ~ ( A - A ~ ) v * ) ~ kn

In the above sum, the nonzero expectation terms are of the following possible forms: E (Z;l Z;J (of order O(n2k t ) ) , E (z,") (of order O ( n k t ) ) , E (Z j12 ,1+~ZjzZjz+l) (of order O(n2k t ) ) , E (Z;l Z,22,2+i) (of order O(n2k t ) ) , etc. Thus

n n 1 - E (T* - T**)2 = - kn kn n2(n - 1)2k; O ( n 2 k f ) = O(knn-l) = o(1).

Proof of Theorem I . From Lemma 1 and Lemma 2, we only need to show

,1/2k-1/2T** n 5 N(0, T ~ ) .

where

Page 11: A fully nonparametric diagnostic test for homogeneity of variances

2005 HOMOGENEITY OF VARIANCES 555

It is evident that E(T**) = 0 and

where Q1 represents the sum of terms when the subscripts j1,j2, C1, C2 form two pairs, i.e., jl = C1, j 2 = C2; 9 2 is the sum of terms when there in one and only one pair among the subscripts j1, j 2 , CI, C2, i.e., j1 = C1, j 2 # C2 orjl # C1, j 2 = C2; Q3 is the sum of terms when there in no pair among the subscripts j1, j 2 , CI, (2. Now

n 0 8

nk, (k, - 1)2 - - C{P4(Zj) + 1}2{12 + * - * + (k, - 2)2} + O(n-'k,)

1=1

where the second equality makes use of Lemma A.l of Wang, Akritas & Van Keilegom (2002) and the last equality uses (3). Similar calculations yield

+ 2k,(k, - - 2)2 1 ) 2 / { P : ( z ) - 2P4(2) + 41135) + 1}T(5) dz + O(n-lk,).

Combining the above, we have

as k, --$ 00. Now n

i=l

where

The asymptotic normality of (nk,)-ll2Sn can then be proved following the same lines as in the proof of Theorem 2.2 of Wang, Akritas & Van Keilegom (ZOOZ), using Markov's blocking technique (see proof of Theorem 27.4 in Billingsley 1995).

Page 12: A fully nonparametric diagnostic test for homogeneity of variances

556 WANG & ZHOU Vol. 33, No. 4

Proof of Theorem 2. Recall that B, = R; - r32. Under the local alternative (8), we have

E ( R j ) = g2 + ( d ~ ~ ) - ' / ~ h ( z ~ ) + O(n-')

and E (b2) = g2 + ( ~ ~ k , ) - l / ~ h (z )r (z ) dz + O(n-l) . J

{ Denote

B; = B, - (nkn)-1/4 h(z3 ) - J h(z)r (z ) d z } .

As before, we let l/z,, i = 1,. . . , n, j = 1,. . , , k,, be the observations in the hypothetical one-way ANOVA constructed from B,. Further, let U2,, i = 1,. . . , n, j = 1,. . . , k,, denote the observations in the hypothetical one-way ANOVA constructed from B;. Let V, U denote the N x 1 vector of observations in the two hypothetical one-way ANOVAs, respectively. Then U = V - (nkn)-'I4S, where S is the N x 1 vector (S,,j E Wl,. . . , S,,j E with S, = h(z,) - h(z)r (z ) dx. The test statistic is calculated from V and will be called T,*,, here. We have

+ ~ ( ~ / c , ) - ' / ~ S ~ A U + (nkn)-'12STAS

Notice that

Following the same lines as the proof of Theorem 1, we can show that

As in the proof of Theorem 2.3 of Wang, Akritas & Van Keilegom (2002) and making use of expression (12), we can show that

STAU = Op(knn-1/2) + Op(n-'k;), STAS = kny2 + Op(knn-') + Op(n-'k;),

where 1 2 Y 2 = 1 h2(t)r(t) dt - { 1' h(t)r(t) d t }

By checking the mean and variance, we can show that the last two terms of (11) are both ~ ~ ( n - ' / ~ kk'2).

Page 13: A fully nonparametric diagnostic test for homogeneity of variances

2005 HOMOGENEITY OF VARIANCES 557

ACKNOWLEDGEMENTS This research was funded in part by a grant from the Agency for Healthcare Research and Quality. The data example was kindly provided by Dr William Tierney from a study funded by the Agency for Health Care Policy and Research. The authors are grateful for insightful comments from the Editor, the Associate Editor and an anonymous referee.

REFERENCES M. G. Akritas & N. Papadatos (2004). Heteroscedastic one-way ANOVA and lack-of-fit test. Journal of the

P. J. Bickel (1978). Using residuals robustly I: Tests for heteroscedasticity, nonlinearity. The Annals of

P. Billingsley (1995). Probability andhiemure. Third edition. Wiley, New York. Z. W. Cai, C. M. Hurvich & C. L. Tsai (1998). Score tests for heteroscedasticity in wavelet regression.

R. J. Carroll & D. Ruppert (1988). Transformation and Weighting in Regression. Chapman & Hall, New

R. D. Cook & S. Weisberg (1983). Diagnostics for heteroscedasticity in regression. Biometrika, 70, 1-10. R. D. Cook & S. Weisberg (1982). Residuals and lnjluence in Regression. Chapman & Hall, New York. M. Davidian & R. J. Carroll (1987). Variance function estimation. Journal of the American Statistical

Association, 82, 1079-1091. H. Dette & A. Munk (1998). Testing heteroscedasticity in nonparametric regression. Journal of the Royal

Statistical Society Series B, 60,693-708. A. Diblasi & A. W. Bowman (1997). Testing for a constant variance in a linear model. Statistics & Proba-

bility Letters, 33, 95-103. R. L. Eubank & W. Thomas (1993). Detecting heteroscedasticity in nonparametric regression. Journal of

the Royal Statistical Society Series B,55, 145-155. W. H. Greens (2000). Econometric Analysis, 4th Edition. Prentice Hall, Upper Saddle River, New Jersey. W. Htirdle & E. Mammen (1993). Comparing nonparametric versus parametric regression fits. The Annals

J. D. Hart (1997). Nonparametric Regression and Lack-ofifit Tests. Springer, New York. E. King, J. D. Hart & T. E. Wehrly (1991). Testing the equality of two regression curves using linear

M. L. Maciejewski, X. H. Zhou, J. C. Fortney & J. F. Burgess (2004). Alternative Methods for Modelling

W. G. Manning (1998). The logged dependent variable, heteroscedasticity, and the retransformation prob-

H. G. Muller & P. L. Zhao (1995). On a semiparametric variance model and a test for heteroscedasticity.

J. Rice (1984). Bandwidth choice for nonparametric regression. The Annals of Statistics, 12, 1215-1230. D. Ruppert M. P. Wand & R. J. Carroll (2003). Semiparametric Regression. Cambridge University Press. W. M. Tierney, M. Overhage, M. Murray, X. H. Zhou, L. Harris & F. Wolinsky (1998). The final report of

the computer-based prospective drug utilization review project (1993-1997). U. S. Agency for Health Care Policy and Research. Bethesda, MD.

L. Wang & M. G. Akritas (2006). -0-way heteroscedastic ANOVA with large number of levels. To appear in Statistica Sinica.

L. Wang, M. G. Akritas & I. Van Keilegom (2002). Nonparametric Goodness-of@ Test for Hetemscedastic Regression Models. Mimeo.

S . G. Young & A. W. Bowman (1 995). Non-parametric analysis of covariance. Biometrics, 5 1,920-93 1. J. X. Zheng (1996). A Consistent Nonparametric Test of Hetemscedasticity. Mimeo.

American Statistical Association, 99,368-382.

Statistics, 6,266291.

Biometrika, 85,229-234.

York.

of Statistics, 21, 1926-1947.

smoothers. Statistics & Probability Letters, 12,239-247.

Hetemscedastic Non-Normally Distributed Costs. Mimeo.

lem. Journal of Health Economics, 17,283-295.

The Annals of Statistics, 23,946967.

Page 14: A fully nonparametric diagnostic test for homogeneity of variances

558 WANG & ZHOU Vol. 33, No. 4

X. H. Zhou, K. T. Stroupe & W. H. Tierney (2001). Regression analysis of health care charges with het- eroscedasticity. Journal of the Royal Statistical Society Series C, 50, 303-3 12.

Received 27 February 2004 Accepted 7 February 2005

Lan WANG: [email protected]

School of Statistics, University of Minnesota Minneapolis, MN 55455, USA

Xiao-Hua ZHOU: azhou@ u.washington.edu Department of Biostatistics, School of Public Health & Corn Med,

University of Washington Seattle, WA 98198, USA