How can White’s Test be performed in SAS? 2

How can White’s Test be performed in SAS?

White’s Test is a statistical method used to assess the presence of heteroscedasticity, or unequal variance, in a regression model. This test can be performed in SAS (Statistical Analysis System) by using the built-in “proc model” procedure. First, the data must be loaded into SAS and the regression model must be specified. Then, the “proc model” procedure can be used to run White’s Test by including the “white” option in the model statement. This will generate a test statistic and p-value, which can be used to determine the presence of heteroscedasticity. Additionally, SAS provides options to adjust for potential autocorrelation and to perform post-estimation diagnostics. The results of White’s Test in SAS can be used to evaluate the assumptions of the regression model and make necessary adjustments to improve the accuracy of the analysis.

Perform White’s Test in SAS


White’s test is used to determine if is present in a regression model.

Heteroscedasticity refers to the unequal scatter of at different levels of a in a regression model, which violates one of the key that the residuals are equally scattered at each level of the response variable.

This tutorial explains how to perform White’s test in SAS to determine whether or not heteroscedasticity is a problem in a given regression model.

Example: White’s Test in SAS

Suppose we want to fit a multiple linear regression model that uses number of hours spent studying and number of prep exams taken to predict the final exam score of students:

Exam Score = β0 + β1(hours) +β2(prep exams)

First, we’ll use the following code to create a dataset that contains this information for 20 students:

/*create dataset*/
data exam_data;
    input hours prep_exams score;
    datalines;
1 1 76
2 3 78
2 3 85
4 5 88
2 2 72
1 2 69
5 1 94
4 1 94
2 0 88
4 3 92
4 4 90
3 3 75
6 2 90
5 4 90
3 4 82
4 4 85
6 5 90
2 1 83
1 0 62
2 1 76
;
run;

/*view dataset*/proc printdata=exam_data;

Next, we’ll use proc reg to fit this multiple linear regression model along with the spec option to perform White’s test test for heteroscedasticity:

/*fit regression model and perform White's test*/
proc reg data=exam_data;
    model score = hours prep_exams / spec;
run;
quit;

White's test in SAS

The last table in the output shows the results of White’s test.

From this table we can see that the Chi-Square test statistic is 3.54 and the corresponding p-value is 0.6175.

White’s test uses the following null and alternative hypotheses:

  • Null (H0): Heteroscedasticity is not present.
  • Alternative (HA): Heteroscedasticity is present.

Since the p-value is not less than 0.05, we fail to reject the null hypothesis.

Thus, it’s safe to interpret the standard errors of the coefficient estimates in the regression summary table.

What To Do Next

If you fail to reject the null hypothesis of White’s test, then heteroscedasticity is not present and you can proceed to interpret the output of the original regression.

However, if you reject the null hypothesis, this means heteroscedasticity is present in the data. In this case, the standard errors that are shown in the output table of the regression may be unreliable.

There are a couple common ways that you can fix this issue, including:

1. Transform the response variable. You can try performing a transformation on the response variable.

For example, you could use the log of the response variable instead of the original response variable.

Typically taking the log of the response variable is an effective way of making heteroscedasticity go away.

Another common transformation is to use the square root of the response variable.

2. Use weighted regression. This type of regression assigns a weight to each data point based on the variance of its fitted value.

This gives small weights to data points that have higher variances, which shrinks their squared residuals.

When the proper weights are used, this can eliminate the problem of heteroscedasticity.

Cite this article

stats writer (2024). How can White’s Test be performed in SAS?. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-can-whites-test-be-performed-in-sas/

stats writer. "How can White’s Test be performed in SAS?." PSYCHOLOGICAL SCALES, 23 Jun. 2024, https://scales.arabpsychology.com/stats/how-can-whites-test-be-performed-in-sas/.

stats writer. "How can White’s Test be performed in SAS?." PSYCHOLOGICAL SCALES, 2024. https://scales.arabpsychology.com/stats/how-can-whites-test-be-performed-in-sas/.

stats writer (2024) 'How can White’s Test be performed in SAS?', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-can-whites-test-be-performed-in-sas/.

[1] stats writer, "How can White’s Test be performed in SAS?," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, June, 2024.

stats writer. How can White’s Test be performed in SAS?. PSYCHOLOGICAL SCALES. 2024;vol(issue):pages.

Download Post (.PDF)
Slide Up
x
PDF
Scroll to Top