Solved
Contributor
Posts: 40

# 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:

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

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
Highlighted
Solution
‎08-09-2017 03:13 PM
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?

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.

All Replies
Highlighted
Solution
‎08-09-2017 03:13 PM
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?

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.

Occasional Learner
Posts: 1

## Re: Proc Panel for dynamic panel models

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.

Community Manager
Posts: 493

## Re: Proc Panel for dynamic panel models

@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

☑ This topic is solved.