Sounds like
bysort Firmid (Year) : gen Timeofentry = Year[1] - Age[1] - 1970
Nick
[email protected]
ALICE DOBSON
> I have an unbalanced panel of firms for a period of 15 years,
> 1972-1986. One
> of the variables is Age of the firm. The maximum age of any
> firm is 15
> years. Hence, all firms are born during or after 1972. I want
> to compute
> the time of entry of each firm, which will be one value for
> a particular firmid.
>
> Firmid Year Age Timeofentry
> 0001 1983 6 7
> 0001 1984 7
> 0001 1985 8
> 0001 1986 9
> 0002 1984 13 1
> 0002 1985 14
> 0002 1986 15
>
>
> For instance, the age of firmid 0001 during the year 1983
> [when it first
> appears in the data] is 6 years. I therfore compute its
> timeofentry as 7
> since it entered in 1978. Similarly, the age of firmid 0002
> firmid during
> 1984 [when it first appears in the data] was 13 and hence I
> compute its time
> of entry as 1.
>
> I would like to compute the timeofentry of all firms in the
> unbalanced
> panel. Could anyone please help me with the syntax?
*
* 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/