PANEL Procedure
Example 25.1 The Airline Cost Data: Fixed Effects
(View the complete code for this example.)
The Christenson Associates airline data are a frequently cited data set (Greene 2000). The data measure the costs, prices of inputs, and utilization rates for six airlines from 1970 to 1984. This example analyzes the cost (variable C), quantity (variable Q), and price (variable PF) and the untransformed load factor (variable LF). Because (1) all the variables vary over time, (2) the focus is on how these variables influence cost within each company, and (3) there is no strong reason to believe that the error terms are correlated among companies, a fixed-effects model would be the natural candidate. You propose the following model,
where the are airline effects. The actual model in the original, untransformed variables is highly nonlinear:
The following statements create the data set and perform the necessary log transformations:
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 ...
At the beginning of the analysis, it is natural to start with the most basic model, the pooled OLS model. The following statements run pooled OLS and check for fixed effects:
proc sort data = Airline;
by AirlineID Year;
run;
proc panel data = Airline;
id AirlineID Year;
model lC = lQ lPF LF / pooled pooltest;
run;
Output 25.1.1 provides a description of the model and data. There are six cross sections and 15 time points.
Output 25.1.1: Airline Cost Data, Model Description
| Model Description | |
|---|---|
| Estimation Method | Pooled |
| Number of Cross Sections | 6 |
| Time Series Length | 15 |
The R-square statistic and degrees of freedom are shown in Output 25.1.2. The R-square statistic is fairly high, indicating a good fit.
Output 25.1.2: Airline Cost Data, Pooled OLS Fit Statistics
| Fit Statistics | |||
|---|---|---|---|
| SSE | 1.3354 | DFE | 86 |
| MSE | 0.0155 | Root MSE | 0.1246 |
| R-Square | 0.9883 | ||
You could still run the poolability test to check whether the model has any fixed effects. The POOLTEST option provides the poolability test; the results are shown in Output 25.1.3.
Output 25.1.3: Airline Cost Data, Poolability Test Results
| Poolability Test Results | ||||
|---|---|---|---|---|
| Restricted Model | F | Pr > F | LR | Pr > LR |
| FIXONE | 8.39 | <.0001 | 96.04 | <.0001 |
| POOLED | 40.49 | <.0001 | 232.68 | <.0001 |
The Restricted Model column lists two models, FIXONE and POOLED. For the FIXONE model, the null hypothesis is a one-way fixed-effects model and the alternative hypothesis is a two-way fixed-effects model. The POOLED model tests the null hypothesis of a pooled OLS model against the alternative hypothesis of a one-way fixed-effects model. There are two types of poolability tests: an F test, as in the F column, and a likelihood ratio test, as in the LR column. Both the F test and the likelihood ratio test reject the one-way fixed-effects model and the pooled OLS model, as shown in Output 25.1.3, suggesting that a two-way fixed-effects model would be best. Before fitting a two-way fixed-effects model, you might want to fit a one-way fixed-effects model by using the following statements:
proc panel data = Airline;
id AirlineID Year;
model lC = lQ lPF LF / fixone printfixed;
run;
The R-square statistic and degrees of freedom are shown in Output 25.1.4. The R-square statistic is nearly 1 and higher than in the pooled OLS model, indicating a more reasonable fit. The error degrees of freedom is derived from 90 observations minus 5 cross sections minus 4 regressors.
Output 25.1.4: Airline Cost Data, Fixone Fit Statistics
| Fit Statistics | |||
|---|---|---|---|
| SSE | 0.2926 | DFE | 81 |
| MSE | 0.0036 | Root MSE | 0.0601 |
| R-Square | 0.9974 | ||
The results of the F test for fixed effects are shown in Output 25.1.5. These test results also easily reject the null hypothesis of the pooled OLS model. There are significant effects due to airlines, and it would be unreasonable to perform a pooled OLS regression that ignores these effects.
Output 25.1.5: Airline Cost Data, Test for Fixed Effects
| F Test for No Fixed Effects | |||
|---|---|---|---|
| Num DF | Den DF | F Value | Pr > F |
| 5 | 81 | 57.74 | <.0001 |
The PRINTFIXED option in the MODEL statement provides estimates of the airline effects (which are not displayed by default). The intercept is parameterized as the fixed effect for Airline 6. The other fixed effects are differences from that base category. Quantity and fuel price have positive effects on cost, but load factors negatively affect costs. Because cost, quantity, and fuel price are log-transformed, the coefficients for quantity and price are interpreted as elasticities of cost. The coefficient for (log) fuel price is 0.417, meaning that you would associate a 10% increase in fuel price with a 4.17% increase in costs.
Output 25.1.6: Airline Cost Data, Parameter Estimates
| Parameter Estimates | ||||||
|---|---|---|---|---|---|---|
| Variable | DF | Estimate | Standard Error | t Value | Pr > |t| | Label |
| CS1 | 1 | -0.08708 | 0.0842 | -1.03 | 0.3041 | Cross Sectional Effect 1 |
| CS2 | 1 | -0.12832 | 0.0757 | -1.69 | 0.0940 | Cross Sectional Effect 2 |
| CS3 | 1 | -0.29599 | 0.0500 | -5.92 | <.0001 | Cross Sectional Effect 3 |
| CS4 | 1 | 0.097487 | 0.0330 | 2.95 | 0.0041 | Cross Sectional Effect 4 |
| CS5 | 1 | -0.06301 | 0.0239 | -2.64 | 0.0100 | Cross Sectional Effect 5 |
| Intercept | 1 | 9.79304 | 0.2636 | 37.15 | <.0001 | Intercept |
| lQ | 1 | 0.919293 | 0.0299 | 30.76 | <.0001 | Log Transformation of Quantity |
| lPF | 1 | 0.417492 | 0.0152 | 27.47 | <.0001 | Log Transformation of Price of Fuel |
| LF | 1 | -1.07044 | 0.2017 | -5.31 | <.0001 | Load Factor (utilization index) |
As suggested by the poolability test results in Output 25.1.3, you suspect that there might be other factors at play, so you augment your model to include time effects. The following statements fit a two-way model, which is a model that has both airline effects and time effects:
proc panel data = Airline;
id AirlineID Year;
model lC = lQ lPF LF / fixtwo printfixed;
run;
The fit statistics, F test, and parameter estimates for the two-way model are provided in Output 25.1.7.
Output 25.1.7: Airline Cost Data, Two-Way Fixed Effects
| Fit Statistics | |||
|---|---|---|---|
| SSE | 0.1768 | DFE | 67 |
| MSE | 0.0026 | Root MSE | 0.0514 |
| R-Square | 0.9984 | ||
| F Test for No Fixed Effects | |||
|---|---|---|---|
| Num DF | Den DF | F Value | Pr > F |
| 19 | 67 | 23.10 | <.0001 |
| Parameter Estimates | ||||||
|---|---|---|---|---|---|---|
| Variable | DF | Estimate | Standard Error | t Value | Pr > |t| | Label |
| CS1 | 1 | 0.174237 | 0.0861 | 2.02 | 0.0470 | Cross Sectional Effect 1 |
| CS2 | 1 | 0.111412 | 0.0780 | 1.43 | 0.1576 | Cross Sectional Effect 2 |
| CS3 | 1 | -0.14354 | 0.0519 | -2.77 | 0.0073 | Cross Sectional Effect 3 |
| CS4 | 1 | 0.18019 | 0.0321 | 5.61 | <.0001 | Cross Sectional Effect 4 |
| CS5 | 1 | -0.04671 | 0.0225 | -2.08 | 0.0415 | Cross Sectional Effect 5 |
| TS1 | 1 | -0.69286 | 0.3378 | -2.05 | 0.0442 | Time Series Effect 1 |
| TS2 | 1 | -0.63816 | 0.3321 | -1.92 | 0.0589 | Time Series Effect 2 |
| TS3 | 1 | -0.59554 | 0.3294 | -1.81 | 0.0751 | Time Series Effect 3 |
| TS4 | 1 | -0.54192 | 0.3189 | -1.70 | 0.0939 | Time Series Effect 4 |
| TS5 | 1 | -0.47288 | 0.2319 | -2.04 | 0.0454 | Time Series Effect 5 |
| TS6 | 1 | -0.42705 | 0.1884 | -2.27 | 0.0267 | Time Series Effect 6 |
| TS7 | 1 | -0.39586 | 0.1733 | -2.28 | 0.0255 | Time Series Effect 7 |
| TS8 | 1 | -0.33972 | 0.1501 | -2.26 | 0.0269 | Time Series Effect 8 |
| TS9 | 1 | -0.2718 | 0.1348 | -2.02 | 0.0478 | Time Series Effect 9 |
| TS10 | 1 | -0.22734 | 0.0763 | -2.98 | 0.0040 | Time Series Effect 10 |
| TS11 | 1 | -0.1118 | 0.0319 | -3.50 | 0.0008 | Time Series Effect 11 |
| TS12 | 1 | -0.03366 | 0.0429 | -0.78 | 0.4354 | Time Series Effect 12 |
| TS13 | 1 | -0.01775 | 0.0363 | -0.49 | 0.6261 | Time Series Effect 13 |
| TS14 | 1 | -0.01865 | 0.0305 | -0.61 | 0.5430 | Time Series Effect 14 |
| Intercept | 1 | 12.93834 | 2.2181 | 5.83 | <.0001 | Intercept |
| lQ | 1 | 0.817264 | 0.0318 | 25.66 | <.0001 | Log Transformation of Quantity |
| lPF | 1 | 0.168732 | 0.1635 | 1.03 | 0.3057 | Log Transformation of Price of Fuel |
| LF | 1 | -0.88267 | 0.2617 | -3.37 | 0.0012 | Load Factor (utilization index) |
There is an overall time trend of increasing costs. The time period of the data spans the OPEC oil embargoes and the dissolution of the Civil Aeronautics Board (CAB). These are two possible explanations for the rising costs.
A surprising result is that the fuel cost is not significant in the two-way model. If the time effects are proxies for the effect of the oil embargoes, then the effect of fuel price might be subsumed by the time effects. If the time dummy variables are proxies for the dissolution of the CAB, then the effect of load factors is not precisely estimated.
ODS Graphics Plots
PROC PANEL can generate ODS plots to graphically analyze the results and perform diagnostics. The following statements show how to use the PLOTS=ALL option to generate all available plots. For a complete list of options, see the section Creating ODS Graphics.
ods graphics on;
proc panel data = Airline;
id AirlineID Year;
model lC = lQ lPF LF / fixtwo plots = all;
run;
Specifying PLOTS=ALL produces two panels of plots, shown in Output 25.1.8 and Output 25.1.9.
Output 25.1.8: Airline Cost Data, Diagnostic Panel 1

Output 25.1.9: Airline Cost Data, Diagnostic Panel 2

The following statements demonstrate how to use the UNPACK option to unpack the panels into single plots, and how to use the ONLY option to select only a surface plot of residuals:
proc panel data = Airline;
id AirlineID Year;
model lC = lQ lPF LF / fixtwo plots(unpack only) = residsurface;
run;
The unpacked residual-surface plot is shown in Output 25.1.10.
Output 25.1.10: Airline Cost Data, Surface Plot of the Residuals
