Dear all,

I am using an unbalanced panel data set with about 880,000 observations for n = 5000 units, monthly data. These units are companies with certain amounts of assets.

I would like to do the following: For each company, generate a dummy variable equal to one from the month when the company reached at least 10m in assets on as long as the company is in the data set (regardless of which values of assets the firm reaches after that, i.e. it does not matter if it drops below 10m or not). These months when 10m threshold is reached are of course not the same for every firm, sometimes 10m is not even reached throughout the whole period.

I have got to the point when I identified the first moment (month) in the time series for each firm when the assets reached at least 10m. I have therefore a column of zeros with occasional 1, indicating these first months. Now, I would like to tell Stata to basically replace the zeros below these ones (e.g. 10m has already been reached and for further months I want just 1, regardless of the amounts of assets) for all companies by also ones.

I am stuck here and do not seem to find any feasible solutions. Can you please provide me with some advice? Thank you in advance!


KC