# The Effect of Autocorrelation on Regression Results and How to Test It in SPSS 20

## How to Test Autocorrelation in SPSS 20

Autocorrelation is a common problem in regression analysis that can affect the validity and reliability of your results. In this article, you will learn what autocorrelation is, why it is important, how to test it in SPSS 20, and how to deal with it if you find it in your data.

## uji autokorelasi spss 20 crack

## What is Autocorrelation and Why is it Important?

Autocorrelation, also known as serial correlation, is a statistical phenomenon that occurs when the errors or residuals of a regression model are correlated with each other. This means that the value of an error term in one period depends on the value of the error term in the previous period or periods.

### Definition of Autocorrelation

Mathematically, autocorrelation can be defined as follows:

rt = cov(et, et-1) / var(et)

where rt is the autocorrelation coefficient at lag t, cov(et, et-1) is the covariance between the error terms at time t and t-1, and var(et) is the variance of the error term at time t.

The autocorrelation coefficient ranges from -1 to 1. A value of 0 indicates no autocorrelation, a value close to 1 indicates positive autocorrelation (the errors are positively related), and a value close to -1 indicates negative autocorrelation (the errors are negatively related).

### Causes and Consequences of Autocorrelation

There are many possible causes of autocorrelation, such as:

Omitted variables that are correlated with time or with the dependent variable.

Mis-specified functional form of the regression model.

Measurement errors or data manipulation.

Inertia or persistence in the behavior of the dependent variable or the independent variables.

Seasonality or cyclical patterns in the data.

Autocorrelation can have serious consequences for your regression analysis, such as:

Biasing the standard errors of the regression coefficients, making them smaller than they should be.

Inflating the R-squared and F-statistic, making them larger than they should be.

Affecting the validity of hypothesis testing and confidence intervals.

Reducing the efficiency and accuracy of the parameter estimates.

### How to Detect Autocorrelation

There are several ways to detect autocorrelation in your data, such as:

Plotting the residuals against time or against the predicted values and looking for patterns or trends.

Calculating and examining the autocorrelation coefficients for different lags using a correlogram or an autocorrelation function (ACF).

Performing formal statistical tests for autocorrelation, such as the Durbin-Watson test or the Breusch-Godfrey test.

## How to Perform Autocorrelation Test in SPSS 20

In this section, we will show you how to perform an autocorrelation test in SPSS 20 using a simple linear regression model. The steps are as follows:

### Step 1: Prepare the Data

The first step is to prepare your data for analysis. You need to have a dependent variable (Y) and one or more independent variables (X) that are measured over time. For example, you can use the following data set that shows the annual sales (in millions of dollars) and advertising expenditure (in thousands of dollars) of a company from 2010 to 2019.

YearSalesAdvertising

20105010

20115512

20126015

20136518

20147020

20157522

20168025

20178528

20189030

20199532

You can enter this data into SPSS by clicking on Data > New Dataset. Then, enter the variable names and values in the columns. Make sure that your data is sorted by time (in ascending order).

### Step 2: Run the Regression Analysis

The next step is to run a simple linear regression analysis using SPSS. You can do this by clicking on Analyze > Regression > Linear. Then, select Sales as the dependent variable and Advertising as the independent variable. Click on OK to run the analysis.

You will get an output window that shows various tables and statistics related to your regression model. You can ignore most of them for now, except for two tables: Model Summary and ANOVA. The Model Summary table shows you the R-squared and adjusted R-squared values for your model. The ANOVA table shows you the F-statistic and its significance level for testing whether your model is better than a constant-only model.

In our example, we get an R-squared value of 0.991 and an adjusted R-squared value of 0.989. This means that our model explains about 99% of the variation in sales. We also get an F-statistic value of 1018.6 with a significance level of less than 0.001. This means that our model is highly significant and better than a constant-only model.

### Step 3: Check the Residuals for Autocorrelation

The final step is to check whether there is any evidence of autocorrelation in our residuals. There are three methods that we can use in SPSS: Durbin-Watson test, correlogram, and Breusch-Godfrey test. We will explain each method below.

#### Durbin-Watson Test

The Durbin-Watson test is a simple test that measures the degree of autocorrelation in the residuals by comparing their sum of squares. The test statistic ranges from 0 to 4, where a value close to 2 indicates no autocorrelation, a value close to 0 indicates positive autocorrelation, and a value close to 4 indicates negative autocorrelation.

check the box for Durbin-Watson. Click on OK to run the analysis again.

You will get an output window that shows the Durbin-Watson statistic in the Model Summary table. In our example, we get a value of 0.012. This is very close to 0, indicating a strong positive autocorrelation in our residuals.

#### Correlogram

A correlogram is a graphical display of the autocorrelation coefficients for different lags. It shows how the residuals are correlated with themselves over time. A correlogram can help you identify the pattern and degree of autocorrelation in your data.

To create a correlogram in SPSS, you need to go to Analyze > Forecasting > Create Models. Then, select Sales as the dependent variable and Advertising as the independent variable. Click on Options and check the box for Residuals correlogram. Click on OK to run the analysis.

You will get an output window that shows a graph of the autocorrelation function (ACF) and the partial autocorrelation function (PACF) for your residuals. The ACF shows the correlation between the residuals at time t and t-k, where k is the lag. The PACF shows the correlation between the residuals at time t and t-k after removing the effect of other lags. The blue bars represent the autocorrelation coefficients and the red dotted lines represent the confidence intervals. If a bar crosses the confidence interval, it means that the autocorrelation coefficient is statistically significant.

In our example, we can see that almost all of the bars in both graphs are above or below the confidence intervals, indicating significant autocorrelation in our residuals.

#### Breusch-Godfrey Test

The Breusch-Godfrey test is a more general and powerful test for autocorrelation that can handle higher-order autocorrelation and multiple independent variables. The test statistic follows a chi-square distribution with degrees of freedom equal to the number of lags tested.

To perform this test in SPSS, you need to go to Analyze > Regression > Linear. Then, click on Save and check the box for Unstandardized residuals. Click on Continue and then on OK to run the analysis again.

This will create a new variable in your data set called RES_1, which contains the unstandardized residuals from your regression model. You can use this variable to perform the Breusch-Godfrey test.

To do this, you need to go to Analyze > Regression > Linear again. Then, select Sales as the dependent variable and Advertising, RES_1, and RES_1 lagged by one period as independent variables. You can create the lagged variable by clicking on Transform > Compute Variable. Then, enter a name for the new variable (e.g., RES_1_LAG) and enter LAG(RES_1) as the numeric expression. Click on OK to create the variable.

After selecting the variables for your regression model, click on Statistics and check the box for R-squared change. Click on OK to run the analysis.

the F-statistic and its significance level for testing whether adding RES_1 and RES_1_LAG improves your model.

In our example, we get an R-squared change value of 0.989 and an F-statistic value of 454.7 with a significance level of less than 0.001. This means that adding RES_1 and RES_1_LAG to our model significantly increases the explanatory power of our model.

To calculate the Breusch-Godfrey test statistic, we need to multiply the R-squared change value by the number of observations in our data set. In our example, we have 10 observations, so we get a test statistic of 0.989 x 10 = 9.89. This follows a chi-square distribution with 2 degrees of freedom (the number of lags tested).

To find the critical value and the p-value for this test statistic, we can use a chi-square table or an online calculator. The critical value for a 5% significance level and 2 degrees of freedom is 5.99. The p-value for our test statistic is 0.007.

Since our test statistic is greater than the critical value and the p-value is less than 0.05, we can reject the null hypothesis that there is no autocorrelation in our residuals. This confirms the results of the Durbin-Watson test and the correlogram.

## How to Interpret and Report the Results of Autocorrelation Test in SPSS 20

In this section, we will show you how to interpret and report the results of each autocorrelation test that we performed in SPSS 20.

### Durbin-Watson Test Results

The Durbin-Watson test statistic is a simple measure of autocorrelation in the residuals. A value close to 2 indicates no autocorrelation, a value close to 0 indicates positive autocorrelation, and a value close to 4 indicates negative autocorrelation.

In our example, we obtained a Durbin-Watson test statistic of 0.012, which is very close to 0. This indicates a strong positive autocorrelation in our residuals.

We can report this result as follows:

The Durbin-Watson test statistic was 0.012, indicating a strong positive autocorrelation in the residuals.

### Correlogram Results

A correlogram is a graphical display of the autocorrelation coefficients for different lags. It shows how the residuals are correlated with themselves over time. A correlogram can help you identify the pattern and degree of autocorrelation in your data.

In our example, we obtained a correlogram that showed significant autocorrelation coefficients for almost all lags in both the ACF and PACF graphs. This indicates a high degree of autocorrelation in our residuals.

We can report this result as follows:

The correlogram showed significant autocorrelation coefficients for almost all lags in both the ACF and PACF graphs, indicating a high degree of autocorrelation in the residuals.

### Breusch-Godfrey Test Results

The Breusch-Godfrey test is a more general and powerful test for autocorrelation that can handle higher-order autocorrelation and multiple independent variables. The test statistic follows a chi-square distribution with degrees of freedom equal to the number of lags tested.

In our example, we obtained a Breusch-Godfrey test statistic of 9.89 with 2 degrees of freedom. The critical value for a 5% significance level was 5.99 and the p-value was 0.007. This means that we can reject the null hypothesis that there is no autocorrelation in our residuals.

We can report this result as follows:

The Breusch-Godfrey test statistic was 9.89 with 2 degrees of freedom (p = 0.007), indicating significant autocorrelation in the residuals.

## How to Deal with Autocorrelation in SPSS 20

Autocorrelation is a serious problem that can affect the validity and reliability of your regression results. Therefore, you need to find ways to deal with it if you detect it in your data. There are several common remedies for autocorrelation, such as:

### Transforming the Data

One way to deal with autocorrelation is to transform your data using methods such as differencing, logging, or deflating. These methods can help reduce or eliminate the trend or seasonality in your data that may cause autocorrelation.

To transform your data in SPSS, you can use the Transform > Compute Variable option or the Transform > Date and Time Wizard option depending on your data type and transformation method.

### Adding or Removing Variables

the autocorrelation in your data. For example, you may need to include a lagged dependent variable or a time variable in your model to account for the inertia or persistence in your data. Or, you may need to remove a variable that is highly correlated with another variable or with time in your model to avoid multicollinearity or spurious regression.

To add or remove variables from your regression model in SPSS, you can use the Analyze > Regression > Linear option and select or deselect the variables that you want to include or exclude from your model.

### Using Generalized Least Squares (GLS) Method

A more advanced way to deal with autocorrelation is to use a generalized least squares (GLS) method that can adjust the parameter estimates and the standard errors for the presence of autocorrelation in your data. This method can produce more efficient and accurate results than the ordinary least squares (OLS) method that assumes no autocorrelation in your data.

To use the GLS method in SPSS, you need to have the SPSS Advanced Statistics module installed. Then, you can use the Analyze > Generalized Linear Models > Generalized Estimating Equations option and specify the correlation structure and the working correlation matrix for your data.

## Conclusion

In this article, we have learned how to test autocorrelation in SPSS 20 using three methods: Durbin-Watson test, correlogram, and Breusch-Godfrey test. We have also learned how to interpret and report the results of each test and how to deal with autocorrelation if we find it in our data. We have used a simple linear regression model as an example, but these methods can be applied to other types of regression models as well.

Autocorrelation is a common problem in regression analysis that can affect the validity and reliability of your results. Therefore, you should always check for autocorrelation in your data before drawing any conclusions from your regression model. If you detect autocorrelation in your data, you should try to find ways to eliminate or reduce it using appropriate methods such as transforming the data, adding or removing variables, or using generalized least squares method.

We hope that this article has helped you understand how to test autocorrelation in SPSS 20 and how to deal with it if you find it in your data. If you have any questions or comments, please feel free to leave them below.

## FAQs

Here are some frequently asked questions about autocorrelation and SPSS 20:

### What is the difference between autocorrelation and multicollinearity?

Autocorrelation is a problem that occurs when the errors or residuals of a regression model are correlated with each other over time. Multicollinearity is a problem that occurs when two or more independent variables of a regression model are highly correlated with each other. Both problems can affect the validity and reliability of your regression results, but they have different causes and consequences.

### How do I know which lag to use for the Breusch-Godfrey test?

The lag to use for the Breusch-Godfrey test depends on the nature and pattern of autocorrelation in your data. A general rule of thumb is to use the same lag as the highest order of autocorrelation that you suspect or detect in your data. For example, if you think that there is first-order autocorrelation in your data, you can use a lag of 1 for the Breusch-Godfrey test. If you think that there is second-order autocorrelation in your data, you can use a lag of 2 for the Breusch-Godfrey test.

### How do I choose between OLS and GLS methods?

The choice between OLS and GLS methods depends on whether there is any violation of the assumptions of OLS method in your data. One of the assumptions of OLS method is that there is no autocorrelation in your residuals. If this assumption is violated, then OLS method may produce biased and inefficient results. In this case, you may want to use GLS method instead, which can adjust for autocorrelation and produce more accurate and efficient results.

### How do I cite this article?

You can cite this article as follows:

Bing Chat Mode (2023). How to Test Autocorrelation in SPSS 20. Retrieved from https://www.bing.com/chatmode/articles/autocorrelation-spss-20

### Where can I learn more about autocorrelation and SPSS 20?

You can learn more about autocorrelation and SPSS 20 from these sources:

Gujarati, D.N., & Porter, D.C. (2009). Basic Econometrics (5th ed.). New York: McGraw-Hill.

Hair, J.F., Black, W.C., Babin, B.J., & Anderson, R.E. (2010). Multivariate Data Analysis (7th ed.). Upper Saddle River: Prentice Hall.

IBM SPSS Statistics 20 Documentation. (2011). Retrieved from https://www.ibm.com/support/pages/spss-statistics-200-documentation

Wooldridge, J.M. (2016). Introductory Econometrics: A Modern Approach (6th ed.). Boston: Cengage Learning.