Forecasting using SAS Forecast Server, SAS/ETS, and more

Estimating a VAR model with panel data

Occasional Contributor
Posts: 8

Estimating a VAR model with panel data

Dear All,


I am trying to estimate a VAR model with a panel data set. My data consists of buyer-seller dyads observed over time. For example, consider a buyer-seller dyad (i,j) with buyer i and seller j. I observe Bi,t from the buyer and Sj,t from the seller for t = 1, 2, ..., T. These two variables are simultaneously determined and hence are endogeneous. For this particular dyad, I can specify a VAR model as follows:

Bi,t = Sj,t + Sj,t-1 + Bi,t-1 + Xt + u
Sj,t = Bi,t + Sj,t-1 + Bi,t-1 + Wt + v
However, I cannot estimate each dyad on its own since I have short time series (small T) with less than 7 observations. But I have thousands of dyads and I would like to take advantage of the panel data structure. Currently, I am using PROC SYSLIN to specify the two simultaneous equations and integrate panel data structure by hand-coding dummy variables. I have two questions:
(1) Is my current approach appropriate in terms of unbiasedness and efficiency of the estimates?
(2) Could I use PROC VARMAX with this type of a panel data set?
Any suggestions will be greatly appreciated.
SAS Employee
Posts: 49

Re: Estimating a VAR model with panel data

I am not particularly familiar with models where
contemporaneous response values appear on the RHS.  In any event,
I am going to suggest an alternate model that might capture many
aspects of your problem description while still remaining parsimonious.
Suppose (i,j)th buyer/seller pair denotes a panel.


B_it = mu_bi + mu_t[1] + X_t beta_1 + e_it
S_jt = mu_sj + mu_t[2] + W_t beta_2 + e_jt


1.  B_it and S_jt denote the i-th buyer and the j-th seller response
values at time t.
2.  mu_bi and mu_sj denote the intercept terms
for i-th buyer and j-th seller (fixed effects),
3. mu_t is a bivariate time trend such as random walk (taken
to be a random effect term) that is common to all the panels,
4. X_t and W_t are regression variables (there might be overlap but their
coefficients will be different for B and S),
5. e_it and e_jt are independent white noise terms.

This model could be thought of as a bivariate version of panel model
that has fixed panel effects and random time effects.


I am providing sample code for fitting this model with the SSM procedure.

See the SSM procedure in SAS/ETS documentation for more information about this procedure.


For simplicity of descripton suppose that:
   there are 100 buyers and 50 sellers,
   X variables are X1 to X5
   W variables are W1 to W8

Suppose the input data set, say test, has the following:
1.  the observations are indexed by a time index (say date) and test is sorted
    by the time index.
2.  the time index are equispaced (such as monthly, daily, etc).
3.  there can be multiple observations, say n_t, at a time index t. n_t need not be
    the same for all t (i.e., panels can be unbalanced)
4.  the input data set already has the necessary intercept dummies:
    mu_b1 to mu_b100 are the buyer dummies: mu_bi = (buyer = i);
    mu_s1 to mu_b50 are the seller dummies: mu_sj = (seller = j);



proc ssm data=test;
   id date < interval=day >;
   state timeEffect(2) t(I) cov(g) cov1(d);
   comp bTime = timeEffect[1];
   comp sTime = timeEffect[2];
   irregular wb;
   irregular ws;
   model B = mu_b1-mu_b100 x1-x5 bTime wb;
   model S = mu_s1-mu_s50 w1-w8 sTime ws;
   output out=for press;

One can consider many other variations of this model, including your model with lagged response
values.  However, PROC SSM is not very scalable for  such models when
there are so many (thousands according to you) panels. 

Occasional Contributor
Posts: 8

Re: Estimating a VAR model with panel data

Dear rselukar,


Thanks for your response. However, the model you suggest does not address the simultaneity in my data set. B depends on S, and S depends on B. But I still appreciate your response.




SAS Employee
Posts: 49

Re: Estimating a VAR model with panel data

I understand.  Models that include terms signifying association between the i-th buyer and j-th seller for each (i,j) pair become quite large.  At the moment SSM will not scale for such problems.  If the number of such pairs is small, say less than 50, then it might be feasible.

Ask a Question
Discussion stats
  • 3 replies
  • 2 in conversation