Announcement

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

  • Error r(451) repeated time values

    Hi everyone, I really need your help as quickly as possible, I have a data set of +100,000 observations, in this data set I have 95 variables, this is panel data, for each variable, I have state and year.
    When trying to xtset that data to be panel data I get error r(451), I know there are repeated years but they are repeated for every single observation, for every year I have 15000 observations with different variables.
    How can I organize the data to be panel data and overcome this error? thanks for your help already!

    Abdel Qader Diab

  • #2
    I think you are trying to xtset state year, whereas you should be doing xtset panelunit year. I have no idea what your panel unit is as you tell us nothing about it.

    Please also note that generally people on this forum do not appreciate including messages such as "I really need your help as quickly as possible", if anything it discourages readers from investing their time in your question. Also see the FAQ on including a data example and being as clear as possible when asking a question.

    Comment


    • #3
      I write with strong support for Jesse's comments.

      No one doubts that you want an answer as quickly as possible. Who doesn't?

      But that's the point. Everyone does.

      There is no queue here that you can jump by waving an "Urgent!" card, or even by explaining precisely why your situation is urgent or desperate or that deadlines are imminent.. The implication that other people's questions are somehow less important, although usually unintended, is incorrect and possibly even offensive.

      I've been posting on Statalist for over 20 years and know many of the most active users personally. I have never known anyone comment that they jumped to answer a question because it was flagged as urgent. But I have often heard people comment -- usually in private emails -- that they ignored questions from anyone claiming urgency.

      So, not only does this kind of flag not help you, it may even be to your distinct disadvantage.

      To end more positively, I note that the subject is covered by an FAQ which search would have pointed you to:

      http://www.stata.com/support/faqs/da...d-time-values/


      Last edited by Nick Cox; 29 Nov 2016, 08:04.

      Comment


      • #4
        Hi,

        Sorry for the inconvenience I have caused, I was only asleep for two hours and I have had this issue for couple of days.

        To explain more, I have tried the solution in FAQ, yet, I still have the same issue, I am new to using Stata so I don't really know what the panel unit should be.

        Thanks.

        Comment


        • #5
          Can you provide a data example using -dataex-? Or at the very least describe the data you are using? The panel unit is the smallest unit of observation. E.g. imagine you have restaurants emlpoyment levels in the US over multiple years, with info on the state they are located in. The panel unit is then the restaurant, hence you'd xtset restaurantID year.

          Comment


          • #6
            I have attached a snapshot of my data, I have individual observations of many variables such as BMI, Diabetes and Stroke, I hope this can help, thank you!

            Click image for larger version

Name:	Capture.PNG
Views:	1
Size:	11.0 KB
ID:	1366066

            Comment


            • #7
              Showing a snapshot is not using dataex as Jesse well advised.

              That snapshot shows that _STATE can't be a panel identifier because there are multiple observations for each year. It doesn't tell me anything else. If you have data on individual patients, then their identifier might possibly be an identifier.

              We don't expect you to post confidential information. In fact you should already have read http://www.statalist.org/forums/help as Jesse advised in #2. That tells you

              If your dataset is confidential, then provide a fake example instead.

              Comment


              • #8
                The data is not confidential, I got it from a public source.
                The snapshot is from data browse option on Stata, I shall try your advise and use the unique individual identifier, thanks.

                Comment

                Working...
                X