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,

StartLayout 1st Row  log left-parenthesis sans-serif upper C Subscript i t Baseline right-parenthesis equals alpha plus beta 1 log left-parenthesis sans-serif upper Q Subscript i t Baseline right-parenthesis plus beta 2 log left-parenthesis sans-serif upper P sans-serif upper F Subscript i t Baseline right-parenthesis plus beta 3 sans-serif upper L sans-serif upper F Subscript i t Baseline plus nu Subscript i Baseline plus epsilon Subscript i t EndLayout

where the nu Subscript i are airline effects. The actual model in the original, untransformed variables is highly nonlinear:

StartLayout 1st Row  sans-serif upper C Subscript i t Baseline equals exp left-parenthesis alpha plus beta 3 sans-serif upper L sans-serif upper F Subscript i t Baseline plus nu Subscript i Baseline plus epsilon Subscript i t Baseline right-parenthesis sans-serif upper Q Subscript i t Superscript beta 1 Baseline sans-serif upper P sans-serif upper F Subscript i t Superscript beta 2 EndLayout

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

The PANEL Procedure
Pooled (OLS) Estimates
 
Dependent Variable: lC (Log Transformation of Costs)

Model Description
Estimation MethodPooled
Number of Cross Sections6
Time Series Length15


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
SSE1.3354DFE86
MSE0.0155Root MSE0.1246
R-Square0.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

The PANEL Procedure
Panel Poolability Tests
 
Dependent Variable: lC (Log Transformation of Costs)

Poolability Test Results
Restricted ModelFPr > FLRPr > LR
FIXONE8.39<.000196.04<.0001
POOLED40.49<.0001232.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

The PANEL Procedure
Fixed One-Way Estimates
 
Dependent Variable: lC (Log Transformation of Costs)

Fit Statistics
SSE0.2926DFE81
MSE0.0036Root MSE0.0601
R-Square0.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 DFDen DFF ValuePr > F
58157.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
VariableDFEstimateStandard
Error
t ValuePr > |t|Label
CS11-0.087080.0842-1.030.3041Cross Sectional Effect 1
CS21-0.128320.0757-1.690.0940Cross Sectional Effect 2
CS31-0.295990.0500-5.92<.0001Cross Sectional Effect 3
CS410.0974870.03302.950.0041Cross Sectional Effect 4
CS51-0.063010.0239-2.640.0100Cross Sectional Effect 5
Intercept19.793040.263637.15<.0001Intercept
lQ10.9192930.029930.76<.0001Log Transformation of Quantity
lPF10.4174920.015227.47<.0001Log Transformation of Price of Fuel
LF1-1.070440.2017-5.31<.0001Load 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

The PANEL Procedure
Fixed Two-Way Estimates
 
Dependent Variable: lC (Log Transformation of Costs)

Fit Statistics
SSE0.1768DFE67
MSE0.0026Root MSE0.0514
R-Square0.9984  

F Test for No Fixed Effects
Num DFDen DFF ValuePr > F
196723.10<.0001

Parameter Estimates
VariableDFEstimateStandard
Error
t ValuePr > |t|Label
CS110.1742370.08612.020.0470Cross Sectional Effect 1
CS210.1114120.07801.430.1576Cross Sectional Effect 2
CS31-0.143540.0519-2.770.0073Cross Sectional Effect 3
CS410.180190.03215.61<.0001Cross Sectional Effect 4
CS51-0.046710.0225-2.080.0415Cross Sectional Effect 5
TS11-0.692860.3378-2.050.0442Time Series Effect 1
TS21-0.638160.3321-1.920.0589Time Series Effect 2
TS31-0.595540.3294-1.810.0751Time Series Effect 3
TS41-0.541920.3189-1.700.0939Time Series Effect 4
TS51-0.472880.2319-2.040.0454Time Series Effect 5
TS61-0.427050.1884-2.270.0267Time Series Effect 6
TS71-0.395860.1733-2.280.0255Time Series Effect 7
TS81-0.339720.1501-2.260.0269Time Series Effect 8
TS91-0.27180.1348-2.020.0478Time Series Effect 9
TS101-0.227340.0763-2.980.0040Time Series Effect 10
TS111-0.11180.0319-3.500.0008Time Series Effect 11
TS121-0.033660.0429-0.780.4354Time Series Effect 12
TS131-0.017750.0363-0.490.6261Time Series Effect 13
TS141-0.018650.0305-0.610.5430Time Series Effect 14
Intercept112.938342.21815.83<.0001Intercept
lQ10.8172640.031825.66<.0001Log Transformation of Quantity
lPF10.1687320.16351.030.3057Log Transformation of Price of Fuel
LF1-0.882670.2617-3.370.0012Load 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

Airline Cost Data, Diagnostic Panel 1


Output 25.1.9: Airline Cost Data, Diagnostic Panel 2

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

Airline Cost Data, Surface Plot of the Residuals


Last updated: June 19, 2025