Hi everyone,
I've been searching a lot around the internet but I haven't found how to solve my problem.
I have two datasets. Each dataset has a list of companies with balance sheet results for a given year. Each company is also part of a certain industry, which is identified with a "SIC" code. I need to combine both datasets together.
Hence, I've created an ID code (called sicyear), which combines the SIC code with the year in question. For instance if a company has a SIC code that equals 8000 and the year in question is 2006, then the ID code would be 80002006. These ID codes are not unique.
My problem is that when I run my to do file I always get a different number of arrays for the combined data. And I just can't understand why.
Here are the five first lines from my first dataset:
Here are the five first lines from my second dataset:
Does anyone have any idea why my results are always different when I rerun the do file?
Thank you very much for any help you can provide!
Aurele
I've been searching a lot around the internet but I haven't found how to solve my problem.
I have two datasets. Each dataset has a list of companies with balance sheet results for a given year. Each company is also part of a certain industry, which is identified with a "SIC" code. I need to combine both datasets together.
Hence, I've created an ID code (called sicyear), which combines the SIC code with the year in question. For instance if a company has a SIC code that equals 8000 and the year in question is 2006, then the ID code would be 80002006. These ID codes are not unique.
My problem is that when I run my to do file I always get a different number of arrays for the combined data. And I just can't understand why.
Here are the five first lines from my first dataset:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str6 gvkey double fyear str10 cusip str58 conm double(ceq csho prcc_f) str4 sic float(MV_equity BtMkt startyear) str8 sicyear "014790" 1998 "59001A102" "MERITAGE HOMES CORP" 72.279 5.335 12.1875 "1531" 65.02031 1.1116372 1998 "15311998" "142953" 2001 "609207105" "MONDELEZ INTERNATIONAL INC" 23478 1735 34.03 "2000" 59042.05 .3976488 2001 "20002001" "029942" 2004 "751028101" "RALCORP HOLDINGS INC" 444.2 29.389 36.1 "2000" 1060.9429 .4186842 2004 "20002004" "009777" 2003 "832696405" "SMUCKER (JM) CO" 1210.693 50.175 52.3 "2033" 2624.1526 .4613653 2003 "20332003" "063447" 2000 "401617105" "GUESS INC" 175.156 43.563 5.3125 "2330" 231.42844 .7568473 2000 "23302000"
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input str6 gvkey2 double fyear2 str10 cusip2 str58 conm2 double(ceq2 csho2 prcc_f2) str4 sic2 float(MV_equity2 BtMkt2) str8 sicyear "010802" 1980 "902740109" "UI GROUP INC" 48.954 2.236 14.625 "0100" 32.7015 1.4969956 "01001980" "001266" 1981 "016230104" "ALICO INC" 15.709 1.887 48.5 "0100" 91.5195 .17164648 "01001981" "002099" 1981 "073799108" "BEAR CREEK CORP" 28.162 1.9 15.25 "0100" 28.975 .9719414 "01001981" "002812" 1981 "256603101" "DOLE FOOD CO INC" 442.415 25.534 12.74999683 "0100" 325.5584 1.358942 "01001981" "005416" 1981 "404294100" "HS GROUP INC" 3.819 .293 11.5 "0100" 3.3695 1.1334026 "01001981"
Thank you very much for any help you can provide!
Aurele

Comment