CPANEL Procedure

Example 11.5 Cigarette Sales Data: Dynamic Panel Estimation

Consider a dynamic panel demand model for cigarette sales that illustrates the methods described in the section Dynamic Panel Estimation (DYNDIFF and DYNSYS Options). The data are from a panel of 46 American states over the period 1963–1992. The dependent variable is the logarithm of per capita cigarette sales (variable LSales). Other factors that were measured include the log of price (LPrice), the log of disposable income (LDisp), and the log of minimum price in adjoining states (LMin). For a full description of the data, see Baltagi (2013, sec. 8.9).

The following statements create the Cigar data set. These statements assume that your libref is named mylib, but you can substitute any appropriately defined libref.

data mylib.Cigar;
   input State Year Price Pop Pop_16 Cpi Disp Sales Min;
   LSales = log(Sales);
   LPrice = log(Price);
   LDisp  = log(Disp);
   LMin   = log(Min);
   label
   State   = 'State abbreviation'
   Year    = 'Year'
   LSales  = 'Log cigarette sales in packs per capita'
   LPrice  = 'Log price per pack of cigarettes'
   LDisp   = 'Log per capita disposable income'
   LMin    = 'Log minimum price in adjoining states per pack of cigarettes';
datalines;
1 63 28.6 3383 2236.5 30.6 1558.3045298 93.9 26.1
1 64 29.8 3431 2276.7 31.0 1684.0732025 95.4 27.5
1 65 29.8 3486 2327.5 31.5 1809.8418752 98.5 28.9
1 66 31.5 3524 2369.7 32.4 1915.1603572 96.4 29.5
1 67 31.6 3533 2393.7 33.4 2023.5463678 95.5 29.6
1 68 35.6 3522 2405.2 34.8 2202.4855362 88.4 32
1 69 36.6 3531 2411.9 36.7 2377.3346665 90.1 32.8
1 70 39.6 3444 2394.6 38.8 2591.0391591 89.8 34.3
1 71 42.7 3481 2443.5 40.5 2785.3159706 95.4 35.8

   ... more lines ...   

You propose a panel model for cigarette sales that contains fixed effects for states. Because you believe that the data are insufficient to explain all possible shocks in yearly sales, you include lagged sales in the model as a regressor. By construction, lagged sales are an endogenous regressor, and you thus specify dynamic panel estimation by using the DYNDIFF option. The following statements fit the model:

proc cpanel data =  mylib.Cigar;
   id State Year;
   model LSales = LPrice LDisp LMin / dyndiff;
run;

The results are shown in Output 11.5.1. Note that it was not necessary to explicitly include lagged sales on the right-hand side of the model; PROC CPANEL generates it for you. The coefficient on lagged sales is 0.732, indicating a high degree of autocorrelation in the dependent variable. When cigarette sales are unusually high or low because of unforeseen circumstances, the effects tend to linger for several years. The results also show that demand is highly elastic to price.

Output 11.5.1: Dynamic Panel Estimation for Cigarette Sales

The CPANEL Procedure
Dynamic Panel Estimation Using Difference Equations (DynDiff)
Dependent Variable: LSales (Log cigarette sales in packs per capita)

Model Description
Estimation MethodDynDiff
Estimation TechniqueOne-Step GMM
Variance EstimationModel Based
Data SetCIGAR
Number of Observations1380
Number of Cross Sections46
Time Series Length30
GMM Bandwidth30

Fit Statistics
SSE3.1373DFE1283
MSE0.0024Root MSE0.0494

Instruments
TypeVariablesNumber of
Instruments
Difference Equations, EndogenousLSales406
Difference Equations, StandardLPrice LDisp LMin3
Level Equations, StandardIntercept1
Total 410

Sargan Test
DFChi-SquarePr > ChiSq
405712.45<.0001

Parameter Estimates
VariableDFEstimateStandard
Error
t ValuePr > |t|Label
Intercept10.7690920.065811.69<.0001Intercept
LSales_110.7322120.017841.07<.0001Lag 1: Log cigarette sales in packs per capita
LPrice1-0.263280.0255-10.31<.0001Log price per pack of cigarettes
LDisp10.1661160.010515.88<.0001Log per capita disposable income
LMin10.0327260.02331.400.1604Log minimum price in adjoining states per pack of cigarettes

AR(m) Tests
LagZPr > |Z|
1-15.44<.0001
22.470.0134


Included in Output 11.5.1 are two diagnostic measures. The first, a Sargan test, is a test of the validity of the moment conditions that are conferred by the GMM instruments that were used. The p-value indicates that the moment conditions are not valid and that you should probably look for a set of instruments other than the default set that PROC CPANEL provides.

The second diagnostic test is the AR(m) test for autocorrelation in the residuals. In well-fitting dynamic panel models, you expect to see some autocorrelation of lag 1, but any autocorrelation at higher lags indicates a poor fit. The autocorrelation at lag 2 is significant, leading you to seek a better-fitting alternative.

One possible explanation for the poor fit is that, by default, PROC CPANEL uses the one-step generalized method of moments (GMM). One-step GMM is known for being too reliant on the assumption that the residuals from the difference equations are not serially correlated. An alternative is two-step GMM, which instead uses a data-driven variance matrix for the differenced residuals.

The following statements fit the model by two-step GMM:

proc cpanel data =  mylib.Cigar;
   id State Year;
   endogenous LSales;
   instruments LPrice LDisp LMin;
   model LSales = LPrice LDisp LMin / dyndiff gmm = twostep biascorrected;
run;

The code includes ENDOGENOUS and INSTRUMENTS statements that, for demonstration purposes, reproduce the default instrument set. That set includes the following:

  • GMM-style instruments based on the endogenous dependent variable, LSales

  • standard instruments for the exogenous regressors LPrice, LDisp, and LMin

  • a column of ones in the instrument matrix for the level equations that corresponds to the model intercept

The code also includes the BIASCORRECTED option, which produces bias-corrected standard errors according to the method of Windmeijer (2005).

The results are shown in Output 11.5.2. The coefficients do not change much, but the standard errors are now more reliable. The model diagnostic tests indicate a better fit, although you should use caution when interpreting Sargan test results. Sargan tests lack power when the number of instruments is large, and their distributional properties come into question under conditions that favor either robust or bias-corrected standard errors.

Output 11.5.2: Dynamic Panel Estimation by Two-Step GMM

The CPANEL Procedure
Dynamic Panel Estimation Using Difference Equations (DynDiff)
Dependent Variable: LSales (Log cigarette sales in packs per capita)

Model Description
Estimation MethodDynDiff
Estimation TechniqueTwo-Step GMM
Variance EstimationWindmeijer Bias Corrected
Data SetCIGAR
Number of Observations1380
Number of Cross Sections46
Time Series Length30
GMM Bandwidth30

Fit Statistics
SSE3.1277DFE1283
MSE0.0024Root MSE0.0494

Instruments
TypeVariablesNumber of
Instruments
Difference Equations, EndogenousLSales406
Difference Equations, StandardLPrice LDisp LMin3
Level Equations, StandardIntercept1
Total 410

Sargan Test
DFChi-SquarePr > ChiSq
4145.200.3008

Parameter Estimates
VariableDFEstimateStandard
Error
t ValuePr > |t|Label
Intercept10.7769140.14585.33<.0001Intercept
LSales_110.7283470.049214.79<.0001Lag 1: Log cigarette sales in packs per capita
LPrice1-0.257070.0421-6.11<.0001Log price per pack of cigarettes
LDisp10.1673450.02486.75<.0001Log per capita disposable income
LMin10.0250640.04320.580.5616Log minimum price in adjoining states per pack of cigarettes

AR(m) Tests
LagZPr > |Z|
1-5.00<.0001
21.900.0575


The previous estimation treats regressors such as LPrice as exogenous. If you believe that price is endogenous, you can create GMM-style instruments for LPrice to replace the default standard instruments.

The following statements fit the model by using GMM-style instruments for LPrice:

proc cpanel data =  mylib.Cigar;
   id State Year;
   endogenous LSales LPrice;
   instruments LDisp LMin;
   model LSales = LPrice LDisp LMin / dyndiff gmm = twostep biascorrected;
run;

The results are shown in Output 11.5.3. Treating LPrice as endogenous nearly doubles the number of instruments. Although this is not the case here, when the number of instruments is so large that it makes estimation infeasible, you can limit the number of instruments by specifying the MAXBAND= option in the MODEL statement.

Output 11.5.3: Dynamic Panel Estimation, Custom Instrument Set

The CPANEL Procedure
Dynamic Panel Estimation Using Difference Equations (DynDiff)
Dependent Variable: LSales (Log cigarette sales in packs per capita)

Model Description
Estimation MethodDynDiff
Estimation TechniqueTwo-Step GMM
Variance EstimationWindmeijer Bias Corrected
Data SetCIGAR
Number of Observations1380
Number of Cross Sections46
Time Series Length30
GMM Bandwidth30

Fit Statistics
SSE3.3942DFE1283
MSE0.0026Root MSE0.0514

Instruments
TypeVariablesNumber of
Instruments
Difference Equations, EndogenousLSales LPrice812
Difference Equations, StandardLDisp LMin2
Level Equations, StandardIntercept1
Total 815

Sargan Test
DFChi-SquarePr > ChiSq
4144.980.3088

Parameter Estimates
VariableDFEstimateStandard
Error
t ValuePr > |t|Label
Intercept10.5311060.12714.18<.0001Intercept
LSales_110.7990280.041219.38<.0001Lag 1: Log cigarette sales in packs per capita
LPrice1-0.224910.0346-6.50<.0001Log price per pack of cigarettes
LDisp10.1397130.02026.92<.0001Log per capita disposable income
LMin10.0294620.03830.770.4416Log minimum price in adjoining states per pack of cigarettes

AR(m) Tests
LagZPr > |Z|
1-5.02<.0001
21.940.0521


Last updated: July 09, 2026