I'm trying to figure out the syntax for generating interaction
variables using wildcards for suffixes.
I have variables PhoneAA PhoneBB PhoneCC Phone DD and PreferenceAA
PreferenceBB PreferenceCC and Preference DD.
I'd like to generate the interaction variable that would occur from a
product of these two vectors:
PhonePrefAA=PreferenceAA*PhoneAA, PhonePrefBB=PreferenceBB*PhoneBB, etc.
The problem is that I have many of these types of variables and six
suffixes, and I don't want to type out all the suffixes individually.
Is there a way I can do this using a for loop?
Thanks,
Rachel
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/