Announcement

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

  • Panel data: repeated time values within panel

    Dear Statalisters,

    I have the following dataset:
    company industry year size_sboard women
    1 202 2017 16 0.25
    1 202 2016 16 0.25
    1 202 2015 12 0.33333333
    1 202 2014 12 0.33333333
    1 202 2013 12 0.16666667
    1 202 2012 12 0.16666667
    1 202 2011 12 0.16666667
    1 202 2010 12 0.16666667
    1 202 2009 12 0.16666667
    1 202 2008 12 0.16666667
    2 204 2017 6 0.33333333
    2 204 2016 6 0.33333333
    2 204 2015 6 0.16666667
    2 204 2014 6 0.16666667
    2 204 2013 6 0.16666667
    2 204 2012 6 0.16666667
    2 204 2011 6 0.16666667
    2 204 2010 6 0
    2 204 2009 6 0
    2 204 2008 5 0
    3 207 2017 12 0.16666667
    3 207 2016 12 0.16666667
    3 207 2015 12 0.16666667
    3 207 2014 12 0.16666667
    3 207 2013 12 0.16666667
    3 207 2012 12 0.08333333
    ...and so on...

    Trying to set up the following fixed effect regression

    xtset industry year

    I get the following error (which I understand)
    repeated time values within panel
    r(451);


    Does anybody has a solution, how I can run a fixed effect regression controlling for industry and year?

    Thanks in advance!

  • #2
    Hi Legov,

    Most likely there are issues of repeated observations for year for industries not shown on the snippet of your dataset that you shared. Try running the following:

    Code:
    bysort year: distinct industry
    The number of distinct observations for each year should be equal to the total number of observations of said year (in other words, you should not have repeated observations for year within industries).

    Best;

    Comment


    • #3
      Hi Igor,

      thanks for your answer. Yes you are right, there are repeated observations for year within industries and I am totaly aware of this problem. I should have asked more precisely, sorry for that.

      Give me a new try:

      I want the following regression:

      xtreg tobins_q size_sboard women_on_board.....

      Originally I wanted to control for company and year. Since there many observations for companies, where for example the size of supervisory boards remains constant which reduces the expressiveness of the coefficient I came up with the idea to control for industries and years. But controlling for industries instead of companies leads to the problem of repeated time values.

      Do you have a solution to solve this problem?

      Comment


      • #4
        Hi Legov,

        In Panel Data analysis, your rows are comprised of identifiers and time. Each combination of id and time must not occur more than once - a specific combination can not occur (those are called gaps), but two observations for the same id and time variables can not. This is what Stata is complaining to you. The regression you want to run (xtreg) requires you to set up your data as Panel Data, but you can't because you have repeated observations for the id x time combinations.

        The way I would solve the issue is to find out why you have repeated id x time combinations. If they are truly repeated (all variables are the same for the rows that have the same values for id and time), than I would simply delete one the rows (because they are truly repeated). However, if the values for the other variables of the repeated observations are different, then either your time variable is not good (having two assessments of the companies, one in January and other in July and calling both "2016" is a simplification - you might want to refine this data or adjust how you record time in your dataset - semesters?) or your id variable is not good (you might have given different companies the same id, thus the repetition). In both scenarios, people will only be able to help you with the modeling per se (and I am not the best for that) after you fix these data related issues you have.

        For more info look here.

        Best;

        Comment


        • #5
          I'm not sure of your area, but many areas working on this kind of problem would expect panels to be at the firm level.

          If you really want to work with industry panels, you can simply not set the year in the xtset. You won't be able to do lags, but will do a panel estimate.

          Comment

          Working...
          X