The SSM Procedure

Example 34.11 Panel Data: Dynamic Panel Model for the Cigar Data

(View the complete code for this example.)

This example shows how you can use the SSM procedure to specify and fit the so-called dynamic panel model, which is commonly used to analyze a panel of time series. Suppose that a panel of time series y Subscript t comma i follows the model

y Subscript t comma i Baseline equals rho y Subscript left parenthesis t minus 1 right parenthesis comma i Baseline plus mu Subscript i Baseline plus beta upper X Subscript t comma i Baseline plus zeta Subscript t Baseline plus epsilon Subscript t comma i

where t denotes the time index (for example, t equals 1 comma ellipsis comma upper T); i denotes the panel index (for example, i equals 1 comma ellipsis comma upper P); rho is the autoregression coefficient; mu Subscript i denote the panel-specific intercepts; upper X Subscript t comma i are observations on a regression variable with regression coefficient beta (the same for all panels); zeta Subscript t are unobserved, random time effects; and epsilon Subscript t comma i are the observation errors. The sequences zeta Subscript t and epsilon Subscript t comma i are assumed to be independent, zero-mean Gaussian variables with variances sigma 1 squared and sigma 0 squared, respectively. This is an example of a dynamic panel model that contains one regressor variable. It is easy to formulate this model equation as a state equation with state alpha alpha Subscript t of size P—the number of panels. Taking y Subscript t comma i Baseline equals alpha alpha Subscript t Baseline left bracket i right bracket, it is easy to see that the states alpha alpha Subscript t evolve according to the equation

alpha alpha Subscript t plus 1 Baseline equals bold upper T alpha alpha Subscript t Baseline plus bold upper W Subscript t plus 1 Baseline beta beta plus eta eta Subscript t plus 1

where bold upper T equals rho upper I Subscript upper P (a P-dimensional, diagonal matrix with all its diagonal elements equal to rho); bold upper W Subscript t Baseline equals left parenthesis bold upper X Subscript t Baseline upper I Subscript upper P Baseline right parenthesis is a upper P times left parenthesis 1 plus upper P right parenthesis-dimensional matrix (in a block form) of state regression variables, where the first block is a column that includes all the values upper X Subscript t comma i that are associated with a given time index (t) and the second block is a P-dimensional identity matrix; beta beta equals left parenthesis beta mu 1 comma ellipsis comma mu Subscript upper P Baseline right parenthesis Superscript prime is the left parenthesis 1 plus upper P right parenthesis-dimensional column vector of regression coefficients; and eta eta Subscript t Baseline equals left parenthesis zeta Subscript t Baseline plus epsilon Subscript t comma 1 Baseline comma ellipsis comma zeta Subscript t Baseline plus epsilon Subscript t comma upper P Baseline right parenthesis Superscript prime is a P-dimensional column vector of all the disturbances that are associated with time index t. Because zeta Subscript t and epsilon Subscript t comma i are independent, the covariance matrix of eta eta Subscript t—for example, bold upper Q Subscript t—is easy to calculate: bold upper Q Subscript t Baseline left bracket i comma i right bracket equals sigma 0 squared plus sigma 1 squared and comma for i not equals j comma bold upper Q Subscript t Baseline left bracket i comma j right bracket equals sigma 1 squared. This formulation can be easily extended to multiple regression variables, such as normal r variables, by appropriately modifying the term that is associated with the state regression variables—bold upper W Subscript t Baseline beta beta: the new bold upper W Subscript t matrix becomes upper P times left parenthesis r plus upper P right parenthesis-dimensional and the new regression vector beta beta becomes left parenthesis r plus upper P right parenthesis-dimensional.

The cross-sectional data, Cigar, that are used in the section Getting Started: SSM Procedure are reused in this example. In order to use the SSM procedure to perform the dynamic panel model–based analysis, the input data set must be reorganized so that it contains the variables that form the upper P times left parenthesis r plus upper P right parenthesis-dimensional matrix bold upper W Subscript t. For the Cigar data, the number of panels upper P equals 46 (the number of regions considered in the study), and the number of regression variables r equals 3. Therefore, the input data set needs to be augmented by 46 asterisk left parenthesis 3 plus 46 right parenthesis equals 2,254 variables that constitute the matrix bold upper W Subscript t Baseline equals left parenthesis bold upper X Subscript t Baseline upper I 46 right parenthesis—the first 46 times 3-dimensional block bold upper X Subscript t contains the values of the three regression variables, lprice, lndi, and lpimin, at a given time index (a particular year in this case). The following DATA steps accomplish this task in two steps. In the first step, the raw data that form the rows of the Cigar data set are read into a temporary data set, Tmp, such that all 6*46 = 276 values that are associated with a given year (values of six variables—year, region, lsales, lprice, lndi, and lpimin for 46 panels in a given year) are read in a single row that consists of 276 columns. In the second step, the final input data set is formed by rearranging Tmp so that it contains the necessary variables in the proper order—year (the time index), region (the panel index), lsales (the response variable), and the variables that form the 46 times 49-dimensional bold upper W matrix (w1, …, w2254).

data Tmp;
    input u1-u276;
datalines;
63 1 4.54223 3.35341 7.3514 3.26194
63 2 4.82831 3.17388 7.5729 3.21487
63 3 4.63860 3.29584 7.3000 3.25037

   ... more lines ...   

data cigar(keep=year region lsales w1-w2254);
   array wmat{46, 49} w1-w2254;
   array ivar{46, 6} u1-u276;
   set tmp;
   year = intnx( 'year', '1jan63'd, u1-63 );
   format year year.;
   do i=1 to 46;
      region = ivar[i, 2];
      lsales = ivar[i, 3];
      do j=1 to 46;
          do k=1 to 49;
              wmat[j,k] = 0;
              if k = j+3 then wmat[j,k] = 1;
              if k=1 then wmat[j,k] = ivar[j, 4];
              if k=2 then wmat[j,k] = ivar[j, 5];
              if k=3 then wmat[j,k] = ivar[j, 6];
          end;
      end;
      output;
   end;
run;

The following statements specify and fit the dynamic panel model:

 proc ssm data=Cigar opt(tech=dbldog maxiter=75);
     id year interval=year;
     parms rho / lower=-0.9999 upper=0.9999;
     parms sigma0 sigma1 / lower=1.e-8;
     array RegionArray{46} region1-region46;
     do i=1 to 46;
        RegionArray[i] = (region=i);
     end;
     array cov{46,46};
     do i=1 to 46;
         do j=1 to 46;
            if(i=j) then cov[i,j] = sigma0 + sigma1;
            else cov[i,j] = sigma1;
         end;
     end;
     state panelState(46) T(I)=(rho) W(g)=(w1-w2254)
       cov(g)=(cov) a1(46) checkbreak;
     comp dynPanel = (RegionArray)*panelState;
     model lsales = dynPanel;
     output out=for1 press;
 run;

The estimates of the regression coefficients and the regional intercepts, which are all statistically significant, are shown in Output 34.11.1. In particular, the estimated coefficients of lprice, lndi, and lpimin, are –0.26, 0.13, and 0.07, respectively.

Output 34.11.1: Estimates of beta 1, beta 2, beta 3 and the Regional Intercepts

The SSM Procedure

Estimate of the State Equation Regression Vector
StateElement IndexEstimateStandard
Error
t ValuePr > |t|
panelState1-0.26270.0178-14.79<.0001
panelState20.13400.013010.30<.0001
panelState30.07480.01983.780.0002
panelState40.42650.05817.35<.0001
panelState50.38250.06056.32<.0001
panelState60.44250.05827.61<.0001
panelState70.34710.06315.50<.0001
panelState80.36860.06355.81<.0001
panelState90.43570.06147.10<.0001
panelState100.37530.06555.73<.0001
panelState110.42490.06067.01<.0001
panelState120.41850.06046.92<.0001
panelState130.38240.06026.35<.0001
panelState140.39420.06446.12<.0001
panelState150.41540.06266.64<.0001
panelState160.39610.06106.49<.0001
panelState170.37650.06186.10<.0001
panelState180.45280.06087.44<.0001
panelState190.43160.05867.36<.0001
panelState200.43570.06017.25<.0001
panelState210.37710.06395.90<.0001
panelState220.39390.06296.26<.0001
panelState230.41220.06216.64<.0001
panelState240.39490.06056.52<.0001
panelState250.43860.05657.77<.0001
panelState260.41180.06276.57<.0001
panelState270.38980.06046.45<.0001
panelState280.38180.06136.23<.0001
panelState290.43430.06326.87<.0001
panelState300.46190.06257.39<.0001
panelState310.37300.06365.86<.0001
panelState320.37840.05896.43<.0001
panelState330.38250.06256.12<.0001
panelState340.37840.05986.32<.0001
panelState350.40930.06286.52<.0001
panelState360.41550.05976.96<.0001
panelState370.39600.06156.44<.0001
panelState380.40750.06026.77<.0001
panelState390.40450.05866.91<.0001
panelState400.39180.05996.55<.0001
panelState410.43500.06087.15<.0001
panelState420.40070.06026.65<.0001
panelState430.31960.05975.36<.0001
panelState440.43370.06097.12<.0001
panelState450.37900.06345.98<.0001
panelState460.37670.06186.10<.0001
panelState470.43920.05977.36<.0001
panelState480.39320.06046.51<.0001
panelState490.39380.06166.40<.0001


Output 34.11.2 shows the estimates of the autoregression coefficient rho, the observation error variance sigma 0 squared, and the variance of the time effect (variance of zeta) sigma 1 squared.

Output 34.11.2: Estimates of rho, sigma 0 squared, and sigma 1 squared

Estimates of Named Parameters
ParameterEstimateStandard
Error
t Value
rho0.8316790.012433866.89
sigma00.0012310.000049125.08
sigma10.0002130.00006623.22


Finally, you can compare the fit of the dynamic panel model with the fit of the model that is discussed in the section Getting Started: SSM Procedure. Output 34.11.3 shows the likelihood-based information criteria for the dynamic panel model, and Output 34.11.4 shows the same information for the other model.

Output 34.11.3: Likelihood-Based Information Criteria: Dynamic Panel Model

Information Criteria
StatisticDiffuse Likelihood
Based
Profile Likelihood
Based
AIC (lower is better)-4732.722-4856.398
BIC (lower is better)-4717.247-4343.874
AICC (lower is better)-4732.704-4841.250
HQIC (lower is better)-4726.913-4664.667
CAIC (lower is better)-4714.247-4245.874


Output 34.11.4: Likelihood-Based Information Criteria: Getting Started Example

Information Criteria
StatisticDiffuse Likelihood
Based
Profile Likelihood
Based
AIC (lower is better)-4488.093-4145.246
BIC (lower is better)-4477.776-3637.952
AICC (lower is better)-4488.084-4130.417
HQIC (lower is better)-4484.220-3955.472
CAIC (lower is better)-4475.776-3540.952


Similarly, Output 34.11.5 shows fit criteria based on the delete-one cross validation error for the dynamic panel model, and Output 34.11.6 shows the same information for the other model.

Output 34.11.5: Delete-One Cross Validation Criteria: Dynamic Panel Model

Delete-One Cross Validation Error Criteria
VariableNPRESSGeneralized Cross-Validation
lsales13801.1153095.62798E-7


Output 34.11.6: Delete-One Cross Validation Criteria: Getting Started Example

Delete-One Cross Validation Error Criteria
VariableNPRESSGeneralized Cross-Validation
lsales13801.2904206.18144E-7


On the basis of both these considerations, the dynamic panel model appears to provide a better fit for the Cigar data than the model that is fit in the section Getting Started: SSM Procedure.

Last updated: January 07, 2025