Hi all
I have 2 lists of variables (i.e. varlist1 and varlist2) and I would like to use a command that combines both varlists, such as scatter (example below).
Example:
I would use a foreach variable loop inside another foreach variable loop and this would work perfectly if I wanted all possible combinations of varlist1 with varlist2, but I would like to exclude certain combinations, such as price and turn for example. Does anyone know of a more efficient way to do this without having to exclude this combination manually?
Thank you
Filipe
I have 2 lists of variables (i.e. varlist1 and varlist2) and I would like to use a command that combines both varlists, such as scatter (example below).
Example:
Code:
sysuse auto, clear foreach var1 of varlist price headroom trunk{ foreach var2 of varlist weight length turn{ scatter `var1' `var2' } }
Thank you
Filipe
Comment