Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Change my observations values in discrete returns stock

    Hi everyone. I'm a student and for my master's thesis, I have to analyse commodities shocks on a firm's returns. For that, I have imported on stata , stock prices of all US public company from 1995 to 2021. The problem is , I want to compute retuns of each company whitout generate a new varaiable ( because my dataset is counting almost 4,700 variables and the max variables accepted by stata 15.1 is 5,000) but I didn't succeed. I'm lost and I need your help because after, I want to do loop for doing my regression ( company's returns on stock market and commodities index). I took a capture of my dataset table and what I did when I tried to compute log_retuns. Thank you for you help !
    Click image for larger version

Name:	Capture logreturns.JPG
Views:	1
Size:	14.9 KB
ID:	1600256

    Click image for larger version

Name:	Capture data Usa1_new.JPG
Views:	1
Size:	187.3 KB
ID:	1600255

  • #2
    You will have no end of problems trying to work with the data in this wide layout. You need to reshape this into long layout. Once you do that, the calculation of a variable for the returns is very easy. It requires only one additional variable for all of the stocks and can be calculated in a single command with no explicit loops.

    Code:
    // GO TO LONG LAYOUT
    rename (AAPLO-GHC) price=
    reshape long price, i(DATES) j(stock) string
    
    //  DECLARE PANEL DATA
    xtset stock DATES
    
    //  CALCULATE RETURN
    gen return_pct = 100*(D1.price/L1.price) // SEE -help tsvarlist- FOR DETAILS
    Note: Because screenshots do not provide a way to import data into Stata to work with and test code, this code is untested. Beware of typos or other errors.

    In the -rename- command, you will have to change AAPLO-GHC to something that fully expresses all the stock variables in your data set, if that is not, in fact, already the full list.

    I have used the simple direct formula for return. The formula involving logarithms you show in your code is, a) only an approximation, and b) much more computationally intensive than the direct formula. I have no idea why anybody uses the log formula; it is all downside with no compensating upside. If you actually need the log of the return for your work, you can calculate that as a separate variable.

    And with the data now in long layout you will be all set to do your modeling: all of the panel data modeling commands in Stata require the data to be in long layout anyway.

    In the future, when showing data examples, please use the -dataex- command to do so. If you are running version 16 or a fully updated version 15.1 or 14.2, -dataex- is already part of your official Stata installation. If not, run -ssc install dataex- to get it. Either way, run -help dataex- to read the simple instructions for using it. -dataex- will save you time; it is easier and quicker than typing out tables. It includes complete information about aspects of the data that are often critical to answering your question but cannot be seen from tabular displays or screenshots. It also makes it possible for those who want to help you to create a faithful representation of your example to try out their code, which in turn makes it more likely that their answer will actually work in your data.
    Last edited by Clyde Schechter; 28 Mar 2021, 19:33.

    Comment


    • #3
      Dear Clyde Schechter, thank you so much for your help. I tried to run your code but it doesn't working. Let me explain step by step .

      My data look like this ( just dataex some variable not all but I have 4,969 )


      Code:
      * Example generated by -dataex-. To install: ssc install dataex
      clear
      input int DATES double(priceAAPLO priceMSFTO priceAMZNO priceGOOGLO priceFBO priceBRKa priceV priceJNJ priceWMT pricePG priceMA priceTSLAO priceUNH)
      12800  1.60714125   4.0390625 . . . 23750 .      13.75   10.75 15.691534375 . .      5.5
      12801 1.629462656  4.06640625 . . . 23150 .   13.71875  10.625 15.350414063 . . 5.515625
      12802 1.638391219     3.96875 . . . 23350 .     13.625 10.5625 15.288392188 . . 5.734375
      12803 1.522319906   3.8515625 . . . 23350 .     13.625  10.625 15.226370313 . .  5.71875
      12806 1.508927062  3.92578125 . . . 23050 .   13.96875   10.75    15.381425 . . 5.640625
      12807 1.486605656 3.875976875 . . . 23050 .   13.78125 10.8125 15.350414063 . . 5.609375
      12808 1.463726393    3.859375 . . . 23450 .    13.6875  10.875 15.567490625 . . 5.484375
      12809 1.410712875   3.7421875 . . . 23550 .   13.96875 10.9375   15.6295125 . . 5.484375
      12810 1.424105719   3.7421875 . . . 23700 .   14.28125   11.25 16.063665625 . .      5.5
      12813 1.433034281      3.6875 . . . 23900 .   14.40625  11.375 16.311753125 . .    5.875
      12814 1.441962844   3.7109375 . . . 24600 .   14.53125 11.4375 16.156698438 . .   6.0625
      12815 1.433034281   3.6953125 . . . 24850 .    14.1875   11.75 15.846589063 . .    6.125
      12816 1.486605656      3.6875 . . . 24455 .   14.21875  11.875 15.970632813 . .  5.96875
      12817 1.446427125   3.7578125 . . . 24300 .   14.34375      12   16.1256875 . . 6.171875
      12820 1.446427125   3.8046875 . . . 24450 .    14.4375 12.0625  16.49781875 . .   6.1875
      12821 1.457587828      3.8125 . . . 24600 .   14.46875      12 16.466807813 . . 6.109375
      12822 1.511159203   3.8671875 . . . 24825 .     14.375 12.0625 16.280742187 . .  6.15625
      12823 1.558034156   3.8671875 . . . 24550 .    14.1875 11.9375  16.24973125 . .        6
      12824 1.562498437       3.875 . . . 23800 .   14.28125 11.8125 16.218720313 . . 6.046875
      12827 1.562498437       3.875 . . . 22500 .   14.28125  11.875 16.342764063 . .  5.96875
      12828 1.533480609   3.8671875 . . . 21600 .      14.25 11.9375 16.187709375 . .  5.65625
      12829 1.520087766    3.796875 . . . 22950 .     14.125 11.9375 16.187709375 . . 5.578125
      12830 1.542409172   3.8046875 . . . 23000 .     14.125      12 16.218720313 . . 5.515625
      12831 1.517855625   3.7734375 . . . 23450 .   13.90625 11.8125 16.311753125 . .    5.375
      12835  1.46428425    3.734375 . . . 23405 .   13.96875  11.875 16.435796875 . . 5.234375
      12836 1.457587828     3.84375 . . . 23155 .    14.1875  11.875 16.311753125 . .   5.4375
      12837 1.435266422   3.8515625 . . . 22850 .      14.25  11.875  16.49781875 . . 5.359375
      12838  1.39285575    3.828125 . . . 22555 .   14.28125  11.875 16.559840625 . . 5.421875
      12841 1.366070062    3.859375 . . . 22325 .   14.21875 11.6875 16.466807813 . . 5.359375
      12842 1.410712875      3.9375 . . . 22275 .    14.1875  11.875  16.49781875 . .    5.375
      12843     1.42857    3.953125 . . . 22000 .   14.15625 12.1875 16.280742187 . . 5.515625
      12844     1.42857    3.984375 . . . 21900 .   14.53125 12.4375 16.404785938 . . 5.390625
      12845 1.437498562   3.9765625 . . . 22400 .    14.4375    12.5 16.404785938 . .    5.375
      12848 1.419641437  4.01953125 . . . 22150 .       14.5 12.1875  16.49781875 . . 5.296875
      12849 1.368302203 4.083984375 . . . 21800 .       14.5   12.25 16.218720313 . .   5.3125
      12850 1.412945016     4.28125 . . . 22150 .   14.53125   12.25 16.187709375 . .  5.34375
      12851 1.419641437   4.2421875 . . . 22100 .   14.53125  12.125    16.373775 . .  5.28125
      12852 1.410712875  4.28515625 . . . 22200 .      14.75  12.375 16.683884375 . .  5.34375
      12855 1.361605781      4.3125 . . . 22450 .    15.0625  12.375 16.683884375 . .  5.40625
      12856  1.24999875    4.484375 . . . 22200 .    15.0625 12.4375 17.025004688 . . 5.453125
      12857  1.24999875     4.40625 . . . 22200 .   15.34375 12.3125 17.087026563 . .   5.5625
      12858 1.258927312   4.3828125 . . . 22300 .   15.40625  12.375  16.99399375 . . 5.859375
      12859 1.254463031  4.37109375 . . . 22200 .     15.625 12.1875 17.211070313 . . 5.828125
      12862 1.258927312   4.4453125 . . . 22250 .       15.5 12.3125  17.24208125 . .  5.78125
      12863 1.294641562  4.40234375 . . . 22175 .    15.4375  12.125 17.211070313 . . 5.703125
      12864 1.359373641  4.43359375 . . . 22175 .     15.375  12.125 17.211070313 . .  5.71875
      12865 1.325891531    4.546875 . . . 22600 .   15.28125 12.0625   17.1180375 . . 5.703125
      12866 1.348212937   4.6171875 . . . 22575 .   15.46875 12.3125    17.366125 . . 5.796875
      12869 1.328123672      4.5625 . . . 22900 .   15.46875   12.25   17.1180375 . . 5.984375
      12870 1.227677344   4.6015625 . . . 22875 .    15.4375 12.4375 17.025004688 . . 6.078125
      12871 1.227677344    4.515625 . . . 22900 .         15   12.75  16.74590625 . . 6.046875
      12872 1.263391594   4.5078125 . . . 22900 .         15   12.75 16.652873438 . . 5.921875
      12873 1.258927312   4.4453125 . . . 22650 .     14.875 12.8125 16.435796875 . .  5.84375
      12876 1.267855875       4.375 . . . 22400 .     14.875      13    16.373775 . . 5.796875
      12877 1.209820219   4.3671875 . . . 22500 .   14.96875 12.9375 16.776917188 . . 5.796875
      12878 1.241070187   4.4140625 . . . 22480 . 14.9140625      13 16.807928125 . . 5.671875
      12879 1.312498687       4.375 . . . 22550 .    14.8125 12.6875 17.025004688 . .  5.59375
      12880 1.312498687   4.3515625 . . . 22600 .      14.75 12.5625 17.056015625 . .   5.6875
      12883 1.308034406  4.43359375 . . . 22450 .         15 12.6875 17.056015625 . . 5.609375
      12884 1.348212937   4.5078125 . . . 22550 .   15.03125 12.5625 16.714895313 . .  5.59375
      12885  1.39285575   4.4765625 . . . 22600 .   15.03125 12.4375 16.838939062 . .   5.6875
      12886 1.366070062     4.53125 . . . 22600 .   15.40625 12.6875     16.86995 . . 5.734375
      12890 1.370534344   4.8359375 . . . 22450 .     15.125 12.6875 16.528829688 . .    5.625
      12891 1.339284375    4.796875 . . . 22450 .   15.65625  12.625 16.838939062 . . 5.453125
      12892 1.299105844   4.7578125 . . . 22500 .    15.6875    12.5 16.838939062 . . 4.921875
      12893 1.343748656    4.703125 . . . 22500 .      15.75  12.375 17.025004688 . .  4.90625
      12894 1.397320031      4.6875 . . . 22500 .    15.8125   12.25 17.149048437 . . 5.046875
      12897  1.39285575    4.859375 . . . 22100 .         16 12.1875    17.366125 . . 4.828125
      12898 1.348212937           5 . . . 22000 .    15.9375  11.875     16.86995 . . 4.640625
      12899 1.366070062   4.9765625 . . . 22000 .   16.03125  11.875  16.99399375 . .  4.53125
      12900 1.352677219   4.9140625 . . . 21650 .   15.84375 11.9375 16.931971875 . . 4.671875
      12901 1.366070062    5.109375 . . . 21600 .      16.25  11.875 17.335114063 . .  4.53125
      12904 1.366070062   5.1328125 . . . 22200 .   16.21875    11.5 17.211070313 . .  4.59375
      12905 1.361605781  4.97265625 . . . 22950 .      16.25 11.5625 17.335114063 . . 4.796875
      12906 1.361605781   5.0546875 . . . 23175 .    16.4375   11.75   17.6142125 . . 4.734375
      12907 1.374998625     5.09375 . . . 22950 .   16.53125  11.875 17.645223438 . . 4.328125
      12908 1.388391469           5 . . . 22800 .     16.375      12 17.459157813 . .   4.4375
      12911 1.446427125   4.9921875 . . . 23050 .     16.625 11.9375 17.769267188 . .      4.5
      12912 1.473212812  4.98828125 . . . 22955 .     16.625   11.75 17.676234375 . . 4.578125
      12913 1.479909234    4.953125 . . . 23000 .   16.65625   11.75   17.6142125 . .  4.84375
      12914  1.46428425   5.0859375 . . . 23050 .     16.875 12.1875 17.552190625 . .    4.875
      12915 1.558034156    5.046875 . . . 22950 .    16.1875  12.625 17.211070313 . . 4.734375
      12918 1.558034156  5.08203125 . . . 22905 .   15.90625 12.8125 17.211070313 . . 4.796875
      12919 1.562498437   5.3046875 . . . 22855 .     15.875 12.5625 17.149048437 . .  4.78125
      12920    1.571427       5.375 . . . 22800 .    16.0625 12.4375   17.1180375 . . 4.859375
      12921 1.549105594   5.2890625 . . . 22800 .       15.5   12.25     16.86995 . . 4.828125
      12922 1.526784187   5.3359375 . . . 22750 .   15.65625  12.375     16.86995 . . 4.734375
      12925 1.575891281    5.453125 . . . 22850 .   15.90625 12.3125 17.056015625 . .   4.5625
      12926 1.566962719     5.53125 . . . 23000 .    16.1875  12.375 17.149048437 . .      4.5
      12927 1.553569875     5.46875 . . . 22950 .      16.25      12   17.1180375 . .   4.5625
      12928 1.549105594    5.578125 . . . 22850 .   16.21875 12.0625 17.428146875 . . 4.578125
      12929 1.524552047     5.46875 . . . 22850 .   16.03125  11.875 17.273092188 . . 4.515625
      12933   1.4999985      5.1875 . . . 22550 .   16.03125 11.9375 17.273092188 . . 4.578125
      12934 1.484373516  5.29296875 . . . 22700 .   16.53125 12.4375 17.831289063 . .  4.65625
      12935 1.506694922   5.2578125 . . . 22725 .     16.625  12.375   17.6142125 . . 4.734375
      12936 1.504462781   5.1953125 . . . 22600 .   16.46875 12.4375 17.428146875 . .  4.84375
      12939 1.553569875    5.296875 . . . 22500 .   16.46875 12.4375 17.397135937 . . 4.953125
      12940    1.571427   5.1953125 . . . 22500 .   16.59375  12.625 17.552190625 . . 4.921875
      12941 1.540177031        5.25 . . . 22600 .    16.5625 12.6875 17.521179688 . . 5.171875
      12942 1.533480609   5.2578125 . . . 22350 .   16.59375 12.5625 17.552190625 . . 5.203125
      end
      format %tdnn/dd/CCYY DATES



      I don't know why command "dataex" does not display observation value for the other variables...

      So as You can see, I did command

      Code:
      rename (AAPLO-GHC) price=
      Then when I want to run the command to go to long layout

      Code:
       
       reshape long price, i(DATES) j(stock) string

      I got this kind of output from stata " price<var> mismatch type". So I delete some of them because I got variable in string format label.


      But the code itself takes too much time to run as if it will never stop running. So I can't run properly the code above.

      This is a look at what I obtained from running this code line before clicking on the break button.

      Code:
      reshape long price, i(DATES) j(stock) string
      
      (note: j = A AA AACQUO AAGHPK AALO AAMEO AAN AAOIO AAONO AAP AAPLO AATVPK AAWWO AAXNO AB ABBVK ABC A
      > BCBO ABCPPK ABENUPK ABEOO ABG ABIOO ABM ABMCPK ABMDO ABMLPK ABMTPK ABT ABTIPK ABTXO ABUSO ABVCPK A
      > C ACA ACADO ACAMO ACANPK ACBDPK ACBIO ACBMPK ACCDO ACCOK ACELK ACERO ACFNPK ACHCO ACHVO ACI ACIAO 
      > ACIWO ACLSO ACM ACMBPK ACMRO ACMTAPK ACNBO ACORO ACRGuCD ACRSO ACRXO ACTGO ACU ADBEO ADDCPK ADESO 
      > ADILO ADIO ADKTPK ADM ADMAO ADMPO ADMSO ADMTPK ADOMPK ADPO ADPTO ADROO ADS ADSKO ADSWK ADT ADTNO A
      > DTXO ADUSO ADVCPK ADVMO ADXSO AE AEE AEGNO AEHRO AEISO AEL AEMDO AEO AEP AERGPK AERIO AEROPK AES A
      > ESEO AEYEO AEYO AFAPPK AFFUPK AFG AFI AFL AGCOK AGE AGENO AGFSO AGGLPK AGIOO AGLEO AGLYPK AGO_pb A
      > GR AGRIPPK AGRXO AGS AGSMPK AGTCO AGTXPK AGX AGYSO AHC AHCOO AHCPDPK AHPIO AI AIFSPK AIG AIKIO AIL
      > LPPK AIM AIMCO AIMTO AIN AINCK AINVO AIR AIRGO AIRIK AIRTO AIRTPO AIT AIZ AJG AJIAPK AJRDK AJXTO A
      > KAMO AKBAO AKCAO AKERO AKOMPK AKROO AKRXQPK AKTSO AKTXO AKUSO AKUuTO AL ALB ALBOO ALBYPK ALCOO ALD
      > SPK ALDXO ALE ALECO ALG ALGNO ALGTO ALIMO ALJJO ALK ALL ALLKO ALLMPK ALLNPK ALLOO ALLYK ALLY_paK A
      > LMCPK ALNAO ALNYO ALOTO ALPCPK ALPEPK ALPNO ALRMO ALRNO ALRSO ALRTPK ALSEPK ALSKO ALSNK ALTAO ALTG
      > K ALTMO ALTO ALTRO ALXNO ALXOO AM AMAGO AMALO AMARPK AMATO AMBAO AMBCK AMBKPK AMBKPPK AMBZPK AMC A
      > MCIO AMCTPK AMCXO AMDO AME AMEDO AMEHO AMENPK AMFCPK AMG AMGNO AMHCO AMHVPK AMK AMKRO AMN AMNBO AM
      > NFPK AMOTO AMP AMPEK AMPHO AMPYK AMRBO AMRCK AMRHO AMRKO AMRSO AMRXK AMS AMSCO AMSFO AMSWAO AMTBO 
      > AMTDO AMTIO AMTXO AMWDO AMWKPK AMZNO AN ANABO ANATO ANDAO ANDCPK ANDEO ANETK ANF ANFCPK ANGIO ANGO
      > O ANIKO ANIPO ANIXO ANSSO ANTMK ANVSK AOS AOSLO AP APAMK APAO APCXPK APD APDNO APEIO APENO APG APH
      >  APHEPK APLSO APLTO APO APOGO APPFO APPNO APPSO APQTPK APREO APRNK APRUPK APTLPK APTXO APVOO APXTO
      >  APYXO AQBO AQFHPK AQMSO AQSPPK AQSTO AQUAK AR ARA ARAVO ARAYO ARBVPK ARC ARCBO ARCCO ARCHK ARCTO 
      > ARDSO ARDXO ARECO ARESK ARGCPK ARHIPK ARHNPK ARKRO ARL ARLOK ARLPO ARMKK ARMPK ARNAO ARNCK AROCK A
      > ROWO ARPOO ARQTO ARTHPK ARTNAO ARTO ARTWO ARVNO ARW ARWRO ARYBUO ASB ASCSPK ASFIO ASGNK ASH ASIXK 
      > ASMBO ASPNK ASPUO ASPZPK ASRTO ASRVO ASRVPO ASTCO ASTEO ASTOPK ASURO ASYSO AT ATAOPK ATAXO ATCXO A
      > TDLNFF ATECO ATENK ATEXO ATGEK ATGNPK ATHXO ATI ATKRK ATLCO ATLOO ATMOPK ATNIO ATNMK ATNXO ATO ATO
      > MO ATOSO ATR ATRAO ATRCO ATRIO ATROO ATRSO ATSGO ATUSK ATVIO ATWTPK ATXIO AUBNO AUBO AUMNK AUSACD 
      > AUTOO AVA AVAVO AVBHPK AVCOO AVCTO AVD AVEOO AVGOO AVGRO AVHAX AVIDO AVLRK AVNSK AVNTK AVNWO AVROO
      >  AVTO AVTRK AVXLO AVY AVYAK AWHO AWI AWK AWR AWREO AWSMPK AX AXASO AXDXO AXGNO AXIMPK AXL AXLAO AX
      > NXO AXP AXR AXRXPK AXSMO AXTAK AXTIO AYAGPK AYI AYLAO AYROO AYTUO AYX AZEKK AZO AZPNO AZP_paTO AZR
      > XO AZZ AZZTO B BA BAC BAFIPK BAH BANCK BANDO BANFO BANFPO BANRO BAOBPK BASAPK BASIO BATLK BAX BAYK
      > PK BBBKPK BBBYO BBCPO BBDCK BBGIO BBIO BBIOO BBLGPK BBQO BBSIO BBW BBX BBY BC BCALPK BCBPO BCC BCD
      > AO BCEIK BCELO BCIIPK BCLIO BCMLO BCO BCORO BCOVO BCOWO BCPCO BCRXO BCSFK BCTFO BCWGPK BDC BDGEO B
      > DL BDSIO BDTXO BDX BE BEAMO BEATO BEBEPK BECNO BEENPK BELFAO BEN BENHPK BEOBPK BERKPK BERYK BFAMK 
      > BFCCPK BFCO BFGCPK BFINO BFNHPK BFSTO BFYTO BFb BG BGCPO BGFVO BGRPPK BGS BGSFK BH BHB BHE BHFO BH
      > LBK BHRBPK BHTGO BHVNK BHWBPK BICKO BICXPK BIELPK BIG BIIBO BILLK BIO BIOCO BIOLO BIOQPK BIPCK BIV
      > IPK BIXTPK BJ BJRIO BK BKCCO BKD BKE BKEPO BKH BKI BKNGO BKORPK BKR BKSCO BKTIK BKU BKUHPK BKUTPK 
      > BKXTO BKYIO BLBDO BLBXPK BLCKPK BLCMO BLD BLDRO BLFSO BLGOPK BLHKPK BLIO BLK BLKBO BLL BLLIPK BLMN
      > O BLNCPK BLNKO BLO BLPHO BLUEO BLYAX BMBNPK BMCHO BMI BMRAO BMRCO BMRGK BMRNO BMSNPK BMTCO BMTMPK 
      > BMY BNCCPK BNCMPK BNEDK BNETPK BNFTO BNGOO BNTTPK BOCHO BOH BOIDPK BOKFO BOKUL BOMHPK BOMNO BOOMO 
      > BOOTK BORTPK BOTJO BOX BOXLO BPFHO BPMCO BPMPK BPRNO BPSRPK BPT BPTHO BR BRBRK BRBSK BRBWPK BRC BR
      > EWO BRFHPK BRGCPK BRIDO BRKLO BRKRO BRKSO BRKa BRMKK BRMTPK BRO BRPAO BRPO BRREPK BRSFPK BRSTPK BR
      > YO BRZLPK BSBKO BSCAPK BSETO BSFCPK BSFOPK BSGMO BSHIPK BSIGK BSM BSNDPK BSPAPK BSQRO BSRRO BSTCO 
      > BSTGPK BSVNO BSX BTAIO BTIMPK BTN BTSCPK BTTRPK BTU BUDZPK BUI BUKSPK BURCAPK BURLK BUSEO BV BVFLP
      > K BW BWA BWBO BWENO BWFGO BWLa BWMYPK BWTLPK BWTXPK BWXTK BX BXC BXG BXNGPK BXRXO BXS BY BYD BYFCO
      >  BYLBPK BYNDO BYRNCD BYSIO BZH BZRDPK C CABAO CABOK CACAPK CACCO CACIK CACO CADEK CAG CAH CAI CAKE
      > O CAL CALAO CALBO CALMO CALXK CAMPO CANNPK CAPLK CAPPPK CAPRO CARAO CAREO CARGO CARO CARRK CARSK C
      > ARVO CASAO CASHO CASIO CASSO CASYO CAT CATBO CATCO CATIPK CATOK CATYO CAVRPK CAWWPK CBAFPK CBANO C
      > BAYO CBB CBBIPK CBCAPK CBCZPK CBDSPK CBFCPK CBFVO CBIOO CBKMPK CBKPPPK CBLIO CBMBO CBMGO CBNKO CBO
      > EK CBREK CBRLO CBSCPK CBSHO CBT CBTXO CBU CBWAPK CBYAAPK CBZ CC CCAPO CCAQPK CCBCPK CCBGO CCBO CCE
      > LPK CCF CCFCPK CCFNPK CCGNPK CCH_u CCK CCL CCLPO CCMPO CCNBPK CCNEO CCO CCOIO CCOMPK CCR CCRNO CCS
      >  CCURPK CCXIO CCXXK CCX_u CCYCDPK CCYYPK CCZ CDAYK CDE CDEVO CDJMPK CDKO CDLXO CDMOO CDNAO CDNSO C
      > DTXO CDWO CDXCO CDXSO CDZIO CE CECEO CEFCPK CEI CEIXK CELCO CELHO CELPK CEMIO CENTDH CENTO CENXO C
      > EQPK CERCO CERNO CERSO CETXO CETYPK CEV CEVAO CF CFBIO CFBKO CFBO CFFAO CFFIO CFFNO CFG CFINPK CFM
      > SO CFNBPK CFOKPK CFR CFRXO CFSTPK CFTNPK CFX CGBDO CGEIPK CGLOPK CGNXO CGO CGROO CGRWPK CHAPK CHAQ
      > K CHBHPK CHCIO CHCOO CHCRPK CHD CHDNO CHE CHEFO CHFSO CHGGK CHH CHKAQPK CHKRPK CHMAO CHMGO CHNGO C
      > HPMO CHRAK CHRSO CHRWO CHS CHSCPO CHTRO CHUCPK CHUYO CHWYK CHX CHZQPK CI CIA CIBHPK CIBNPK CIBYPK 
      > CIDMO CIENK CIICO CINFO CINRK CIR CISOPK CIT CIVBO CIWVPK CIX CIZNO CKH CKPTO CKX CL CLADPK CLARO 
      > CLBAX CLBKO CLBSO CLCD CLCIPK CLCSPK CLCTO CLDBO CLDRK CLDXO CLEVPK CLF CLFDO CLGXK CLH CLIRO CLMT
      > O CLNEO CLOKPK CLOWPK CLPEPK CLPTO CLR CLRBO CLROO CLSDO CLSIPK CLSKO CLSNO CLSUL CLUBO CLVSO CLW 
      > CLWAPK CLWYPK CLX CLXTO CMA CMBMO CMC CMCOO CMCSAO CMD CMEO CMG CMI CMLSO CMOTPK CMP CMRXO CMS CMS
      > _pb CMT CMTLO CMTVPK CMTXPK CMUVPK CMXCPK CMXXPK CNA CNAFPK CNBAPK CNBBPK CNBKAO CNBNPK CNBWPK CNB
      > XPK CNBZPK CNC CNCEO CNCGPK CNDTO CNFRO CNGOPK CNIGPK CNK CNLKPK CNMDK CNMFPK CNNBO CNNCPK CNNDPK 
      > CNNEK CNO CNOBO CNP CNR CNRDPK CNS CNSLO CNSPO CNSTO CNTYO CNWHFPK CNX CNXMK CNXNO COCPO CODAO COD
      > IK CODXO COF COFEPK COFSO COG COHNK COHRO COHUO COILDH COKEO COLBO COLLO COLMO COMMO COMSPK CONNO 
      > COO COOPO COP COREO CORTO COSMPK COSOPK COSTO COTYK COUPO COWNO CPAAO CPB CPE CPF CPHCO CPIXO CPK 
      > CPKAPK CPKFPK CPMV CPRTO CPRXO CPS CPSHO CPSIO CPSR_uK CPSSO CPSTO CPTAO CPTPPK CQCQPK CQP CR CRAI
      > O CRAWAPK CRBPO CRCQQPK CRCWPK CRDEPK CRDFO CRDb CREEO CREXO CRI CRISO CRK CRKNPK CRL CRM CRMDK CR
      > MTO CRMZPK CRNAX CRNCO CRNXO CROLPK CROXO CRS CRSAO CRSBPK CRT CRTGPK CRTXO CRUSO CRVLO CRVSO CRWD
      > O CRWEPK CRWSO CRY CRYOPK CRZYPK CSBBPK CSBRO CSCOO CSGPO CSGSO CSHXPK CSIIO CSL CSLTK CSODO CSOV 
      > CSPIO CSPRK CSSEO CSTIPK CSTLO CSTRO CSU CSV CSVIPK CSWCO CSWIO CSXO CTAAK CTASO CTA_pa CTB CTBIO 
      > CTDHPK CTEKK CTGO CTGOPK CTHRO CTIBO CTICO CTL CTLTK CTMXO CTO CTRAK CTRNO CTS CTSHO CTSOO CTUYPK 
      > CTVAK CTXRO CTXSO CUB CUBIK CUENPK CUEO CULLPK CULPK CUROK CURRPK CUSIPK CUTRO CVA CVBFO CVCOO CVC
      > YO CVEOK CVETO CVGIO CVGWO CVI CVLBPK CVLGO CVLTO CVLYO CVM CVNAK CVR CVS CVSIPK CVU CVVO CVX CW C
      > WBCO CWBKPK CWBRO CWEBTO CWENaK CWGLPK CWH CWPEPK CWSTO CWT CXDCO CXDOO CXITO CXO CYANO CYAPPK CYB
      > EO CYCAPK CYCCO CYCNO CYDYPK CYFLPK CYH CYRXO CYSMPK CYTKO CYTRPK CZBCPK CZBSPK CZBTPK CZFSPK CZNC
      > O CZNLPK CZRO CZWIO D DAIOO DAKTO DAL DAN DAR DAREO DBCPO DBD DBI DBINPK DBMGPK DBV DBXO DCI DCO D
      > COMO DCP DCPHO DCSICD DCTHO DD DDD DDLXPK DDOGO DDS DDT DE DECKK DECNPK DELLK DENNO DENRPK DFFNO D
      > FHTUO DFINK DFNSK DFPHO DFS DG DGICAO DGIIO DGLYO DGOCL DGX DHI DHILO DHR DHX DIMCPK DIN DIODO DIS
      >  DISCAO DISHO DIT DIXIuCD DJCOO DK DKL DKMRPK DKNGO DKS DLA DLB DLHCO DLMVPK DLPNO DLTHO DLTIPK DL
      > TRO DLX DMACO DMFGPK DMKBAPK DMLPO DMPIO DMRCO DMS DMTKO DMYTK DNB DNJRO DNKNO DNLIO DNOWK DNR DOC
      > UO DOFSQPK DOMOO DOORK DORMO DOV DOW DOXO DP DPHCO DPSIPK DPW DPZ DRADO DRI DRNAO DRQ DRRXO DRVDPK
      >  DSI DSKEO DSOLPK DSPGO DSS DSSIK DT DTE DTILO DTRCPK DTRKPK DTRLPK DTSTPK DUK DUOTO DVA DVAXO DVC
      > RPK DVD DVLNPK DVN DVYO DWNXPK DWSNO DXC DXCMO DXLGO DXPEO DXR DXYNO DY DYAIO DYNEPK DYNRPK DYNTO 
      > DYSLPK DZSIO EACOPK EAF EAO EASTO EAT EAWDPK EB EBAYO EBF EBIXO EBMTO EBS EBSBO EBTCO ECC ECHOO EC
      > L ECOLO ECOMK ECORO ECPGO ECRDPK ECSLPK ECXJPK ED EDITO EDNTO EDUCO EDXCPK EE EEFTO EEX EFA EFBIPK
      >  EFOIO EFRTO EFSCO EFSIPK EFX EGANO EGBNO EGDWPK EGHTK EGLEO EGOVO EGRXO EGY EHC EHTHO EIDXO EIG E
      > IGIO EIGRO EIX EKGRUPK EKSOO EL ELA ELANK ELCQPK ELF ELGLPK ELIOPK ELLHPK ELMAPK ELMDK ELOXO ELSEO
      >  ELTPPK ELVGPK ELVTK ELY EMANK EMBIPK EMCFO EME EMGCPK EMISPK EMKRO EMLO EMMAPK EMMSPK EMN EMO EMO
      > RPK EMPKPK EMPMPK EMQUPK EMR EMYBPK ENBLK ENBPPK ENGO ENGTPK ENLCK ENO ENOBO ENPHO ENR ENS ENSGO E
      > NSVK ENTAO ENTGO ENTO ENV ENVAK ENZ EOG EOLSO EPACK EPAMK EPAYO EPAZPK EPC EPD EPM EPP EPSNO EPZMO
      >  EP_pc EQBKO EQFNPK EQH EQO EQS EQT ERBAPK ERIEO ERIIO ERKHPK ES ESBKO ESBSPK ESCAO ESE ESGIPK ESI
      >  ESOAPK ESP ESPRO ESQO ESSAO ESTEK ESXBO ET ETCGPK ETFCO ETH ETM ETNBO ETONO ETR ETRNK ETSYO ETTXO
      >  EV EVA EVBGO EVBNK EVC EVERO EVFMO EVH EVI EVLOO EVOAPK EVOKO EVOLO EVOPO EVR EVRCPK EVRGK EVRIK 
      > EVSIO EW EWA EWBCO EWH EWJ EWLUPK EWT EXASO EXCEPK EXCO EXELO EXEOPK EXI EXLSO EXP EXPCO EXPDO EXP
      > EO EXPIO EXPOO EXPRK EXSRPK EXTNK EXTRO EYEGO EYENO EYEO EYESO EYPTO EZPWO EZT F FABPPK FACOPK FAF
      >  FALCPK FAMEPK FANGO FARMO FAROO FASTO FATEO FATO FBAKPK FBC FBHSK FBIOO FBIPPK FBIZO FBK FBM FBMS
      > O FBNCO FBO FBPAPK FBPIPK FBRXO FBSIPK FBSSO FBTTPK FBVAPK FBVIPK FC FCAPO FCBCO FCBPO FCCGPK FCCO
      > O FCCTPK FCCYO FCELO FCF FCFSO FCITPK FCN FCNCAO FCNEPK FCOBPK FCUVPK FCX FDBCO FDBHPK FDCTPK FDIT
      > PK FDLBPK FDP FDS FDUSO FDVAPK FDX FE FEACK FEIMO FELEO FENCO FET FETMPK FEYEO FF FFBCO FFBWO FFDF
      > PK FFG FFICO FFINO FFIVO FFMHPK FFMRPK FFNWO FFWCPK FFWMO FGBIO FGCOPK FGENO FGFHPK FGNVPK FGPRPK 
      > FHBO FHI FHLBPK FHN FHRTPK FIBKO FICOK FINNPK FIS FISBPK FISIO FISVO FIT FITBO FIVEO FIVNO FIX FIX
      > XO FIZNPK FIZZO FKWLPK FKYSPK FL FLDMO FLFGPK FLGTO FLICO FLIRO FLLO FLMNO FLNTO FLO FLOWK FLR FLS
      >  FLT FLUXPK FLWSO FLXNO FLXSO FMAOO FMBHO FMBIO FMBLPK FMBMPK FMBNPK FMC FMCBPK FMCCPK FMCIUO FMFG
      > PK FMFPPK FMHSPK FMNBO FMOOPK FMPRPK FMTXO FNB FNBTPK FNCBO FND FNF FNFIPK FNGRPK FNHCO FNHMPK FNJ
      > NO FNKOO FNLCO FNMAPK FNRNPK FNSBPK FNWBO FOCSO FOE FOLDO FONRO FOR FORDO FORMO FORRO FOSIPK FOSLO
      >  FOTBPK FOURK FOXAO FOXFO FPACK FPAYO FPCGPK FPH FPRXO FPWMPK FRAFO FRANO FRBAO FRBKO FRC FRD FREE
      > O FREQO FRFCPK FRGIO FRGO FRHCO FRMEO FRMOPK FRPHO FRPTO FRSBPK FRTAO FRTGPK FRTNPK FSB FSBWO FSCT
      > O FSEAO FSFGO FSK FSKRK FSLRO FSLYK FSRLPK FSRVO FSS FSTRO FSWAPK FTACO FTAIK FTCSO FTCXPK FTDRO F
      > TEKO FTK FTLFPK FTNTO FTNWK FTRCQPK FTSIK FTV FUBOPK FUL FULCO FULTO FUN FUNCO FUSBO FUSE_uK FUVO 
      > FVACK FVCBO FVEO FWAVPK FWONAO FWRDO FXLGPK FXNCO GABCO GADSPK GAIAO GAINO GALTO GAMOOL GANSPK GAR
      > SO GATXK GBCIO GBDCO GBENPK GBIOO GBL GBLXPK GBR GBTO GBX GCAPK GCBCO GCEHPK GCEIPK GCI GCO GCP GC
      > TYPK GD GDDYK GDENO GDLCPK GDMKPK GDOTK GDP GDSIPK GDVTZPK GDYNO GE GECCO GECO GEF GEGRPK GEL GEN 
      > GENCO GEOSO GERNO GES GEVOO GFEDO GFF GFGYPK GFNLPK GFNO GGG GGLTPK GGROUPK GHC GHIVO GHL GHM GHMP
      > PK GHO GHSIO GIFIO GIGAPK GIIIO GIK GILDO GIS GIX GJH GKOSK GL GLADO GLBZO GLDDO GLDXV GLEOK GLGIP
      > K GLIBAO GLP GLPTPK GLT GLUCPK GLUUO GLW GLXYTO GLXZPK GLYCO GM GME GMEDK GMGIDPK GMHIUO GMO GMS G
      > NBFPK GNBTPK GNCAO GNCIQPK GNE GNK GNLNO GNMKO GNPXO GNRCK GNRSO GNRVPK GNSSO GNTXO GNTYO GNUSO GN
      > W GOCOO GOGOO GOLFK GOO GOOGLO GOOOPK GOROK GOSSO GOVBPK GOVXPK GPC GPFTPK GPGCPK GPI GPJAK GPK GP
      > N GPORO GPPO GPREO GPROO GPS GPX GRA GRAFK GRBKO GRBXPK GRC GRCKPK GRIFO GRILO GRLBPK GRMMPK GRNFP
      > K GROWO GRPNO GRRBPK GRTDPK GRTSO GRTXO GRUBK GRWCPK GRWGO GRYNPK GRZV GS GSAH_uK GSATK GSB GSBCO 
      > GSBDK GSHDO GSITO GSKYO GSPEPK GSTXPK GTATPK GTBPPK GTESK GTGTPK GTHXO GTIICD GTIMO GTLSO GTN GTO 
      > GTPSPK GTT GTYHO GUAAPK GV GVA GVFFPK GVI GVPO GVYBPK GWB GWGHO GWHPPK GWOXPK GWPDPK GWREK GWRSO G
      > WSOPK GWTIPK GWW GXGXO GYROO GZCCPK H HAE HAFCO HAINO HAL HALLO HALOO HAO HARLPK HARPO HARVCD HASO
      >  HAYNO HBANO HBB HBCPO HBI HBIAPK HBIOO HBMDO HBNCO HBPO HBSIPK HBTO HCA HCACO HCAPO HCATO HCBCPK 
      > HCC HCCHO HCCIO HCCOO HCGIPK HCHCK HCI HCKTO HCSGO HD HDIIPK HDSNO HDSO HE HEARO HECCUO HEESO HEI 
      > HEMPPK HENCPK HEOLPK HEP HEPAO HES HESMK HEWAPK HFBAPK HFBKPK HFBLO HFC HFFGO HFUSPK HFWAO HGBLPK 
      > HGENPK HGV HHC HHGIPK HI HIBBO HIFSO HIG HIGRPK HII HIL HITCPK HJLIO HK HKBTPK HL HLANPK HLBYLPK H
      > LFNPK HLI HLIOO HLITO HLIXPK HLM_p HLNEO HLOCPK HLT HLX HLYKPK HMHCO HMLNPK HMMRPK HMN HMNFO HMNUP
      > K HMSTO HMSYO HMTVO HNFSAPK HNGRK HNI HNNAO HNRGO HOFTO HOFVO HOG HOLXO HOMBO HOMEK HON HONEO HONT
      > PK HOOBPK HOOKO HOPEO HOTHO HOV HP HPE HPMMDPK HPQ HPR HPTNPK HPX_u HQDAPK HQIO HQYO HRB HRC HRGGP
      > K HRI HRL HROWO HRSTPK HRTGK HRTHPK HRTXO HRZNO HSC HSDTO HSENPK HSICO HSIIO HSKAO HSONO HSTAPK HS
      > TIPK HSTMO HSTOO HSY HTBIO HTBKO HTBXO HTGCK HTGMO HTH HTLDO HTLFO HTLV HTZ HUBBK HUBGO HUBSK HUBV
      > PK HUD HUM HUN HURCO HURNO HUSAK HVBCO HVLMPK HVT HWALPK HWBKO HWCCO HWCO HWINPK HWKNO HWM HXL HXO
      > HPK HY HYACO HYDIPK HYMCO HYREO HYSRPK HZN HZO IAA IACO IAK IARTO IAT IBCPO IBIOK IBKRO IBM IBOCO 
      > IBP IBTNPK IBTXO IBWCPK ICADO ICBKO ICCCO ICCHO ICCTPK ICD ICE ICFIO ICHRO ICMBO ICNBPK ICONO ICPT
      > O ICTPUPK ICUIO IDA IDCCO IDEXO IDNDPK IDNO IDRAO IDT IDTYPK IDV IDWMPK IDXGO IDXXO IDYAO IEAO IEC
      > O IEHCPK IEIO IEPO IESCO IEX IFBHPK IFF IFMKO IGC IGFO IGMSO IGN IGOVO IGV IHC IHF IHRTO IIINO III
      > O IIIVO IINO IIVIO ILALPK ILF ILMNO IMACO IMBIO IMGNO IMH IMHCPK IMKTAO IMMRO IMMUO IMPTO IMRAO IM
      > RAX IMTXO IMVTO IMXIO INBKO INBPPK INCYO INDBO INDSCD INFIO INFNO INFTPK INFUK INGNO INGRK INISPK 
      > INLBPK INMBO INODO INOO INOVO INPXO INRDPK INS INSEO INSGO INSMO INSPK INSUO INSWK INT INTCO INTGO
      >  INTIPK INTTK INTUO INTZPK INUVK INVAO INVEO INVOPK INVUPK INWKO IO IOFBPK IOMV IONSO IOR IOSPO IO
      > TCPK IOVAO IP IPARO IPDNO IPG IPGPO IPHIK IPI IPIXPK IPLDPO IPOBK IPOCK IPV IPWLGPK IPWRO IQV IR I
      > RBTO IRDMO IRIXO IRMDO IROQO IRTCO IRWDO ISBAPK ISBCO ISDRK ISEEO ISHGO ISIGO ISNSO ISR ISRGO ISSC
      > O ISTRO IT ITCIO ITGRK ITICO ITIO ITMCPK ITRIO ITROPK ITT ITUPPK ITW IVACO IVC IVDAPK IVDNPK IVFHP
      > K IVSTPK IVV IVZ IWBBPK IWC IWL IWM IWSYPK IWX IWY IXG IXJ IYK IZEAO J JACKO JAGXO JAKKO JAX JBHTO
      >  JBK JBL JBLUO JBSSO JBT JC JCOMO JCPNQPK JCSO JCTCFO JDVBPK JEF JELDK JETV JFBCPK JFWVPK JG JIH J
      > ILLK JJSFO JKHYO JKROPK JKSMPK JLL JMDAPK JMP JMPNLO JMSBPK JNCEO JNESPK JNJ JNPRK JOB JOE JOUTO J
      > PM JRSHO JSDAPK JTBKPK JUVFPK JVAO JWN JWS JWa JYNTO JZZIPK K KAI KALAO KALUO KALVO KAMNK KANPPK K
      > AR KAVLPK KBALO KBE KBH KBKCPPK KBLBPK KBLMUO KBPHPK KBR KCAC_uK KCLIPK KDMNK KDP KEGXPK KELYAO KE
      > O KEQUO KERNO KEWLPK KEX KEY KEYSK KFFBO KFRCO KFS KFY KGKGPK KHCO KIDSO KINO KINSO KIRKO KISBPK K
      > ITLPK KKR KLACO KLDIPK KLDOO KLFEPK KLIBPK KLXEO KLYV KMB KMI KMPHPK KMPRK KMT KMX KN KNITPK KNL K
      > NOSPK KNSLO KNWNPK KNX KO KODKK KODO KOP KOPNO KOS KOSSO KPTIO KQ KR KRA KRMDO KRNYO KRO KROSO KRP
      >  KRTXO KRUSO KRYSO KSBIPK KSHBPK KSIHPK KSS KSU KTB KTBAPK KTCCO KTH KTHNPK KTN KTOSO KTYBPK KULRP
      > K KURAO KVHIO KW KWR KYZNPK KZRO L LAABPK LAACZPK LACQO LAD LAKEO LAKFPK LANCO LARKO LASRO LATNO L
      > AURO LAWSO LAZYO LB LBAIO LBAOPK LBCO LBJ LBRDAO LBRTK LC LCAHUO LCI LCIIK LCNBO LCNTUPK LCTXK LCU
      > TO LDKBPK LDL LDOSK LEA LEAFK LECOO LEE LEG LEGHO LEGNO LEN LEO LEONPK LEU LEVIK LEVLO LFACUO LFGP
      > PK LFINPK LFUSO LFVNO LGC_u LGFa LGHLO LGIHO LGL LGMHPK LGNCPK LGNDO LGVW_uK LH LHCGO LHX LIBCPK L
      > ICTPK LIFEO LII LILAO LINCO LINDO LINKPK LITEO LIVEO LIVXO LIXTPK LJPCO LKCRUPK LKFNO LKQO LL LLNW
      > O LLY LM LMATO LMBO LMEAX LMNDK LMNRO LMNXO LMPXO LMRKO LMSTO LMT LNC LNDCO LNG LNN LNTHO LNTO LOA
      > KK LOBO LOCOO LODEK LOGCO LOGMO LOGNPK LONEO LOPEO LORLO LOVEO LOW LPBCPK LPCNO LPG LPI LPLAO LPRO
      > O LPSNO LPTHO LPTVPK LPTXO LPX LQDAO LQDTO LQMTPK LQWCPK LRCXO LRMRO LRN LSACO LSBKO LSCCO LSCGPK 
      > LSFGPK LSTRO LSYNPK LTBRO LTHMK LTRNO LTRPAO LTRXO LTSYPK LTUMPK LTUUPK LUB LUMOO LUNAO LUV LUVUPK
      >  LVGOO LVS LVVVPK LW LWAYO LWLGPK LXAMPK LXGV LXRXO LXU LYB LYBCPK LYFTO LYRAO LYTSO LYV LZB M MA 
      > MAALPK MACEPK MACKO MAINK MAJJPK MAKEPK MAN MANHO MANTO MARAO MARKO MARO MAS MASIO MATNPK MATO MAT
      > WO MATXK MAXRK MAYSO MBCNO MBI MBIIO MBINO MBIOO MBLUPK MBOTO MBRXO MBUUO MBWMO MC MCACUO MCB MCBC
      > O MCBIPK MCBKPK MCBSO MCC MCCKPK MCD MCEMPK MCEPO MCF MCFTO MCHBPK MCHPO MCHXO MCIMPK MCK MCMJO MC
      > O MCRAAPK MCRBO MCRIO MCS MCY MD MDBO MDC MDCAO MDGLO MDIAO MDLAK MDLYK MDLZO MDP MDRXO MDU MDVTPK
      >  MDWTPK MDXGPK MDXLPK MEC MED MEDHPK MEDPO MEDSO MEECPK MEETO MEI MEIPO MESAO MET METCO MFAC_uK MF
      > DBPK MFGIPK MFINO MFNCO MFONPK MG MGAGPK MGEEO MGENO MGIO MGLNO MGM MGNIO MGNXO MGOMPK MGPIO MGRCO
      >  MGTAO MGTXO MGY MGYRO MHGUPK MHH MHK MHO MHPCPK MIC MICTO MIDDO MIFFPK MIKO MINDO MINTO MIRMO MIT
      > KO MJCOO MJHIPK MJNAPK MKC MKGIO MKL MKROPK MKSIO MKTXO ML MLABO MLGFPK MLHRO MLI MLM MLNDO MLP ML
      > R MLSSK MLVFO MMACO MMC MMDWA MMENCD MMI MMLPO MMM MMMBPK MMNDPK MMP MMS MMSIO MMTRSPK MN MNATPK M
      > NBOPK MNBPPK MNCLUO MNKDO MNLOO MNMBPK MNOVO MNPRO MNRLK MNROO MNSBO MNSTO MNTAO MNTXO MO MOBLO MO
      > BQPK MOD MODNK MOFGO MOGa MOH MORFO MORNO MOS MOSTPK MOTSO MOV MPAAO MPADPK MPBO MPC MPIRPK MPLXK 
      > MPWRO MPX MR MRAMO MRBKO MRC MRCCO MRCYO MRGEPK MRINO MRK MRKRO MRLNO MRMDPK MRNAO MRNSO MRO MRSNO
      >  MRTNO MRTXO MRZMPK MS MSA MSB MSBCPK MSBIO MSCIK MSEXO MSFTO MSGEK MSGNK MSGSK MSI MSM MSN MSONO 
      > MSTRO MSVBO MTB MTBCO MTCHO MTD MTDRK MTEMO MTEXO MTG MTH MTLQUPK MTN MTNBK MTORK MTR MTRNK MTRXO 
      > MTSCO MTSIO MTW MTX MTZ MU MUELPK MUO MUR MUSAK MVBFO MVC MVENPK MVISO MVLYPK MVO MVPTPK MWA MWKO 
      > MXCTL MXI MXIMO MXL MYBFPK MYE MYFWO MYGNO MYO MYOKO MYOSO MYRGO MYXML NACBPK NAIIO NANXPK NARIO N
      > ASBPK NATHO NATIO NATRO NAV NAVBK NAVIO NBEVO NBGVPK NBHCK NBIXO NBLO NBLXO NBNO NBSEO NBTBO NBTO 
      > NBVAV NBY NC NCBSO NCLHK NCMIO NCNOO NCR NCRAPK NCSMO NDAQO NDLSO NDRAO NDSNO NDVNPK NECBPK NEE NE
      > E_pi NEFBPK NEM NEN NEOGO NEOO NEOSO NEP NEPHO NERVO NES NESRO NET NETEO NEU NEWRK NEWTO NEX NEXTO
      >  NFBKO NFEO NFG NFINO NFJ NFLXO NGHCO NGL NGLS_paK NGMO NGS NGTFPK NGVCK NGVTK NHC NHLDO NHO NI NI
      > CKO NICRLPK NIDBPK NIHLPK NINEK NJMCPK NJR NKE NKLAO NKO NKSHO NKTRO NKTXO NL NLOKO NLS NLSNK NLST
      > PK NLTXO NMFCK NMGXPK NMIHO NMK_pb NMRDO NMRKO NMTCPK NMTRO NNBRO NNI NNUPPK NNUTUPK NNVCK NOBHPK 
      > NOC NODBPK NODKO NOG NOV NOVAK NOVNO NOVSO NOVTO NOW NP NPAO NPK NPO NPTNK NR NRBOO NRCO NREFK NRG
      >  NRGXK NRIMO NRP NS NSAROPK NSC NSCOK NSECO NSITO NSP NSSCO NSTGO NSYCPK NSYSO NTAPO NTCTO NTGRO N
      > TICO NTIPK NTLAO NTNXO NTRAO NTRBPK NTRPO NTRSO NTUSO NTWKO NUANO NUBCPK NUE NUGSPK NUKKPK NUMDPK 
      > NUNZPK NUS NUVAO NUVRPK NUZEO NV NVAXO NVDAO NVECO NVEEO NVFYO NVIVO NVNTPK NVOSPK NVR NVROK NVSTK
      >  NVTAK NVUSO NWBBPK NWBIO NWBOPK NWE NWFLO NWHMK NWINPK NWLIO NWLO NWN NWPPPK NWPXO NWSAO NWYFPK N
      > WYUPK NX NXGNO NXSTO NXTCO NXTDO NXTNPK NYCBK NYCB_puK NYT NZ OAC OASO OBCIO OBLGK OBNKO OBTXPK OC
      >  OCBIPK OCCO OCFCO OCGNO OCN OCSIO OCSLO OCULO OCX ODC ODFLO ODPO ODTO OEGO OESXO OFEDO OFIXO OFL
      
      .....
      > NO ZSO ZTS ZUMZO ZUO ZVOO ZYJTPK ZYNEO ZYXIO)
      
      --Break--
      r(1);
      So I'm stuck at this stage.....




      Comment


      • #4
        OK. So the first thing is that any of those price variables that are strings need to be changed to numeric. The -destring- command will enable you to do that.

        Code:
        ds price*, has(type string)
        destring `r(varlist)', replace
        Now, pay attention to the output. There may be some of those variables that Stata is unable to convert to numeric because they contain non-numeric content. So for any such variables you will have to explore what the offending values are and deal with them in some way. Common problems are the inclusion of "values" like "N/A" or "> 1000" or things like that. You will have to make decisions as to what to do with things like that, and then after removing all non-numeric content, finish -destring-ing them.

        The -reshape long- command can be very time consuming. There is a user-written version, -tolong- which you can install from SSC. It is much faster. The syntax for it is almost the same. In your case it will be
        Code:
        tolong price@, i(DATES) j(stock)
        and you should be good to go from there.

        Comment


        • #5
          Noted in edit: Crossed with Clyde's more complete advice in post #4.

          Perhaps one of the following community-contributed packages that implement faster versions of the reshape command will help.
          Code:
          view net describe gtools, from(http://fmwww.bc.edu/RePEc/bocode/g)
          view net describe sreshape, from(http://homepages.rpi.edu/~simonk/stata)
          view net describe fastreshape, from(http://fmwww.bc.edu/RePEc/bocode/f)
          I would suggest that you evaluate reshape and its alternatives by creating a test dataset keeping only the first 100 stocks so you can get some sort of feeling for how long reshaping is likely to take with each of the packages as well as with Stata's reshape command.
          Last edited by William Lisowski; 29 Mar 2021, 11:10.

          Comment


          • #6
            Dear Clyde Schechter and William Lisowski thank you so much for your help. I make real progress in my study.

            I could install the tolong command and it's much better. Now I got my data in a long shape layout.

            Code:
            * Example generated by -dataex-. To install: ssc install dataex
            clear
            input int DATES str8 stock float price
            12800 "A"               .
            12800 "AA"              .
            12800 "AABBPK"          .
            12800 "AACHPK"          .
            12800 "AACQUO"          .
            12800 "AACSPK"          .
            12800 "AAGCPK"          .
            12800 "AAGHPK"          .
            12800 "AAIIQPK"      8.25
            12800 "AALO"            .
            12800 "AAMEO"     1.98969
            12800 "AAN"         13.25
            12800 "AAOIO"           .
            12800 "AAONO"   1.0973839
            12800 "AAP"             .
            12800 "AAPLO"   1.6071413
            12800 "AASLPK"          .
            12800 "AASPPK"        4.5
            12800 "AATVPK"          .
            12800 "AAWCPK"          .
            12800 "AAWWO"           .
            12800 "AAXNO"           .
            12800 "AB"         9.3125
            12800 "ABBBPK"          .
            12800 "ABBVK"           .
            12800 "ABBYPK"          .
            12800 "ABC"             .
            12800 "ABCBO"    4.964552
            12800 "ABCEPK"          .
            12800 "ABCPPK"         .2
            12800 "ABENUPK"         .
            12800 "ABEOO"      165000
            12800 "ABG"             .
            12800 "ABIOO"           .
            12800 "ABLEPK"          .
            12800 "ABLTPK"       3450
            12800 "ABM"         5.625
            12800 "ABMCPK"        .13
            12800 "ABMDO"     2.78125
            12800 "ABMLPK"          .
            12800 "ABMTPK"          .
            12800 "ABPRPK"          .
            12800 "ABT"      7.216563
            12800 "ABTIPK"          .
            12800 "ABTOPK"          .
            12800 "ABTXO"           .
            12800 "ABUSO"           .
            12800 "ABVCPK"          .
            12800 "ABVGPK"          .
            12800 "ABWNPK"          .
            12800 "ABZTPK"          .
            12800 "AC"              .
            12800 "ACA"             .
            12800 "ACADO"           .
            12800 "ACAMO"           .
            12800 "ACANPK"          .
            12800 "ACBCQPK"         .
            12800 "ACBDPK"          .
            12800 "ACBIO"           .
            12800 "ACBMPK"          .
            12800 "ACCAPK"          .
            12800 "ACCDO"           .
            12800 "ACCOK"           .
            12800 "ACCRPK"          .
            12800 "ACELK"           .
            12800 "ACERO"           .
            12800 "ACEZPK"          .
            12800 "ACFLPK"          .
            12800 "ACFNPK"      5.125
            12800 "ACGIPK"          .
            12800 "ACGJPK"       52.5
            12800 "ACHCO"           .
            12800 "ACHVO"           .
            12800 "ACI"             .
            12800 "ACIAO"           .
            12800 "ACIWO"           .
            12800 "ACLSO"           .
            12800 "ACM"             .
            12800 "ACMBPK"          .
            12800 "ACMRO"           .
            12800 "ACMTAPK"     9.375
            12800 "ACNBO"    14.73923
            12800 "ACNIPK"          .
            12800 "ACNVPK"          .
            12800 "ACORO"           .
            12800 "ACRGuCD"         .
            12800 "ACRLPK"          .
            12800 "ACRSO"           .
            12800 "ACRXO"           .
            12800 "ACTGO"           .
            12800 "ACTLPK"          .
            12800 "ACU"         3.375
            12800 "ACURPK"          .
            12800 "ACY"             .
            12800 "ADBEO"      4.0625
            12800 "ADBNPK"          .
            12800 "ADDCPK"          .
            12800 "ADECPK"          .
            12800 "ADESO"           .
            12800 "ADFSPK"          .
            end
            format %tdnn/dd/CCYY DATES
            But right now I facing # 4 main problems.I tried on my own to solve them by doing some research and testing code lines....without real success...

            #1 I want to delete some variables( company) because I don't have prices for these company before the 1995-2000 period. I know I have to use bysort command like

            [
            CODE]


            By stok year, sort: drop if : ...... // I don't know the next instruction

            [/CODE]





            #2 I can't run correctly this following code
            Code:
            //  DECLARE PANEL DATA
            xtset stock DATES
            
            
            stata output: .
            
            xtset stock DATES
            string variables not allowed in varlist;
            stock is a string variable
            r(109);
            So I tried this code :

            Code:
            encode stock , gen(stock1)
            drop stock
            rename stock1 stock
            
            xtset DATES stock

            But the problem is that all my company names changed . Impossible to recognize which company it is...

            So I tried with destring command but nothing work

            #3 I tried to compute discrete returns thanks to your code
            Code:
            //  CALCULATE RETURN
            gen return_pct = 100*(D1.price/L1.price) // SEE -help tsvarlist- FOR DETAILS
            => So this line compute (Pt-Pt-1/Pt)


            // But in fact I want to compute Pt+1 -Pt/Pt . So Is that line code correct?

            Code:
            gen return_pct = 100*(F.Price-Price/Price)

            #4 My big issue is that I have to regress during all the period my stocks on market stock and commodities index like this below and save my estimated betas coefficients for each firm :

            regress varlist_stock S&P500 Comod_1 Comod_2 ...

            So I thought about my code and I came with this one :

            Code:
            
            Foreach var of stock _all {
            
            reg 'var' S&P500 Comod_1 Comod_2...
            gen matbeta_'var'= _b[ S&P500 ]   b[ Comod_1 ]  b[ Comod_2 ] ..
            
            }


            Thank you in advance for the time your take in answering me.

            Comment


            • #7
              Question #1:
              Code:
              by stock (DATES), sort: egen has_before_1995 = max(year(DATES) < 1995 & !missing(price))
              drop if !has_before_1995
              Note: Your example data has all observations on a single date in 1995, so applied to your example, it leaves an empty data set. But it should do what you are asking for in the full data set you have.

              Questoin #2: I don't know what you're talking about. The stock names do not change with that code. I ran the code with your example data, and the stock names are still visible as before. You must be doing something different. Please show an example of data that reproduces the problem you are having, along with the exact code, not edited in any way, that produces the problem.

              That said, what you need to do is -xtset stock DATES-, not -xtset DATES stock-. The panel variable comes first, and the time variable last.

              Question #3: That's not quite correct. It should be:
              Code:
              gen return_pct = 100*(F.Price-Price)/Price // NOTE THE LOCATION OF THE PARENTHESES
              Question #4: This is way off base. First of all, your data are in long layout, so the different stocks are no longer separate variables. There is one variable called stock, whose values are what used to be the names of your stock variables. So you have to run the regressions on blocks of observations characterized by the values of the variable called stock, not loop over different variables. Then your -gen- command is incompatible with Stata syntax. It seems you want to create a matrix: -gen- does not do that. But creating a matrix is probably not a good idea anyway. It will almost surely prove more useful to have variables created in the data set that contain the values of the coefficients of each of the predictors in the regression. The simplest way to do this is:

              Code:
              rangestat (reg) price sp500 comod_1 comod_2, by(stock) interval(DATES . .)
              -rangestat- is written by Robert Picard, Nick Cox, and Roberto Ferrer and is available from SSC.


              Comment


              • #8
                Dear Mr Clyde, thank you so much. In fact, you were right "encode" command works.

                But when I tried to run xtset command
                Code:
                 
                 //  DECLARE PANEL DATA xtset stock DATES  stata output: .  xtset stock DATES string variables not allowed in varlist; DATES is a string variable r(109);
                [CODE]

                So I use the "encod" command
                Code:
                 
                 encode DATES, gen(DATES1) drop DATES rename DATES1 DATES
                Then I did use the "xtset "command such that

                Code:
                xtset stock DATES


                And I obtained this.

                Code:
                
                . xtset stock DATES
                       panel variable:  stock (unbalanced)
                        time variable:  DATES, 1 to 6471
                                delta:  1 unit

                The only problem is that my DATES variables are not in order, I don't know why ... It is a problem because I generated the return variable ( maybe it's not anymore the good value for the specif date...). Then all my returns are wrong..

                Code:
                * Example generated by -dataex-. To install: ssc install dataex
                clear
                input long stock float(price return_pct)
                1  26.70135   48.20567
                1  39.57291   4.541199
                1     41.37          .
                1         .          .
                1         .          .
                1         .          .
                1 35.372963  -42.57143
                1 20.314186 -37.777775
                1 12.639938   41.25799
                1 17.854923   44.25956
                1 25.757433 -35.424763
                1 16.632923   61.43595
                1 26.851517  1.1185098
                1 27.151854   44.42981
                1  39.21537   4.882348
                1     41.13  69.948944
                1      69.9 -4.3633804
                1     66.85  27.270014
                1     85.08          .
                1         .          .
                1         .          .
                1  48.51149  -28.64583
                1  34.61497  -41.70317
                1  20.17943  -34.62437
                1  13.19243   26.86414
                1 16.736464   28.86474
                1   21.5674  11.215244
                1 23.986237   6.400417
                1 25.521456   1.933315
                1 26.014866   5.140182
                1  27.35208  .23529385
                1 27.416435   44.13146
                1  39.51571   21.44538
                1     47.99   45.96791
                1     70.05 -3.1691666
                1     67.83   26.66961
                1     85.92          .
                1         .          .
                1         .          .
                1  44.80575 -17.763157
                1 36.846836  -46.44115
                1 19.734743 -14.783202
                1 16.817316  28.725965
                1  21.64825   12.60639
                1 24.377316   5.984163
                1 25.836094 -27.677834
                1 18.685223   38.46154
                1  25.87185   6.633502
                1 27.588057  -.7516824
                1  27.38068   42.43619
                1        39  23.435896
                1     48.14   49.08599
                1     71.77  -3.511212
                1     69.25          .
                1         .          .
                1         .          .
                1         .          .
                1  42.02645 -12.324647
                1 36.846836  -51.34171
                1 17.929039  -5.261181
                1  16.98576    29.6311
                1  22.01883   8.502853
                1 23.891056  -35.85753
                1 15.324314   22.11853
                1 18.713827   35.57508
                1 25.371286   4.875987
                1 26.608387   55.51488
                1     41.38   -6.74239
                1     38.59  24.643686
                1      48.1   47.17257
                1     70.79          .
                1         .          .
                1         .          .
                1         .          .
                1  40.42624  -67.36667
                1  13.19243  36.619003
                1 18.023367  -3.663552
                1 17.363071  26.891737
                1   22.0323  -29.11544
                1   15.6175   23.44322
                1 19.278746   30.78635
                1  25.21397   4.395917
                1 26.322353   49.85058
                1   39.4442    4.78094
                1     41.33  -8.202282
                1     37.94   29.81023
                1     49.25   77.19796
                1     87.27          .
                1         .          .
                1         .          .
                1         .          .
                1   43.7951  -52.75385
                1   20.6915  -36.79583
                1  13.07789   43.07059
                1 18.710613  -7.958235
                1 17.221579   45.70327
                1 25.092403 -38.130524
                1  15.52454  24.366644
                1  19.30735  32.333336
                1  25.55006   6.129301
                end
                label values stock stock1
                label def stock1 1 "A", modify
                And also my last code doesn't works


                Code:
                rangestat (reg) price SP500 , by(stock) interval(DATES,01/17/1995,07/22/2020)
                was expecting a numeric variable, a number, or a system missing value for the interval low: 01/17/1995
                r(198);

                Comment


                • #9
                  You have somehow messed up your DATES variable. The -xtset- output says your dates run from 1 to 6471. That corresponds to dates between 2jan1960 and 19sep1977, which is decades away from the range of dates you are interested in. This problem is not evident in the data example you posted in #3 or #6. So somehow, between then and now you have corrupted the DATES variable. You need to fix that.

                  I can't be sure what went wrong or how to fix it, but I'll speculate. It is interesting that the 1 to 6471 is said to be without gaps. But real world stock price data will have gaps due to weekends and holidays. So I'm guessing that you tried to rebuild your data set from the original source file(s). And I'm guessing that the DATES variable came in as a string. Then, and this is a fatal error, you applied -encode- to the DATES variable. That would lead to consecutive numbers that have an incorrect relationship to the actual dates you intend, and it would also result in the sort order not corresponding to chronological order.

                  If that is what happened, you have to rebuild it again. The proper way to convert a string that reads to human eyes as dates into a Stata numeric date variable is one of the date time functions, in particular -daily()- if they are complete (i.e. month, day, and year are shown) dates. Applying -encode- to strings that read to human eyes as dates produces garbage. -encode- should be applied to your stock variable (after the -reshape long-), but not to the DATES variable.

                  As for the problem with -rangestat-, the -interval()- option should read -interval(DATES, td(17jan1995), td(22jul2020))-.

                  Comment


                  • #10
                    Dear Mr Clyde, you were right the error came from the fact that I had in my original file my variable DATES as a real string. I have rebuilt my database and the problem no longer exists.

                    I don't understand but at each step, I encounter a new problem. I'm almost at the end and it bothers me to keep coming back to you. You have already helped me a lot and I have really progressed.

                    So here is the new problem I have now


                    Code:
                    . xtset stock DATES
                    repeated time values within panel
                    r(451);
                    
                    . gen return_pct = 100*(F.price-price)/price
                    time variable not set
                    r(111);

                    ----------------------- copy starting from the next line -----------------------
                    Code:
                    * Example generated by -dataex-. To install: ssc install dataex
                    clear
                    input int DATES long stock float price
                    12800 1 .
                    12801 1 .
                    12802 1 .
                    12803 1 .
                    12806 1 .
                    12807 1 .
                    12808 1 .
                    12809 1 .
                    12810 1 .
                    12813 1 .
                    12814 1 .
                    12815 1 .
                    12816 1 .
                    12817 1 .
                    12820 1 .
                    12821 1 .
                    12822 1 .
                    12823 1 .
                    12824 1 .
                    12827 1 .
                    12828 1 .
                    12829 1 .
                    12830 1 .
                    12831 1 .
                    12835 1 .
                    12836 1 .
                    12837 1 .
                    12838 1 .
                    12841 1 .
                    12842 1 .
                    12843 1 .
                    12844 1 .
                    12845 1 .
                    12848 1 .
                    12849 1 .
                    12850 1 .
                    12851 1 .
                    12852 1 .
                    12855 1 .
                    12856 1 .
                    12857 1 .
                    12858 1 .
                    12859 1 .
                    12862 1 .
                    12863 1 .
                    12864 1 .
                    12865 1 .
                    12866 1 .
                    12869 1 .
                    12870 1 .
                    12871 1 .
                    12872 1 .
                    12873 1 .
                    12876 1 .
                    12877 1 .
                    12878 1 .
                    12879 1 .
                    12880 1 .
                    12883 1 .
                    12884 1 .
                    12885 1 .
                    12886 1 .
                    12890 1 .
                    12891 1 .
                    12892 1 .
                    12893 1 .
                    12894 1 .
                    12897 1 .
                    12898 1 .
                    12899 1 .
                    12900 1 .
                    12901 1 .
                    12904 1 .
                    12905 1 .
                    12906 1 .
                    12907 1 .
                    12908 1 .
                    12911 1 .
                    12912 1 .
                    12913 1 .
                    12914 1 .
                    12915 1 .
                    12918 1 .
                    12919 1 .
                    12920 1 .
                    12921 1 .
                    12922 1 .
                    12925 1 .
                    12926 1 .
                    12927 1 .
                    12928 1 .
                    12929 1 .
                    12933 1 .
                    12934 1 .
                    12935 1 .
                    12936 1 .
                    12939 1 .
                    12940 1 .
                    12941 1 .
                    12942 1 .
                    end
                    format %tdnn/dd/CCYY DATES
                    label values stock stock1
                    label def stock1 1 "A", modify

                    I have read that to solve this problem I must create an identifier but all this seems to be complicated to understand. This is my first time building my database on stata. All this is new....I am sorry to keep coming back to you.

                    Comment


                    • #11
                      You are making it very hard to help you by not posting example data that exhibits the problem you are having. With all the example data you have shown so far that includes both stock and DATES, including the most recent one in #10, the command -xtset stock DATES- runs without error.

                      So I can't point you to the specific cause of this problem. Suffice it to say that the error message means exactly what it says. There is some value (possibly more than one) of stock for which there are two or more observations having the same value of DATES. In the context of what you are doing, those observations necessarily involve errors in the source data or the data management process. You can find the offending observations with:

                      Code:
                      duplicates tag stock DATES, gen(flag)
                      browse if flag
                      That will show you the observations that are causing -xtset- to reject your data. You then have to figure out why those offending observations are there and what is the proper way to eliminate them.

                      Added:
                      I have read that to solve this problem I must create an identifier...
                      Not in this case. You started with a data set in wide layout. Each stock's price time series was a separate variable--and Stata would not let you have two variables with the same name. The DATES variable was in your original data set, and it must not have had any repeat values because -reshape- would not have allowed you to do the -reshape long- command if there were duplicate values of date. The fact that you got through the -reshape- proves that, at that point, stock and DATES did uniquely identify the observations in your data set. So somewhere after the -reshape- command was done, some operation introduced some kind of duplicate observations (at least duplicates with regard to stock and price--maybe with respect to all other variables, maybe not. Perhaps when you see the -browse- results suggested above in this post, you will recognize where they came from. If not, you'll just have to go back and review all the data management from -reshape- on. If all else fails, you can repeat that data management one command at a time, and run -isid stock DATES- after each command. At the first point where Stata responds that stock and DATES do not uniquely identify the observations, that will be the place where the offending observations (first) arose. Then you can think about how to fix that command, and then try again. It is possible that this happened at more than one point, so you may need some patience and perseverance to fix this, though this kind of thing is more likely to be due to a single erroneous command, and once found and fixed, you will probably be OK.

                      Additional Added: I was too harsh on you for not posting example data that exhibits the problem you are having. Yes, ideally, you should always post an example that does that. But given that the error message didn't identify which observations were the source of the error, and you are probably unfamiliar with the commands needed to find them, it would be hard for you to pick out a subset of your data to show. You probably would have gone through a long, tedious, frustrating trial and error process--which is more than can reasonably be asked of you. So my apology for that.
                      Last edited by Clyde Schechter; 31 Mar 2021, 13:58.

                      Comment


                      • #12
                        Thank you for responding so quickly. I didn't know that it was possible to share your file on the forum. Sorry, English is not my first language.

                        I ran the line of code and indeed, some observations were replicated.

                        Without thinking I have executed these two lines of code, but I realize that I have deleted too many observations without leaving the good ones to keep.

                        Code:
                         drop if flag ==2
                        (47,016 observations deleted)
                        
                        . drop if flag ==1
                        (15,672 observations deleted)
                        
                        . xtset stock DATES
                               panel variable:  stock (strongly balanced)
                                time variable:  DATES, 1/17/1995 to 7/23/2020, but with gaps
                                        delta:  1 day
                        it is difficult to send you my data file. I can share with you a link to download it directly. I also used the xmlsave command but it takes too much time to convert ...

                        Find attached my sharing link:

                        https://drive.google.com/drive/folde...Bc?usp=sharing



                        And I still not able to run the regression with your code because of the same problem posted in #8
                        Last edited by Danielle Sekam; 31 Mar 2021, 15:29.

                        Comment


                        • #13
                          Sorry, but I don't download files from people I don't know. Even if I did, having the file would not help me troubleshoot your problem. It's not the current state of the file: it's how it got to be that way that matters at the moment.

                          Yes, you over-reacted by dropping all copies of the duplicated observations. The task is to keep one, the correct one, and eliminate the others, and, just as important, understand how it happened since whatever did that might also have caused other problems with the data that have not yet become apparent.

                          So, go back to what you had before you did those -drop- commands. Run
                          Code:
                          duplicates tag stock DATES, gen(flag)
                          browse if flag
                          Now study those observations carefully. See if, by noticing which ones they are, you perhaps are reminded of what happened that created them. If so, you can go back to that step in the data management, and try to fix that part of the code. If, looking at those observations it doesn't hit you what went wrong, then just go back to the beginning. Rebuild the data set and go as far as the -reshape long-. From that point on, just run the commands one at a time, and follow each one with -isid stock DATES-. At some point, -isid stock DATES- will respond with a message saying that stock and DATES do not uniquely identify the observations in the data. Then you will know that the step immediately before that -isid- introduced duplicate observations. So then you can see what that was and fix that.

                          If you want help with fixing things when you have localized the problem, do post back with example data from just before the problem, and the code that came next.

                          Comment


                          • #14
                            Oh, I understand perfectly. I'm sorry I offered it to you ( the data file) .I'm totally grateful to you for guiding me step by step.
                            I will follow your method.

                            Comment

                            Working...
                            X