Announcement

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

  • Setting up Data

    Hello everyone,
    I am currently facing some troubles setting up my data.
    I have the format like this at the moment:
    Company, Variable(containts ESG, Marketcap f.i.), Currency and then daily dates so, 21 jun2001 22 jun2001

    However, I would like to have it likes this
    Date Company ESG Marketcap Currency
    21 jun2001 Adecco 60 20,000 $
    22 jun 2002

    Note that nothing is named as variables either as stata is not able to handle this amount of variables as I am using 20 years of daily data.

    Thanks in advance!

  • #2
    Welcome to Statalist.

    You have accidentally posted your topic in Statalist's Mata Forum, which is used for discussions of Stata's Mata language, which is different than Stata's command language. Your question will see a more appropriate, and much larger audience if you post it in Statalist's General Forum.

    Also, if you have not already done so, take a look at the Statalist FAQ linked to at the top of this page for posting guidelines and suggestions.

    Are you suggesting that your data has approximately 20*365 = 7300 columns? If so, do be sure to include information on precisely what version of Stata you are using, as the about command tells you.
    Code:
    . about
    
    Stata/SE 17.0 for Mac (Intel 64-bit)
    Revision 05 May 2021

    Comment


    • #3
      Stata/MP 16.1 for Windows (64-bit x86-64)
      Revision 06 Apr 2021
      Copyright 1985-2019 StataCorp LLC
      , and yes 5000. I also have the dataset in a different format, like this:

      Variable Market Value Governance Pilar score Social Pilar Score
      Company ZIJIN MINING GROUPA ZIJIN MINING GROUPA ZIJIN MINING GROUPA
      Currency CH CH CH
      21-06
      22-06
      etc.

      And thanks for your feedback, as I am new to this forum

      Comment


      • #4
        You are new to Stata, are you not?

        You wrote in post #1
        stata is not able to handle this amount of variables
        However, in post #3 we see you are using Stata/MP.

        The output of the command help memory will tell you that for Stata/MP the default limit on number of variables is 5000, but this can be increased to 120,000.
        Code:
        set maxvar 32767, permanently
        is what I have done on my copy of Stata/SE, so that the default is now the maximum my version of Stata will allow, and well in excess of anything I will ever use.

        So your first step is adjust your setting for maxvar and then work to read your data into Stata - both versions, it's hard to say based on what you've shown us which one will be better for your purposes - and then use the dataex command to display a (very small) example of each dataset. For example, on the first dataset, limit it to the Company, Variable, Currency, and just a few dates. Then present that in a reply on this topic.

        But also, some advice I give to new users of Stata.

        I'm sympathetic to you as a new user of Stata - there is quite a lot to absorb. I'd like to encourage you to take a step back from your immediate tasks and do some studying.

        When I began using Stata in a serious way, I started, as have others here, by reading my way through the Getting Started with Stata manual relevant to my setup. Chapter 18 then gives suggested further reading, much of which is in the Stata User's Guide, and I worked my way through much of that reading as well. There are a lot of examples to copy and paste into Stata's do-file editor to run yourself, and better yet, to experiment with changing the options to see how the results change.

        All of these manuals are included as PDFs in the Stata installation and are accessible from within Stata - for example, through the PDF Documentation section of Stata's Help menu. The objective in doing the reading was not so much to master Stata - I'm still far from that goal - as to be sure I'd become familiar with a wide variety of important basic techniques, so that when the time came that I needed them, I might recall their existence, if not the full syntax, and know how to find out more about them in the help files and PDF manuals.

        Stata supplies exceptionally good documentation that amply repays the time spent studying it - there's just a lot of it. The path I followed surfaces the things you need to know to get started in a hurry and to work effectively.

        And to not believe that with the most powerful version of Stata you are limited to just 5000 variables.


        Comment


        • #5
          Well, my main problem is setting up the data. As I am doing master thesis now. I have followed several courses with stata. However, most of the time we had already received the database, or just make some small corrections like changing the date format from mdy to year or somethings. But I am familiar with the regressions and the event study methodology which I am going to perform.
          For now I am able to import my data, but stata is not able to import my data and make the first row as variables. I think it has something to do with the fact that is noted as 21-01-2004 etc. so my main problem for now is stata not recognizing the first row as variables. Afterwards I believe I am able to create the long-format which I desire.

          Comment


          • #6
            Note that this problem was reposted in the General forum at

            https://www.statalist.org/forums/for...etting-up-data

            where the discussion continues.

            Comment

            Working...
            X