Statalist The Stata Listserver


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

st: RE: Syntax Question/ Cross-sectional Characteristic of a panel data


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Syntax Question/ Cross-sectional Characteristic of a panel data
Date   Sun, 29 Jan 2006 23:31:17 -0000

Sounds like 

bysort Firmid (Year) : gen Timeofentry = Year[1] - Age[1] - 1970 

Nick 
n.j.cox@durham.ac.uk 

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/



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