Bookmark and Share

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


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

R: Re: st: interaction variables


From   Daniele Curzi <[email protected]>
To   [email protected]
Subject   R: Re: st: interaction variables
Date   Fri, 15 Apr 2011 23:22:22 +0200

Dimitri and Nick,

Thank you very much for your help!

Best Regards

Daniele

Il 15/04/11, "Dimitriy V. Masterov" <[email protected]> ha scritto:
Daniele,

If you have Stata 11, you can just add a term to your regression like
this using factor variables:

reg y x1 x2 i.country##i.time

This will include both country and time dummies as well as their
interaction in your specification. If you just want the interaction,
use only one #.

DVM
On Fri, Apr 15, 2011 at 12:20 PM, daniele.curzi <[email protected]> wrote:
> 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,....country 50). Now I want to multiply
> all these variables for a time variable! In this case I will generate 50 new
> variables!
>
> 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: http://statalist.1588530.n2.nabble.com/interaction-variables-tp6276860p6276860.html
> Sent from the Statalist mailing list archive at Nabble.com.
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/
>

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

--
--------------------------------------------------------------------------
Daniele Curzi

Dipartimento di Economia e Politica Agraria, Agroalimentare e Ambientale
Università degli Studi di Milano- Facoltà di Agraria
Via Celoria 2
20133 MILANO

Tel: +39 02 503 16465
Fax: +39 02 503 16486

E-mail: [email protected]

* * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/


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