Dear Statalister,

I would like to ask how to merge Compustat security daily data and Worldscope annual data together? Because Worldscope do not include fyear, so I not sure how to merge them together. I need to use prccd in Compustat to calculate the realised return and Tobin's q, but I also need 'Accounting Standard Followed' in Worldscope.

How can I merge the Worldscope Fundamental Annual, Worldscope Stock Data and Compustat Security Daily dataset together? Because Compustat is daily data and Worldscope is annual data, but I want my dataset to be annual data. Can I ask how to merge these 3 dataset into annual data, please? Thank you.

STATA Code:
gen year=yofd(datadate)
format year %ty
merge m:m isin using Document1.dta

How can I collapse daily data into annual data?

STATA Code:
collapse (mean) average_price=PRCCD, by(ISIN)

or
bysort isin datadate: egen ave=mean(prccd)

Help would very appreciated.

Kind regards,

Tiantian Peng