Announcement

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

  • xtset with repeated time values

    Hello everyone,

    I am very new to stata and I'm trying to work on the stationarity of the variables in my panel data. My problem is that, since I have bilateral trade data, I have repeated time values so xtset does not allow me to register a time var to then use the xtunitroot command.
    What can I do to solve this problem and test for stationarity ?

    My panelid is otherwise balanced if I understand correctly.

    Thank you in advance to anyone taking the time to answer

  • #2
    You also don't show your -xtset- command, so those who want to help you are left to imagining what you did and how it might have gone wrong. But since this kind of problem is common here on Statalist I'll stick my neck out and guess that you have a data set with a variable for exporter, another variable for importer, and another variable for time. And you tried something like -xtset exporter time- or -xtset importer time-. And, if that's what happened, then, yes, Stata balks due to the repeated time values within panel.

    You are using the wrong panel variable. Try this:
    Code:
    egen panel_var = group(importer exporter)
    xtset panel_var time
    If what I described is not your situation, or if the above approach does not solve your problem, post back. When posting back, be sure to show example data from your data set. Make sure the example data reproduces the problem you are encountering, and also be sure to use the -dataex- command to post the example data so that it will be usable for troubleshooting. If you are running version 18, 17, 16 or a fully updated version 15.1 or 14.2, -dataex- is already part of your official Stata installation. If not, run -ssc install dataex- to get it. Either way, run -help dataex- to read the simple instructions for using it. -dataex- will save you time; it is easier and quicker than typing out tables. It includes complete information about aspects of the data that are often critical to answering your question but cannot be seen from tabular displays or screenshots. It also makes it possible for those who want to help you to create a faithful representation of your example to try out their code, which in turn makes it more likely that their answer will actually work in your data.

    Also critical is to show the actual -xtset- command you used that is producing the problem.



    Comment

    Working...
    X