Statalist The Stata Listserver


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

st: generate a code variable


From   "irodriguez" <[email protected]>
To   [email protected]
Subject   st: generate a code variable
Date   Wed, 11 Apr 2007 10:42:18 -0300

I have a desbalanced panel data with data of firms with many years of observations for each
example:
firm     year   benefit
A          1        10
A          2        19
A          3          8
B          1          9
B          2          7
C          2          2
C          3        12
C          4          6
C          5          6
I need to create a numeric variable for firms
Example
firm     year   benefit   codfirm
A          1        10         1
A          2        19         1
A          3          8         1
B          1          9         2
B          2          7         2
C          2          2         3
C          3        12         3
C          4          6         3
C          5          6         3
 
How can I do it?
Thanks
 



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