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
| Model Description | |
|---|---|
| Estimation Method | DynDiff |
| Estimation Technique | One-Step GMM |
| Variance Estimation | Model Based |
| Data Set | CIGAR |
| Number of Observations | 1380 |
| Number of Cross Sections | 46 |
| Time Series Length | 30 |
| GMM Bandwidth | 30 |
| Fit Statistics | |||
|---|---|---|---|
| SSE | 3.1373 | DFE | 1283 |
| MSE | 0.0024 | Root MSE | 0.0494 |
| Instruments | ||
|---|---|---|
| Type | Variables | Number of Instruments |
| Difference Equations, Endogenous | LSales | 406 |
| Difference Equations, Standard | LPrice LDisp LMin | 3 |
| Level Equations, Standard | Intercept | 1 |
| Total | 410 | |
| Sargan Test | ||
|---|---|---|
| DF | Chi-Square | Pr > ChiSq |
| 405 | 712.45 | <.0001 |
| Parameter Estimates | ||||||
|---|---|---|---|---|---|---|
| Variable | DF | Estimate | Standard Error | t Value | Pr > |t| | Label |
| Intercept | 1 | 0.769092 | 0.0658 | 11.69 | <.0001 | Intercept |
| LSales_1 | 1 | 0.732212 | 0.0178 | 41.07 | <.0001 | Lag 1: Log cigarette sales in packs per capita |
| LPrice | 1 | -0.26328 | 0.0255 | -10.31 | <.0001 | Log price per pack of cigarettes |
| LDisp | 1 | 0.166116 | 0.0105 | 15.88 | <.0001 | Log per capita disposable income |
| LMin | 1 | 0.032726 | 0.0233 | 1.40 | 0.1604 | Log minimum price in adjoining states per pack of cigarettes |
| AR(m) Tests | ||
|---|---|---|
| Lag | Z | Pr > |Z| |
| 1 | -15.44 | <.0001 |
| 2 | 2.47 | 0.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,
LSalesstandard instruments for the exogenous regressors
LPrice,LDisp, andLMina 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
| Model Description | |
|---|---|
| Estimation Method | DynDiff |
| Estimation Technique | Two-Step GMM |
| Variance Estimation | Windmeijer Bias Corrected |
| Data Set | CIGAR |
| Number of Observations | 1380 |
| Number of Cross Sections | 46 |
| Time Series Length | 30 |
| GMM Bandwidth | 30 |
| Fit Statistics | |||
|---|---|---|---|
| SSE | 3.1277 | DFE | 1283 |
| MSE | 0.0024 | Root MSE | 0.0494 |
| Instruments | ||
|---|---|---|
| Type | Variables | Number of Instruments |
| Difference Equations, Endogenous | LSales | 406 |
| Difference Equations, Standard | LPrice LDisp LMin | 3 |
| Level Equations, Standard | Intercept | 1 |
| Total | 410 | |
| Sargan Test | ||
|---|---|---|
| DF | Chi-Square | Pr > ChiSq |
| 41 | 45.20 | 0.3008 |
| Parameter Estimates | ||||||
|---|---|---|---|---|---|---|
| Variable | DF | Estimate | Standard Error | t Value | Pr > |t| | Label |
| Intercept | 1 | 0.776914 | 0.1458 | 5.33 | <.0001 | Intercept |
| LSales_1 | 1 | 0.728347 | 0.0492 | 14.79 | <.0001 | Lag 1: Log cigarette sales in packs per capita |
| LPrice | 1 | -0.25707 | 0.0421 | -6.11 | <.0001 | Log price per pack of cigarettes |
| LDisp | 1 | 0.167345 | 0.0248 | 6.75 | <.0001 | Log per capita disposable income |
| LMin | 1 | 0.025064 | 0.0432 | 0.58 | 0.5616 | Log minimum price in adjoining states per pack of cigarettes |
| AR(m) Tests | ||
|---|---|---|
| Lag | Z | Pr > |Z| |
| 1 | -5.00 | <.0001 |
| 2 | 1.90 | 0.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
| Model Description | |
|---|---|
| Estimation Method | DynDiff |
| Estimation Technique | Two-Step GMM |
| Variance Estimation | Windmeijer Bias Corrected |
| Data Set | CIGAR |
| Number of Observations | 1380 |
| Number of Cross Sections | 46 |
| Time Series Length | 30 |
| GMM Bandwidth | 30 |
| Fit Statistics | |||
|---|---|---|---|
| SSE | 3.3942 | DFE | 1283 |
| MSE | 0.0026 | Root MSE | 0.0514 |
| Instruments | ||
|---|---|---|
| Type | Variables | Number of Instruments |
| Difference Equations, Endogenous | LSales LPrice | 812 |
| Difference Equations, Standard | LDisp LMin | 2 |
| Level Equations, Standard | Intercept | 1 |
| Total | 815 | |
| Sargan Test | ||
|---|---|---|
| DF | Chi-Square | Pr > ChiSq |
| 41 | 44.98 | 0.3088 |
| Parameter Estimates | ||||||
|---|---|---|---|---|---|---|
| Variable | DF | Estimate | Standard Error | t Value | Pr > |t| | Label |
| Intercept | 1 | 0.531106 | 0.1271 | 4.18 | <.0001 | Intercept |
| LSales_1 | 1 | 0.799028 | 0.0412 | 19.38 | <.0001 | Lag 1: Log cigarette sales in packs per capita |
| LPrice | 1 | -0.22491 | 0.0346 | -6.50 | <.0001 | Log price per pack of cigarettes |
| LDisp | 1 | 0.139713 | 0.0202 | 6.92 | <.0001 | Log per capita disposable income |
| LMin | 1 | 0.029462 | 0.0383 | 0.77 | 0.4416 | Log minimum price in adjoining states per pack of cigarettes |
| AR(m) Tests | ||
|---|---|---|
| Lag | Z | Pr > |Z| |
| 1 | -5.02 | <.0001 |
| 2 | 1.94 | 0.0521 |