Skip to content

Recomm_ShortInterest.do fill with last non-missing bug #178

@chenandrewy

Description

@chenandrewy

Line 15

asrol ireccd, gen(ireccd12) by(tempID) stat(first) window(time_avail_m 12) min(1)

is supposed to fill in ireccd12 with the most recent observation in the past 12 months (for the particular tempID group). But that is not what happens at all.

Instead, it produces a ton of missing values. Here's one example:

Image

I have no idea what is going on here. Of course, asrol doesn't have great documentation for this stat(first) option. We don't use this option anywhere else. Instead, I think we usually do something like:

foreach v of varlist PriceDelay* {
    bys permno (time_avail_m): replace `v' = `v'[_n-1] if mi(`v')    
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions