Announcement

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

  • Panel Data - xtset error

    Hi,

    I am trying to run the code
    Code:
     xtset CompanyID EventDate
    but I am getting an error stating "repeated time values within panel". I have multiple CompanyIDs where there are unique EventDates for each CompanyID.

    Does anyone know how fix this to where it could function correctly?

    Thanks

  • #2
    The xtset call you've made requires that each combination of company ID and event date occurs at most once.

    Hence check for duplicates. https://www.stata.com/support/faqs/d...d-time-values/ says more.

    Some datasets will only allow xtset using panel identifier only.

    Comment


    • #3
      Jacob:
      if you do not plan to use time-series commands (such as lags and leads), as Nick said you can safely -xtset- your panel dataset with -panelid- only and fix the issue.
      This trick still allows you to plug -i.timevar- in the right-hand side of your regression equation.
      Kind regards,
      Carlo
      (Stata 19.0)

      Comment

      Working...
      X