The matching scripts, LBOmatchingscript.jl and LBOmatching.jl, were rewritten by Ed to run with Julia 1.1.1. They use the LBOregmarker and regfilter -- we are matching at t-1 (or t-2). Note that we only export if regfilter==1 to MatchInput2V1.txt. All 179 patenting LBOs are in there...
To run the matching script:
julia -i LBOmatchingscript.jl
dumps you to an interactive shell afterwards to do diagnostics:
diagdf
println("Size before drop ", size(LBOs,1))
First run matches 162 (163 but no match 66). Although the 179 are going in, some are missing indu3 (because they are missing n2) and some are missing logitpreg.
163
The One solution was to create an additional sic to naics lookup and then union it with the official one. Because of the courseness of the newly included SIC and so NAICS codes, this will only work when using 2 digit NAICS codes.This got us to 171 in and 170 matched. julia> diagdf 1×9 DataFrame │ Row │ gvkey │ year │ lboregmarker │ patentstock │ indu3 │ logitpreg │ hadlbo │ regfilter │ matchpair │ │ │ Int64 │ Int64 │ Int64 │ Int64 │ Int64 │ Float64 │ Int64 │ Int64 │ Float64 │ ├─────┼───────┼───────┼──────────────┼─────────────┼───────┼────────────┼────────┼───────────┼───────────┤ │ 1 │ 8367 │ 1983 │ 1 │ 27 │ 3 │ 0.00616416 │ 1 │ 1 │ -0.1 │ //Diagnostics on logitpreg su gvkey if regfilter & hadlbo //179 su lvg if regfilter & hadlbo //177 su lvgsq if regfilter & hadlbo //177 su tobinql if regfilter & hadlbo //172 su revgrowthl if regfilter & hadlbo //174 su taxtoassets if regfilter & hadlbo //177 su ebitdatoassets if regfilter & hadlbo //176 su revtl if regfilter & hadlbo //177 revgrowthl first... tab gvkey if regfilter & hadlbo & revgrowthl==. Compustat | gvkey | Freq. Percent Cum. ------------+----------------------------------- 3051 | 1 20.00 20.00 FIXED -1 is 1992, which has no vals. -2 has vals. 14276 | 1 20.00 40.00 1987,-2 and has data for just that year. Would need revt for 1986. 14628 | 1 20.00 60.00 1987,-1 and no data for -2. Could use 0 but some leverage step up there already! 15309 | 1 20.00 80.00 1988,-1 and had datga for just that year. Would need revt for 1987. 25389 | 1 20.00 100.00 FIXED -1 is 1995, which has no vals. -2 has vals. ------------+----------------------------------- Total | 5 100.00 The two marked fixed where fixed in the data: UPDATE LBOvalid SET CSfyear = 1991 WHERE gvkey='003051'; --1 UPDATE LBOvalid SET CSfyear = 1994 WHERE gvkey='025389'; --1
=Ed's version from 2018=