Thanks Nick and Maartin:
Both solutions work fine.
Best regards,
Tanveer
Nick Cox wrote:
> gen bad = missing(assets)
> bysort bank (bad year) : gen first = assets[1]
>
> Alternatively, a -first()- -egen- function is included in -egenmore- on
> SSC that gives first non-missing values.
>
> It's better to learn the logic behind the code above. Within banks, sort
> all the missing values to the end and within blocks of non-missing and
> missing, sort by year.
>
> Nick
> [email protected]
>
> Tanveer Shehzad
>
> <edited>
>
> I have something like 10,000 banks and I need to
> take their initial level of assets (the first available value and not
> corresponding to a fixed year). Could there be any solution?
>
> *
> * 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/
>
--
Choudhry Tanveer Shehzad (Tanveer)
PhD Student
Department of Finance,
Faculty of Economics & Business,
University of Groningen,
Nettelbosje 2
9747 AE Groningen
The Netherlands
Mobile: 0031-644801970
Home Page: http://www.rug.nl/staff/c.t.shehzad/
*
* 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/