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

Proc Panel for dynamic panel models

Accepted Solution Solved
Reply
Contributor
Posts: 40
Accepted Solution

Proc Panel for dynamic panel models

[ Edited ]

I have customer data that has sales, promotion (promo) and competitor sales (comp) information by customer and month. I'm trying to estimate the impact of promotion on sales. I'm intending to use Proc Panel, since this is a panel data. I know from domain knowledge that there is carryover (auto regressive) effect of sales and promotion for atleast 2 months.

 

Below is the first equation:

 

equation1.png

To eliminate individual customer specific effects (ai), we take first difference and obtain the following equation 2.

 

eq2.png

The above equation can be written in panel data is:

 

Proc panel data = cust_data;
	id cust time;
	instrument correlated =(comp sales_1);
	model Sales = promo promo_1 promo_2 comp comp_1 comp_2 sales_1 sales_2/gmm fdone nolevels;
run;

 

Below are my questions:

  1. Goal is to estimate comp and sales_1 as instrument variable method ? How would I state these two variables in the instrument statement ?
  2. Can I use both fdone and nolevels ?, since comp and sales_1 are correlated with differenced error term, is it correct to mention in instrument statement under correlated
  3. Would fdone or nolevels in model take care of first difference estimation? or should I difference it ahead of time and supply the data in Proc Panel ?
  4. Is GMM1 or GMM2 appropriate? How to choose appropriate GMM?
  5. how to write the equation (1) using SAS proc panel? 

 Thank you for the help

 

 

 

 


Accepted Solutions
Solution
a week ago
SAS Employee
Posts: 17

Re: Proc Panel for dynamic panel models


Below are my questions:

  1. Goal is to estimate comp and sales_1 as instrument variable method ? How would I state these two variables in the instrument statement ?
  2. Can I use both fdone and nolevels ?, since comp and sales_1 are correlated with differenced error term, is it correct to mention in instrument statement under correlated
  3. Would fdone or nolevels in model take care of first difference estimation? or should I difference it ahead of time and supply the data in Proc Panel ?
  4. Is GMM1 or GMM2 appropriate? How to choose appropriate GMM?
  5. how to write the equation (1) using SAS proc panel? 

 


To answer your questions in order:

 

1. To get instruments for sales_1, just use the keyword DEPVAR.  To get instruments for the lagged values of comp you would include those in one of the other options for the INSTRUMENTS statement, for example

  

instruments depvar correlated = (comp);

 

2. You do not need the FDONE option.  Once you specify GMM you are getting first-differenced equations.  When combined with the NOLEVELS options, you are getting first-differenced equations exclusively.

 

3. The differencing is done for you once you specify GMM.

 

4. GMM1 assumes no serial correlation in the differenced residuals.  If that's true then you gain some efficiency,  but it's usually safer to use GMM2.   GMM2 uses a data-based variance estimator for the differenced residuals.

 

5. If you are wanting to do standard fixed effects estimation then use 

Proc panel data = cust_data;
	id cust time;
	model Sales = promo promo_1 promo_2 comp comp_1 comp_2 sales_1 sales_2/ fixone;
run;

However, if you are wanting to do dynamic panel estimation using only the level equations then use

Proc panel data = cust_data;
	id cust time;
	instrument leveleq = (comp);
	model Sales = promo promo_1 promo_2 comp comp_1 comp_2 sales_1 sales_2/ gmm2 nodiffs;
run;

Note that I changed CORRELATED to LEVELEQ in the INSTRUMENTS statement.  That's because correlated variables are not instruments in the level equations, since they are correlated with the individual effects.

 

Please email me at Bobby.Gutierrez@sas.com (or post here) if you have any further questions.

View solution in original post


All Replies
Solution
a week ago
SAS Employee
Posts: 17

Re: Proc Panel for dynamic panel models


Below are my questions:

  1. Goal is to estimate comp and sales_1 as instrument variable method ? How would I state these two variables in the instrument statement ?
  2. Can I use both fdone and nolevels ?, since comp and sales_1 are correlated with differenced error term, is it correct to mention in instrument statement under correlated
  3. Would fdone or nolevels in model take care of first difference estimation? or should I difference it ahead of time and supply the data in Proc Panel ?
  4. Is GMM1 or GMM2 appropriate? How to choose appropriate GMM?
  5. how to write the equation (1) using SAS proc panel? 

 


To answer your questions in order:

 

1. To get instruments for sales_1, just use the keyword DEPVAR.  To get instruments for the lagged values of comp you would include those in one of the other options for the INSTRUMENTS statement, for example

  

instruments depvar correlated = (comp);

 

2. You do not need the FDONE option.  Once you specify GMM you are getting first-differenced equations.  When combined with the NOLEVELS options, you are getting first-differenced equations exclusively.

 

3. The differencing is done for you once you specify GMM.

 

4. GMM1 assumes no serial correlation in the differenced residuals.  If that's true then you gain some efficiency,  but it's usually safer to use GMM2.   GMM2 uses a data-based variance estimator for the differenced residuals.

 

5. If you are wanting to do standard fixed effects estimation then use 

Proc panel data = cust_data;
	id cust time;
	model Sales = promo promo_1 promo_2 comp comp_1 comp_2 sales_1 sales_2/ fixone;
run;

However, if you are wanting to do dynamic panel estimation using only the level equations then use

Proc panel data = cust_data;
	id cust time;
	instrument leveleq = (comp);
	model Sales = promo promo_1 promo_2 comp comp_1 comp_2 sales_1 sales_2/ gmm2 nodiffs;
run;

Note that I changed CORRELATED to LEVELEQ in the INSTRUMENTS statement.  That's because correlated variables are not instruments in the level equations, since they are correlated with the individual effects.

 

Please email me at Bobby.Gutierrez@sas.com (or post here) if you have any further questions.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 155 views
  • 0 likes
  • 2 in conversation