BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Forecaster
Obsidian | Level 7

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

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
bobby_sas
SAS Employee

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

3 REPLIES 3
bobby_sas
SAS Employee

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.

Krisha_A
Calcite | Level 5

Hello, is GMM possible with SAS Studio? If yes, how to do OLS, Fixed Effect Model, and Random Effect Model? I have one dependent variable and many independent variables in my dataset and I am studying it over the period of 1999 - 2016. 

ShelleySessoms
Community Manager

@Krisha_A Since this question has a solution and is closed, please start a new message with your question. It will get more visibility that way.

 

Thanks,

Shelley

It's time to register for SAS Innovate! Join your SAS user peers in Las Vegas on April 16-19 2024.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 1642 views
  • 1 like
  • 4 in conversation