Hello,
I have some conceptual econometrics questions on the use of interactoin terms.
I have the following time series regression:
logdiff(y) = logdiff(r) + logdiff(m) (eq 1),
where all variables are stationary. But in their raw form y, r and m are not stationary.
But taking a log and first differencing each variable makes them stationary.
I have 3 questions:
1) If I want to know see if m and r interact significantly, do I just create a new variable
(let's say) r_times_m and let it equal to rXm and re-run the regression as the following?
logdiff(y) = logdiff(r) + logdiff(m) + r_times_m ( eq 2)
2) If I run the above model (eq 2), r_times_m won't be stationary, so would that still be a valid regression for interpretation?
3) Or should I create a a new variables logdiff_r_times_logdiff_m and let it equal to logdiff(r)Xlogdiff(m),
then run the following regression?
logdiff(y) = logdiff(r) + logdiff(m) + logdiff_r_times_logdiff_m ( eq 3)
Thanks in advance!
Hi,
I think it's best to return to the original model equation and consider the effect and the transforms.
Before applying log and difference transformations, you have
y = r + m
If you add a multiplicative interaction term then you have
y= r+m+(r*m)
now you can apply the log transform
log(y) = log(r) + log(m) + log(r*m)
and properties of logarithms can reduce this further:
log(y) = log(r) + log(m) + log(r) + log(m)
log(y) = 2*log(r) + 2*log(m)
Given that algebra, does it mean that the interaction effect is always (log(r) +log(m))/2? If so, then one need never include the interaction in the model as it would always represent half of the sum in the log space, and the square root of the product in the original space. There seems to be something wrong in there, but I don't know what it might be.
SteveDenham
There are no coefficients displayed, so that's probably what seems strange.
I was copying the original posters format and excluded them.
The full model equation would be
log(y) = B0 + B1*log(r) + B2*log(m) + B3*log(r*m)
Then you have to fit the model and perform statistical tests on the coefficients to see if they are statistically different from zero and should be included in the final model.
Maybe it is not correct to use the logarithm property as I did, but it seems mathematically ok.
It does remove the interaction term and I'm not completely sure that can be compensated for in the coefficients.
Yes it can! Taking this back to the original scale by exponentiating, I note that exp(B0) is a constant, so I am not going to be concerned with it much, just set it to C.
The equation will then look like Y = C* (r^B1)*(m^B2)*((r*m)^B3)
Rearranging this is Y = C * (r^(B1+B3))*(m^(B2+B3))
So B3 has an additional effect on Y through the original r and m variables. That is a classical multiplicative interaction.
SteveDenham
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.