Announcement

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

  • A few queries on data management( firm-level)

    Dear users:

    I have a few questions about data management when working with firm-level data.
    I have panel data of 17,000 firms from 1995 to 2015. Question 1: Suppose a firm was incorporated in 1990, and I want to give (1990=1),(1991=2),(1993=3),(1994=4),(1995=5), since I pooled from 1995, then 1995 will take 5, and 2015 will take 25.

    Question 2: I want to identify the stock market-listed or active firms. Suppose a firm was listed in the stock market on 23/05/1994 and de-listed from the stock market on 24/06/2010. So from the beginning( giving 23/05/1994 as 1, and 1995=2), I want to generate a continuous variable that captures firm participation in the stock market.

    Question 3: I want to take into account those firms that provide data on sales for the continuous three years and delete the rest of them. How to write code for it?



    With regards:
    Amit Nandan

  • #2
    Originally posted by Amit Nandan View Post
    Dear users:

    I have a few questions about data management when working with firm-level data.
    I have panel data of 17,000 firms from 1995 to 2015. Question 1: Suppose a firm was incorporated in 1990, and I want to give (1990=1),(1991=2),(1993=3),(1994=4),(1995=5), since I pooled from 1995, then 1995 will take 5, and 2015 will take 25.

    Question 2: I want to identify the stock market-listed or active firms. Suppose a firm was listed in the stock market on 23/05/1994 and de-listed from the stock market on 24/06/2010. So from the beginning( giving 23/05/1994 as 1, and 1995=2), I want to generate a continuous variable that captures firm participation in the stock market.

    Question 3: I want to take into account those firms that provide data on sales for the continuous three years and delete the rest of them. How to write code for it?



    With regards:
    Amit Nandan
    Dear Amit,

    There is an infinitesmal probability that anyone will be able to answer your question, when you do not give an example of your data or even write the names of your variables. I suggest you provide a dataexample with the command -dataex- as this will increase your chance of recieving an answer. Naturally, you cannot show all of your data with 17000*20 observations, so carefully think about what part of your data you must show in order for someone else to understand your coding task.

    Comment


    • #3
      Suppose a firm was incorporated in 1990, and I want to give (1990=1),(1991=2),(1993=3),(1994=4),(1995=5), since I pooled from 1995, then 1995 will take 5, and 2015 will take 25.
      isn't a question.

      I want to generate a continuous variable that captures firm participation in the stock market.
      Sounds like a formula that you should know.

      I want to take into account those firms that provide data on sales for the continuous three years and delete the rest of them. How to write code for it?
      I don't understand. Do you wanna keep all firms that don't have missing sales data?? I agree with the above post, you'll need a data example for us to help you.

      To illustrate why, look at this post or this one. I give all my code. I even give my real dataset programmatically so everyone can work with the real data I have. I explain what the issue is, and I was helped. I'm not doing this for self aggrandizement, but what I'm trying to say is that questions like these are the ones that are most likely to get replies and effective assistance.

      Comment


      • #4
        Originally posted by Amit Nandan View Post
        Dear users:

        I have two questions about data management when working with firm-level data.
        I have panel data of 17,000 firms from 1995 to 2015.

        Question 1: Suppose a firm was incorporated in 1990, and I want to give (1990=1),(1991=2),(1993=3),(1994=4),(1995=5), since I pooled from 1995, then 1995 will take 5, and 2015 will take 25.


        Question 2: I want to consider those firms that provide data on "Networth" for the continuous ten years and delete those that don't provide the data on "Networth" for the continuous ten years. How to write code for it?

        Here, I am attaching panel data. Company_Code is panel id then year. The variable "Incorporation_year" captures the year of establishment of a firm. The "Networth" is one of the variables.

        With regards:
        Amit Nandan
        Company_Code year Incorporation_year Networth
        68 1995 1984
        68 1996 1984
        68 1997 1984
        68 1998 1984
        68 1999 1984
        68 2000 1984
        68 2001 1984
        68 2002 1984
        68 2003 1984
        68 2004 1984
        68 2005 1984
        68 2006 1984
        68 2007 1984
        68 2008 1984
        68 2009 1984
        68 2010 1984 -91.6
        68 2011 1984 -99.7
        68 2012 1984 -99.7
        68 2013 1984
        68 2014 1984 -145.4
        68 2015 1984 -152.5
        87 1995 1994
        87 1996 1994
        87 1997 1994
        87 1998 1994
        87 1999 1994
        87 2000 1994 30.8
        87 2001 1994 11.8
        87 2002 1994
        87 2003 1994 1.5
        87 2004 1994
        87 2005 1994 23.7
        87 2006 1994 34.9
        87 2007 1994 18.1
        87 2008 1994 18.6
        87 2009 1994 11.4
        87 2010 1994 11.9
        87 2011 1994 13.1
        87 2012 1994 7.7
        87 2013 1994 7.7
        87 2014 1994
        87 2015 1994
        228 1995 1901 12.2
        228 1996 1901 11.5
        228 1997 1901 11.4
        228 1998 1901
        228 1999 1901
        228 2000 1901
        228 2001 1901
        228 2002 1901
        228 2003 1901
        228 2004 1901
        228 2005 1901
        228 2006 1901
        228 2007 1901
        228 2008 1901
        228 2009 1901
        228 2010 1901
        228 2011 1901
        228 2012 1901
        228 2013 1901
        228 2014 1901
        228 2015 1901
        301 1995 1994 61.2
        301 1996 1994 44.9
        301 1997 1994 47.9
        301 1998 1994 34.7
        301 1999 1994
        301 2000 1994
        301 2001 1994
        301 2002 1994
        301 2003 1994
        301 2004 1994
        301 2005 1994
        301 2006 1994
        301 2007 1994
        301 2008 1994
        301 2009 1994
        301 2010 1994
        301 2011 1994
        301 2012 1994
        301 2013 1994
        301 2014 1994
        301 2015 1994
        345 1995 1996
        345 1996 1996
        345 1997 1996
        345 1998 1996
        345 1999 1996
        345 2000 1996
        345 2001 1996
        345 2002 1996
        345 2003 1996 4.5
        345 2004 1996 4.5
        345 2005 1996 4.5
        345 2006 1996 4.5
        345 2007 1996 4.5
        345 2008 1996 4.5
        345 2009 1996 4.5
        345 2010 1996
        345 2011 1996
        345 2012 1996
        345 2013 1996
        345 2014 1996
        345 2015 1996

        Comment


        • #5
          Please post it correctly using dataex. You should see this
          Code:
          
          
          Where your data go
          So use dataex and then copy it exactly as it says, please

          Comment


          • #6
            Originally posted by Amit Nandan View Post
            Dear users:

            I have a few questions about data management when working with firm-level data.
            I have panel data of 17,000 firms from 1995 to 2015.

            Question 1: Suppose a firm was incorporated in 1990, and I want to give (1990=1),(1991=2),(1993=3),(1994=4),(1995=5), since I pooled from 1995, then 1995 will take 5, and 2015 will take 25.



            Question 2: I want to consider those firms that provide data on "Networth" for ten continuous years and delete those that don't provide the continuous data for ten years. rest of them. How to write code for it?

            In the given data: Company_Code is the panel id then the year. The incorporation_year provides information of the establishment year of a firm. The "Networth" is the variable.

            With regards:
            Amit Nandan
            Company_Code year Incorporation_year Networth
            68 1995 1984
            68 1996 1984
            68 1997 1984
            68 1998 1984
            68 1999 1984
            68 2000 1984
            68 2001 1984
            68 2002 1984
            68 2003 1984
            68 2004 1984
            68 2005 1984
            68 2006 1984
            68 2007 1984
            68 2008 1984
            68 2009 1984
            68 2010 1984 -91.6
            68 2011 1984 -99.7
            68 2012 1984 -99.7
            68 2013 1984
            68 2014 1984 -145.4
            68 2015 1984 -152.5
            87 1995 1994
            87 1996 1994
            87 1997 1994
            87 1998 1994
            87 1999 1994
            87 2000 1994 30.8
            87 2001 1994 11.8
            87 2002 1994
            87 2003 1994 1.5
            87 2004 1994
            87 2005 1994 23.7
            87 2006 1994 34.9
            87 2007 1994 18.1
            87 2008 1994 18.6
            87 2009 1994 11.4
            87 2010 1994 11.9
            87 2011 1994 13.1
            87 2012 1994 7.7
            87 2013 1994 7.7
            87 2014 1994
            87 2015 1994
            228 1995 1901 12.2
            228 1996 1901 11.5
            228 1997 1901 11.4
            228 1998 1901
            228 1999 1901
            228 2000 1901
            228 2001 1901
            228 2002 1901
            228 2003 1901
            228 2004 1901
            228 2005 1901
            228 2006 1901
            228 2007 1901
            228 2008 1901
            228 2009 1901
            228 2010 1901
            228 2011 1901
            228 2012 1901
            228 2013 1901
            228 2014 1901
            228 2015 1901
            301 1995 1994 61.2
            301 1996 1994 44.9
            301 1997 1994 47.9
            301 1998 1994 34.7
            301 1999 1994
            301 2000 1994
            301 2001 1994
            301 2002 1994
            301 2003 1994
            301 2004 1994
            301 2005 1994
            301 2006 1994
            301 2007 1994
            301 2008 1994
            301 2009 1994
            301 2010 1994
            301 2011 1994
            301 2012 1994
            301 2013 1994
            301 2014 1994
            301 2015 1994
            345 1995 1996
            345 1996 1996
            345 1997 1996
            345 1998 1996
            345 1999 1996
            345 2000 1996
            345 2001 1996
            345 2002 1996
            345 2003 1996 4.5
            345 2004 1996 4.5
            345 2005 1996 4.5
            345 2006 1996 4.5
            345 2007 1996 4.5
            345 2008 1996 4.5
            345 2009 1996 4.5
            345 2010 1996
            345 2011 1996
            345 2012 1996
            345 2013 1996
            345 2014 1996
            345 2015 1996

            Comment


            • #7
              No this isn't it. When you type in dataex, you should see "copy starting from the next line". That next line will start with CODE that is in brackets. When you scroll all the way down, you'll see /CODE that's also in brackets. You'll then see "copy up to and including the previous line".


              So, Stata is literally asking you to copy from the first CODE in brackets to the last bracket at the very bottom. I know I seem like I'm nitpicking, but this is important because if I try and put this in a do file right now so that I can help you, I'll get "command Company_Code is unrecognized". For a visual example of what to do, go the the 4:15 part of this video and watch exactly how you're meant to do this. Amit Nandan

              Comment

              Working...
              X