Thomas Reuters 13F filings
And link them to GVKEY
use tr_firm.dta,clear
gen year=year(fdate)
gen month=month(fdate)
save tr_firm.dta,replace
//Only keep Thomas Reuters firms, to make the linking easier.
use tr_13f_holdings,clear
gen year=year(fdate)
gen month=month(fdate)
keep if month==max_month
drop max_month
drop if missing(cusip)
keep year month cusip shares
bys year cusip: egen sum_shares=sum(shares)
duplicates drop cusip year month,force
replace sum_shares=sum_shares/1000000
merge 1:1 year month cusip using tr_firm
keep if _merge==3
drop _merge month
gen ins_hold=sum_shares/shrout1
merge m:1 cusip using ccmlink_ibes.dta
keep if _merge==3
drop _merge
drop if ins_hold>1
xtset gvkey year
gen ins_change=ins_hold-L.ins_hold
drop sic state fdate ticker stkcd
save tr_ins_holdings.dta,replace