There are several statistical tests or formal tests that can be used to test the equality of variance usually called by homoscedasticity such as Spearman test, Levene test, Park test, Glejser test, White test, and F test. In this writing session will only be explained about Spearman test. Other homoscedasticity tests will be explained in other writing sessions.
Homoscedasticity is one of the assumptions that has to be fulfilled in making linear regression model that is error of model have constant variances. In subjective way, residuals plot to the explanatory variables or to the estimated variable can be made to see whether the variance of error is constant. When the plot of residuals give the picture that variance of resiual is not constant, increasing or decreasing, then formal test can be done. If in fact that variance of error is not constant then it is better to modify model by using weighted least squares (WLS) method to get the estimators rather than using the ordinary least squares (OLS) method. Transformation of variables can also be used to stabilize variances.
The hypotheses in Spearman test are
H0 : Homoscedasticity VS H1 : Heteroscedasticity
Procedure in the use of the Spearman test for homoscedasticity testing:
- Fit the regression to the data on X and Y variables, then obtain the residuals ei.
- Use the absolute values of ei. Enter the ranking for the absolute values of ei and the ranking for the Xi variable, then compute the Spearman correlation coeficient. If the regression model involves more than one X variable, rs can be computed between ei and each of X variables separately
Ranking can be made starting from the smallest score or the largest score. When the tied scores occur, each of them is assigned the average of the ranks. If the proportion of tied observations is not large, their effect on rs is negligible, and the above formula may still be used for computation. However, if the proportion of ties is large, then a correction factor must be incorporated into the computation of rs and the formula becomes
3. For samples are greater than 8 (n > 8), the significance of rs can be tested by using t test with formula as follow
Example: Table 1 below consist of monthly production in kgs and working hours data for ten months
Decision: Ho is accepted because t < t(0,025 ; 8) .
Interpretation: data error have constant variance (homoscedasticity) with the 95% level of confidence.
Any questions, send to the e-mail address: firstname.lastname@example.org
*) Writer is a lecturer in The Institute of Statistics,Jakarta,Indonesia.
Bachelor of Statistics from TheInstituteofStatistics,Jakarta,Indonesia.
Master of Science in Experimental Statistics fromNMSU,USA.