OpenSourceAP/CrossSection

FirmAgeMom missing values and weird code

chenandrewy opened this issue · 2 comments

There's weird stuff in FirmAgeMom.do

There seem to be no observations of FirmAgeMom in 2021 July.

Seems to be due to this snippet

replace FirmAgeMom = . if abs(prc) < 5 | tempage < 12
egen temp = fastxtile(tempage), by(time_avail_m) n(5)  // Find bottom age quintile
replace FirmAgeMom =. if temp > 1 & temp !=.

is the & supposed to be |? That looks weird.

Anyway, the bottom quintile of age is very small in 2021, at around 11-12:

image

and that seems to be interacting with the filter above and causing the gap.

Zhang 2006 applies the abs(prc)<5 and tempage < 12 filter before doing any analysis

image

so we should only run the fastxtile on stocks that satisfy those filters. That should address this gap.

Fixed in 6e86321.
Dropping obs with abs(prc)<5) | tempage <12 and computing quantiles on the remaining stocks leads to more reasonable numbers:

grafik