There does not seem to be an "easy" way (such as in R or python) to create interaction terms between dummy variables in gretl ? Do we really need to code those manually which will be difficult for many levels? Here is a minimal example of manual coding:
open credscore.gdt
SelfemplOwnRent=OwnRent*Selfempl
# model 1
ols Acc 0 OwnRent Selfempl SelfemplOwnRent
Now my manual interaction term will not work for factors with many levels and in fact does not even do the job for binary variables.
Thanks, ML
One way of doing this is to use lists. Use the
dummify
-command for generating dummies for each level and the^
-operator for creating the interactions. Example:The command
discrete
turns your variable into a discrete variable and allows to usedummify
(this step is not necessary if your variable is already discrete). Now all interactions terms are stored in the listINT
and you can easily assess them in the followingols
-command.