Announcement

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

  • Repeated time values - Panel Data

    Hi,

    I have election data for a country. I am trying to set a panel but as each place has multiple candidates, I have repeated time values. I can not set my panel on candidate level as they do not always repeat. I want to conduct my analysis at county level. A sample of structure of the data is placed below:
    Year State County Constituency Candidate Winner
    1990 MP County 1 PC1 1 1
    1990 MP County 1 PC1 2 0
    1990 MP County 1 PC1 3 0
    1990 MP County 1 PC2 4 1
    1990 MP County 1 PC2 5 0
    1990 MP County 2 PC3 6 1
    1990 MP County 2 PC3 7 0
    1990 MP County 2 PC3 8 0
    1990 MP County 2 PC4 9 1
    1990 MP County 2 PC4 10 0
    1990 MP County 2 PC4 11 0
    1990 UP County 1 PC5 12 1
    1990 UP County 1 PC5 13 0
    1990 UP County 1 PC5 14 0
    1990 UP County 1 PC6 15 1
    1990 UP County 1 PC6 16 0
    1990 UP County 1 PC6 16 0
    1990 UP County 2 PC7 17 1
    1990 UP County 2 PC7 18 0
    1990 UP County 2 PC7 19 0
    1990 UP County 2 PC8 20 1
    1990 UP County 2 PC8 21 0
    1995 MP County 1 PC1 1 1
    1995 MP County 1 PC1 2 0
    1995 MP County 1 PC1 22 0
    1995 MP County 1 PC2 4 1
    1995 MP County 1 PC2 23 0
    1995 MP County 2 PC3 24 1
    1995 MP County 2 PC3 25 0
    1995 MP County 2 PC3 26 0
    1995 MP County 2 PC4 9 1
    1995 MP County 2 PC4 10 0
    1995 MP County 2 PC4 11 0
    1995 UP County 1 PC5 30 1
    1995 UP County 1 PC5 31 0
    1995 UP County 1 PC5 14 0
    1995 UP County 1 PC6 15 1
    1995 UP County 1 PC6 32 0
    1995 UP County 1 PC6 32 0
    1995 UP County 2 PC7 17 1
    1995 UP County 2 PC7 33 0
    1995 UP County 2 PC7 19 0
    1995 UP County 2 PC8 34 1
    1995 UP County 2 PC8 21 0

    I have tried
    xtset year state-county where state-county is a group I created. I do not think year-state-county would be correct either. Can someone suggest a way out to conduct this analysis?

    I also need to know if the winner in 1995 was the same as the winner in 1990. Unless I set my panel, I do not think I can find that.

    Any help/guidance would be appreciated.

    Thank you














  • #2
    Purnima:
    welcome to this forum.
    If you do not plan to use teime-series commands such as lags and leads, you can simply:
    Code:
    xtset County
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Hello,

      Thank you for your reply.

      I was hoping to use the lags leads to find if the candidate who won the election in 1995 was the same candidate who won the election in 1990. Basically if a new candidate was elected or the incumbent got reelected.

      Is there any other way of finding this while using xtset county?

      Regards,
      Purnima

      Comment


      • #4
        Purnima:
        none that I'm aware of.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Dear Carlo,
          Thank you for your reply. I will keep trying to find some other way.

          In the meanwhile, if anyone else on this forum has a solution, I am trying to do two things:

          (1) Generate a variable reelect to find if the candidate who won the election in 1995 was the same candidate who won the election in 1990 or a new candidate.

          (2) Trying to analyse the data and run regressions at County level. However, as I have multiple candidates for each State-County, it gives a repeated time values error. I can set it only at county but if I do that, I do not know how to generate variables like reelect.

          Also just for further knowledge, are there any consequences of setting panel only at county without the time variable?

          Thank you

          Comment


          • #6
            Purnima:
            as far as questions (1) and (2) are concerned, you should probably skim through the literature of your research field and see what others did in the past when presented with the same research topic.
            As far as your last question is concerned, -xtset panelid- will not produce any consequence, exception made for the unfeasibility of using time-series commands such as lags and leads.
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment

            Working...
            X