I would like to merge CRSP dataset with CRSP/Compustat but it wont work.
The data I gathered and collapsed it into year from CRSP looks like this:
permno ticker year cusip volatility
10001 xyz 2009 10234567 0.5
10001 xyz 2010 10234567 0.4
10001 xyz 2011 10234567 0.3
10001 xyz 2012 10234567 0.45
10001 xyz 2013 10234567 0.5
10022 abc 2009 10234434 0.1
10022 abc 2010 10234434 0.4
10022 abc 2011 10234434 0.4
I have tried a file similar to example above with CRSP/Compustat Merged by taking as common variable CUSIP. I have also managed to change the CUSIP of Compustat to 8 digits from 9 digits by using this command substr(CUSIP, 1,8) and changed the name of CUSIP into CUSIP2 in both data sets.) and I have used CRSP/compustat as a master file and tried to merge CRSP file in CRSP/Compustat file. However, the Stata says, CUSIP2 is not common variable in both datasets. Can someone tell me what I am doing wrong ?
The data I gathered and collapsed it into year from CRSP looks like this:
permno ticker year cusip volatility
10001 xyz 2009 10234567 0.5
10001 xyz 2010 10234567 0.4
10001 xyz 2011 10234567 0.3
10001 xyz 2012 10234567 0.45
10001 xyz 2013 10234567 0.5
10022 abc 2009 10234434 0.1
10022 abc 2010 10234434 0.4
10022 abc 2011 10234434 0.4
I have tried a file similar to example above with CRSP/Compustat Merged by taking as common variable CUSIP. I have also managed to change the CUSIP of Compustat to 8 digits from 9 digits by using this command substr(CUSIP, 1,8) and changed the name of CUSIP into CUSIP2 in both data sets.) and I have used CRSP/compustat as a master file and tried to merge CRSP file in CRSP/Compustat file. However, the Stata says, CUSIP2 is not common variable in both datasets. Can someone tell me what I am doing wrong ?
Comment