Hi Paolo,
this kind of operation can be easily done with gretl using hansl (with
means via scrioft or console)
In order to get a dummy variable with value 1 if a,b, and c are positive
numbers and otherwise zero use this code:
series d_all_p = (a>=0 && b>0 && c>0)? 1 : 0
Cheers
Leon
Am 28.05.2012 15:15, schrieb Paolo Caliò:
Hello!
I need to create some dummy variables in order to capture all the
possible combinations of a certain set of variables.
For instance, let's assume I have three variables a, b, c.
I need one dummy equal to 1 when all three variables are positive,
zero otherwise.
I need one dummy equal to 1 when all three variables are negative,
zero otherwise.
I need one dummy equal to 1 when a and b are positive and c negative,
zero otherwise.
I need one dummy equal to 1 when a and c are positive and b negative,
zero otherwise.
Etc etc etc...
I would do this in Excel since my database is taken from a csv, but
the actual number of variables is much higher then 3, so it takes a
lot of time to do it manually.
I don't have any idea if it is possible to create these dummies
automatically with some piece of code in GretL, but if it is I would
really really appreciate your help in writing this code.
Thank you very much in advance.
Cheers,
Paolo
_______________________________________________
Gretl-users mailing list
Gretl-users(a)lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users