Announcement

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

  • repeatedly getting error when trying to create a panel "repeated time values within panel r(451)"

    I have the following data type. I have four countries with 50 companies each for three years. I was trying to create a panel but getting the error "repeated time values within panel". Below is the stata steps i have used. Can you please identify whats missing.
    Sr# Country company Years SID_codes country_coding CSR annual reports other variables
    1 China coA 2015 3679 1 10 1.36E+08
    1 China coA 2016 3680 1 10 1.36E+08
    1 China coA 2017 3681 1 10 1.36E+08
    2 China coB 2015 3679 1 10 1.36E+08
    2 China coB 2016 3680 1 10 1.36E+08
    2 China coB 2017 3681 1 10 1.36E+08
    3 India coC 2015 3679 2 4 1.36E+08
    3 India coC 2016 2 4 1.36E+08
    3 India coC 2017 2 7 1.36E+08
    4 Bangladesh coD 2015 3679 3 5 1.36E+08
    4 Bangladesh coD 2016 3 5 1.36E+08
    4 Bangladesh coD 2017 3 5 1.36E+08
    5 Pakistan coE 2015 3679 4 2 1.36E+08
    5 Pakistan coE 2016 4 3 1.36E+08
    5 Pakistan coE 2017 4 4 1.36E+08

    sort country_coding Years
    egen newid= group(country_coding)
    xtset newid Years

    error occurs in the third step
    "repeated time values within panel".
    r 451.

    i have tried on other options too as stated below..They also dont work for me:
    egen new_panelidd= group(Country SID_codes)
    sort new_panelidd Years
    xtset new_panelidd Years

    error occurs in the third step again
    "repeated time values within panel".
    r 451.

  • #2
    Hi Farah, and welcome to Statalist!

    Stata is telling you that China 2015 (for example) is in the data multiple times because you have multiple companies for each country. I suspect that you are going to want to xtset company year as your panel and time variables (since presumably you have CSR data for each of the companies over time).

    Comment


    • #3
      You can try this procedure to identify the repeated entries:

      https://www.stata.com/support/faqs/d...ed-time-values

      Comment


      • #4
        Hi David. Thanks for welcoming :-)
        The values for the variables are assumed only. Each country has multiple countries with three years values. I am not sure how else I could do this.
        However, i have tried on the xtset as stated above but still gives the same errors.

        Comment


        • #5
          Hi Dario

          I tried the procedure. It still gives the same error. However, I was wondering I donot want to drop any values as they are essential for the panel estimation. Is there any way out other than this?

          Comment


          • #6
            Farah:
            see also: https://www.statalist.org/forums/for...s-within-panel.
            Kind regards,
            Carlo
            (Stata 18.0 SE)

            Comment


            • #7
              Successful xtset panelid timeid requires there to be at most one observation for each combination of identifiers.

              Then time series operators such as those yielding previous values or following values or differences make sense.

              You don't have that case. For example, if you have repeated values for China in 2015 previous values aren't uniquely defined for China in 2016, and so on.

              So, you need to tell us what analyses (in particular, which models) you intend to apply that make sense for your data.

              Note that xtset panelid is perfectly legal, but whether it is what you want or need is an open question.
              Last edited by Nick Cox; 15 Jan 2019, 03:38.

              Comment


              • #8
                Hi Nick

                I am new is Stata so maybe not able to put through my question. Actually i need to run regression on my panel that has nine countries. each country has 50 companies with three years data. In total I have 1350 obs with 450 unique companies. Each country has 150 obs repeatedly for three years. I intend to run regression model on my data. Before starting regression, I was trying to declare my data as panel. But unfortunately, I am stuck at the first step. Below is the data i am trying to analyze
                Country Code company Years SID_codes country_coding CSR annual reports variables
                China CN:BEL BOE TECHNOLOGY 2015 3679 1 10 73469010
                China CN:BEL BOE TECHNOLOGY 2016 3679 1 46 73469010
                China CN:BEL BOE TECHNOLOGY 2017 3679 1 46 73469010
                China CN:CCWH SOUTHWEST SECURI 2015 6231 1 0 0
                China CN:CCWH SOUTHWEST SECURI 2016 6231 1 0 0
                China CN:CCWH SOUTHWEST SECURI 2017 6231 1 27 0
                India In:BISH Nestle India 2015 3312 2 27 0
                India In:BISH Nestle India 2016 3312 2 23 0
                India In:BISH Nestle India 2017 3312 2 23 13 0
                India U:HDB HDFC BANK LIMITED 2015 6029 2 48 10136230
                India U:HDB HDFC BANK LIMITED 2016 6029 2 45 10136230
                India U:HDB HDFC BANK LIMITED 2017 6029 2 45 10136230
                Pakistan PK:PSO Pakistan State Oil 2015 6231 3 0 0
                Pakistan PK:PSO Pakistan State Oil 2016 6231 3 0 0
                Pakistan PK:PSO Pakistan State Oil 2017 6231 3 27 0
                Pakistan PK:ACB ASKARI BANK LIMITED 2015 6029 5 8 23993970
                Pakistan PK:ACB ASKARI BANK LIMITED 2016 6029 5 9 23993970
                Pakistan PK:ACB ASKARI BANK LIMITED 2017 6029 5 7 23993970
                I have run all the steps mentioned above, but cant find how to resolve the issue pertaining to repeated values.

                Comment


                • #9
                  i also used the isid command and found out presence of duplicates.
                  isid country_coding Years
                  variables country_coding Years do not uniquely identify the observations
                  r(459);

                  But the duplicates cant be removed as they represent observations over time. Is there any other way out to solve this?

                  Comment


                  • #10
                    which is the database that you use to draw the information reported above?

                    Comment


                    • #11
                      Unfortunately needing to run regression on panel data is not a precise description. Which variables? Which command do you plan to use? Why you think its assumptions are matched by the two levels (country, company) in your data? How do replicates for country and year work with those assumptions?

                      If you're a student or researcher in someone else's group, then you may need to talk to your teacher or supervisor.

                      Comment


                      • #12
                        I agree with Nick. By the way, I asked you about the databse, since sometimes you can get multiple entries for the same firm in the same year, since financial reports are released more than once a year. So for instance for firm A, you may have a report in April and one in December. However, they may be marked as released in the the same year. Usually, in the database there is a code, which identifies the financial report release. Finally, if I look at your dataset I am wondering why for instance year for firm coC is 20153679 and in another case it is 2016. I suggest that you identify the year in a univocal way. Otherwise it is hard to let Stata understading the time span of your dataset.

                        Comment


                        • #13
                          I guess that seeing 20153679 is just a side-effect of the OP not using dataex and CODE delimiters. That is really 2015 and 3679 in adjacent variables.

                          Comment


                          • #14
                            Hi Nick.... sorry for not getting my point through. My intention is to examine the impact of CSR disclosures on the firm performance. For this I am analyzing multiple countries with variable industries over a period of three years. The first step i need to do is to run a regression and for that I assumed I had to undergo the above mentioned steps. Could you please let me know if thats the appropriate way?

                            Comment


                            • #15
                              Hi Dario
                              I dont think theres a problem with the data. Its just that I am not sure about my approach to handle such a data for my study.

                              Comment

                              Working...
                              X