Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: generate


From   "Issam.Hallak" <[email protected]>
To   [email protected]
Subject   st: generate
Date   Sat, 28 Jul 2007 20:14:47 +0200

Hello

I have a question I had in mind for quite a while.

My dataset looks like this:

company_name year var1 var2 var3 ...

firm_A 1990 3 2 5 ...
firm_A 1991 4 2.4 4.8 ...
firm_A 1992 4.2 3 5 ...
... ... ... ... ... ...
firm_B 1990 2 1.5 4 ...
firm_B 1991 2 1.6 4.1 ...
... ... ... ... ... ...
all_firms 1990 30 50 56 ...
all_firms 1991 32 61 87 ...
... ... ... ... ... ...

For each firm, I wish to generate a new variable that uses the values of all_firms. For instance:

var_10 = var1{firm_A;1990}/var1{all_firms;1990}

I never managed to find out how I could create such a variable. Can some one help me on this issue?

Thank you very much.

*
* 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/




© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index