Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: interaction variables

From   "daniele.curzi" <>
Subject   st: interaction variables
Date   Fri, 15 Apr 2011 09:20:13 -0700 (PDT)

Dear Stata Members, I have to generate interaction variables between a
country dummy and a time variable!

I have a dataset with 50 countries. So using the tabulate command I get 50
dummy variables (country1, country2, 50). Now I want to multiply
all these variables for a time variable! In this case I will generate 50 new

To do that, I can multiply each country dummy for the time variable.

gen cy1=country1*year

gen cy2=country2*years


gen cy50=country50*years

I was wondering if there exist any command to make this in a faster way! 

Thanks for your help

View this message in context:
Sent from the Statalist mailing list archive at
*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index