[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: st: Fixing the value in egen command

From   "Nick Cox" <>
To   <>
Subject   RE: st: Fixing the value in egen command
Date   Wed, 11 Feb 2009 20:54:54 -0000

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.  


Tanveer Shehzad


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:

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