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

Hi,

I have a balanced panel data set for t=2. I want to estimate a fixed effects model in the following way:

Y= β(0) + β(1)*x + β(2)*z + β(3)*(x*z) + μ + ε

I don't know how to include an interaction term in the PROC PANEL procedure. Hence, I thought about manually calculating a variable w=x*y and including it in the model. However, considering that a fixed effects model uses deviations of the individual specific means for each variable, this seems to be wrong.

Does anybody know how this has to be done?

Any help would be greatly appreciated!

1 ACCEPTED SOLUTION

Accepted Solutions
SteveDenham
Jade | Level 19

If x and z are CLASS variables, you should be able to specify the model using GLM-like syntax.  I suspect however that they are continuous variables.  In that case, the interaction variable can be constructed as (x{i} - xbar) * (z{i} - zbar), where xbar and zbar are the means of the two values.  May need scaling but not sure.

Steve Denham

View solution in original post

3 REPLIES 3
SteveDenham
Jade | Level 19

If x and z are CLASS variables, you should be able to specify the model using GLM-like syntax.  I suspect however that they are continuous variables.  In that case, the interaction variable can be constructed as (x{i} - xbar) * (z{i} - zbar), where xbar and zbar are the means of the two values.  May need scaling but not sure.

Steve Denham

JB81
Calcite | Level 5

Thanks for your answer. Since t=2, I decided to use a first difference model which is equivalent to a fixed effects model an easier to implement in SAS, since I can implement the interactions directly in GLM.

What do you mean by "may need scaling"? I want to mean-center x and z and again I am wondering whether I have to mean-center the first-difference of x and z (d_x & d_z) or the actual variables x and z?

And another question: why does PROC PANEL let me include t as a variable? If I include the difference of t in the first difference model, then d_t=1 for each observation and therefore exlcuded from the model. What does PROC PANEL do differently here?

SteveDenham
Jade | Level 19

I would stick with mean-centering the variables, rather than first differences, but that is just a gut feeling.  If everything is equally spaced with no missing values, the only way I see it coming out differently is if the first or last variable are extreme.  That is just a 50:50 thought though.

The last question is certainly beyond my scope--the guys in the Econometrics and Forecasting forum may have an answer.  Calling on and -  any help on this one?

Steve Denham

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!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 2697 views
  • 0 likes
  • 2 in conversation