PANEL Procedure
Example 25.2 The Airline Cost Data: First Difference or Fixed Effects
(View the complete code for this example.)
Example 25.1 fits the airline data by using a two-way fixed-effects model, as suggested by the poolability test results in Output 25.1.3. However, you might wonder why you should not use a first-difference model, considering that both first-difference models and fixed-effects models can be used for data that have fixed effects. The answer is that you could, but the first-difference model does not provide as good a fit as the fixed-effects model in this case. This example illustrates how to fit the airline cost data by using a first-difference model. It also gives you some guidance about when to use a first-difference model and when to use a fixed-effects model.
When there are only two time periods, the two methods are identical. When there are more than two time periods, the two models are different. Under the strict exogeneity assumption, both models provide unbiased and consistent estimates; however, the efficiency is different between the two models. The efficiency depends on the serial correlation of errors in the original model. Consider the following one-way fixed-effects model:
The fixed effects can be removed by subtracting first-order lags (first differences) or by subtracting the mean of the series (fixed effects) from both sides of the equation. The regression error is for the first-difference model and
for the fixed-effects model, where
is the mean of the
series. If the original error term
is uncorrelated over time (that is,
), then
and
. This means that the first-difference model is not efficient in this case, and that the fixed-effects model would be more efficient and thus preferred. On the other hand, if
follows a random walk process (that is,
and
is a white noise process), then
is a white noise process. In this case, the first-difference model is efficient and the fixed-effects model is not. Every so often you might see that the error term is between these two extremes, meaning that
follows an AR(1) process and
. In such cases, the choice of model depends on where
is. If
is close to 0, the fixed-effects model is preferred. If
is close to 1, the first-difference model is preferred. Hence you need to check the autocorrelation of the regression errors. Run the first-difference model or fixed-effects model first, and then check the autocorrelation of the regression errors (
and
). For example, if the covariance of the regression errors from the first-difference model is negative and significant, this suggests that original errors are more likely to be uncorrelated, and the fixed-effects model is preferred. Of course, you might also get positive correlation, which makes it harder to make a decision. A common practice is to run both models and use the model that provides more efficient estimates.
First, you create the Airline data set and log-transform the variables, as in the following DATA step:
data Airline;
input Obs AirlineID T C Q PF LF;
Year = T + 1969;
lC = log(C);
lQ = log(Q);
lPF = log(PF);
label lC = "Log Transformation of Costs";
label lQ = "Log Transformation of Quantity";
label lPF = "Log Transformation of Price of Fuel";
label LF = "Load Factor (utilization index)";
datalines;
1 1 1 1140640 0.95276 106650 0.53449
2 1 2 1215690 0.98676 110307 0.53233
3 1 3 1309570 1.09198 110574 0.54774
4 1 4 1511530 1.17578 121974 0.54085
5 1 5 1676730 1.16017 196606 0.59117
... more lines ...
Example 25.1 shows how to fit the airline data by using a fixed-effects model. The following statements fit a two-way fixed-effects model and test the autocorrelation of the regression errors:
proc sort data = Airline;
by AirlineID Year;
run;
proc panel data = Airline;
id AirlineID Year;
model lC = lQ lPF LF / fixtwo printfixed DW;
run;
The estimation results are the same as in Output 25.1.7 and so are not listed here. The DW option provides a test of serial correlation by using the Durbin-Watson statistic. The test results are shown in Output 25.2.1.
Output 25.2.1: Durbin-Watson Statistic for Two-Way Fixed-Effects Model
| Durbin-Watson Statistic for First-Order Correlation in a Fixed Effects Model | ||||||||
|---|---|---|---|---|---|---|---|---|
| DF | Statistic | White Noise vs. Positive Correlation | Random Walk vs. Stationary | White Noise vs. Negative Correlation | ||||
| Pr < DWLower | Pr < DWUpper | Pr > DWLower | Pr > DWUpper | Statistic | Pr < DWLower | Pr < DWUpper | ||
| 1 | 0.69 | <.0001 | <.0001 | 0.0323 | 0.4344 | 3.31 | 1.0000 | 1.0000 |
As shown in Output 25.2.1, the test statistic is 0.69, indicating positive correlation among regression errors. The white noise versus positive correlation test result also rejects the null hypothesis of white noise and suggests positive correlation at the 1% significance level. The DWLower and DWUpper values for the random walk versus stationary test can be treated as bounds on the exact p-value. The results show that the exact p-value is from 0.0323 to 0.4344, making it uncertain whether the regression errors follow a random walk. In such cases, you should probably also run the first-difference model and compare the estimation results from the two models. For more information about the Durbin-Watson test, see the section Durbin-Watson Test.
The following statements fit a two-way first-difference model and test the autocorrelation of the regression errors:
proc panel data = Airline;
id AirlineID Year;
model lC = lQ lPF LF / fdtwo printfixed BW;
run;
Output 25.2.2 provides a model description, a data description, and fit statistics. The fit statistics are very close to the fit statistics of the fixed-effects model shown in Output 25.1.7, indicating that the two models have a close fit.
Output 25.2.2: Airline Cost Data, First-Difference, Model Description
| Model Description | |
|---|---|
| Estimation Method | FDTwo |
| Number of Cross Sections | 6 |
| Time Series Length | 15 |
| Fit Statistics | |||
|---|---|---|---|
| SSE | 0.1562 | DFE | 67 |
| MSE | 0.0023 | Root MSE | 0.0483 |
| R-Square | 0.9986 | ||
The first-difference model also supports the PRINTFIXED option. The BW option provides a test of serial correlation for the first-difference model by using the Berenblut-Webb statistic. The test results are shown in Output 25.2.3.
Output 25.2.3: Berenblut-Webb Statistic for Two-Way First-Difference Model
| Berenblut-Webb Statistic for First-Order Correlation in a Fixed Effects Model | ||||||||
|---|---|---|---|---|---|---|---|---|
| DF | Statistic | White Noise vs. Positive Correlation | Random Walk vs. Stationary | White Noise vs. Negative Correlation | ||||
| Pr < BWLower | Pr < BWUpper | Pr > BWLower | Pr > BWUpper | Statistic | Pr < BWLower | Pr < BWUpper | ||
| 1 | 0.60 | <.0001 | <.0001 | 0.0837 | 0.6094 | 3.40 | 1.0000 | 1.0000 |
As for the fixed-effects model, Output 25.2.3 also indicates a positive correlation among the regression errors, and it is not clear whether the random walk hypothesis could be rejected at the 10% significance level. You need to compare the standard errors of the two models. The estimation results are shown in Output 25.2.4.
Output 25.2.4: Airline Cost Data, Two-Way First-Difference
| Parameter Estimates | ||||||
|---|---|---|---|---|---|---|
| Variable | DF | Estimate | Standard Error | t Value | Pr > |t| | Label |
| CS1 | 1 | 0.345321 | 0.1499 | 2.30 | 0.0243 | Cross Sectional Effect 1 |
| CS2 | 1 | 0.241374 | 0.1332 | 1.81 | 0.0745 | Cross Sectional Effect 2 |
| CS3 | 1 | -0.03271 | 0.0852 | -0.38 | 0.7021 | Cross Sectional Effect 3 |
| CS4 | 1 | 0.236073 | 0.0488 | 4.84 | <.0001 | Cross Sectional Effect 4 |
| CS5 | 1 | -0.01092 | 0.0221 | -0.49 | 0.6226 | Cross Sectional Effect 5 |
| TS1 | 1 | -0.99065 | 0.1923 | -5.15 | <.0001 | Time Series Effect 1 |
| TS2 | 1 | -0.92656 | 0.1886 | -4.91 | <.0001 | Time Series Effect 2 |
| TS3 | 1 | -0.85624 | 0.1843 | -4.65 | <.0001 | Time Series Effect 3 |
| TS4 | 1 | -0.79041 | 0.1773 | -4.46 | <.0001 | Time Series Effect 4 |
| TS5 | 1 | -0.64882 | 0.1322 | -4.91 | <.0001 | Time Series Effect 5 |
| TS6 | 1 | -0.58245 | 0.1110 | -5.25 | <.0001 | Time Series Effect 6 |
| TS7 | 1 | -0.5352 | 0.1020 | -5.25 | <.0001 | Time Series Effect 7 |
| TS8 | 1 | -0.45887 | 0.0894 | -5.13 | <.0001 | Time Series Effect 8 |
| TS9 | 1 | -0.34829 | 0.0794 | -4.39 | <.0001 | Time Series Effect 9 |
| TS10 | 1 | -0.2585 | 0.0503 | -5.14 | <.0001 | Time Series Effect 10 |
| TS11 | 1 | -0.12613 | 0.0343 | -3.67 | 0.0005 | Time Series Effect 11 |
| TS12 | 1 | -0.02751 | 0.0365 | -0.75 | 0.4543 | Time Series Effect 12 |
| TS13 | 1 | -0.01682 | 0.0326 | -0.52 | 0.6072 | Time Series Effect 13 |
| TS14 | 1 | -0.01848 | 0.0285 | -0.65 | 0.5194 | Time Series Effect 14 |
| Intercept | 1 | 0.309139 | 1.2077 | 0.26 | 0.7988 | Intercept |
| lQ | 1 | 0.769304 | 0.0542 | 14.19 | <.0001 | Log Transformation of Quantity |
| lPF | 1 | 0.075482 | 0.0871 | 0.87 | 0.3893 | Log Transformation of Price of Fuel |
| LF | 1 | -1.40326 | 0.2173 | -6.46 | <.0001 | Load Factor (utilization index) |
As shown in Output 25.2.4, most parameter estimation results of two-way first-difference models are close to the results of the two-way fixed-effects model in Output 25.1.7. The estimation of the intercept is the one item that is very different between the two methods, but it is not significant in the first-difference method. As in the two-way fixed-effects model, the estimation of the log transformation of fuel price is not significant here, because the change in it is mostly captured by the time effect. Comparing the results of the two models, the fixed-effects model works slightly better for the airline cost data, because there are more estimates at the 5% significance level in this model. If you are interested, you can run the one-way fixed effects by using both methods, and you will find that the estimation results are even more similar than for the two-way model.