Announcement

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

  • Time ranges as time variable when using the Stata xtset command with panel data?

    I have panel data with which I would ultimately like to do a fixed effects regression with Stata. My panels are countries and I have a multi-level structure (observations are different military operations within countries). My time variable - if I use one - is not simply years like 2001, 2002 etc. but time ranges, for example 1.5.2003-1.4.2005 etc., with some years included multiple times and others not included at all.

    Is it advisable to simply exclude the time factor or is there a way to specify the time range using xtset?

  • #2
    xtset requires single times if you specify a time variable. That's not negotiable.

    It's unlikely that you lose anything by just declaring a panel identifier here.

    Comment


    • #3
      Jonas:
      welcome to the list.
      If the -timevar. (time range, in your case) is not that relevant in terms of order of observations, you can simply omit it.
      If you have military operations nested within countries, you may want to take a look at -mixed- (which leans towards -re- specification, though).
      Eventually, if you are dealing with an unbalanced panel dataset, Stata can handle it with no problem.

      PS; Crossed with Nick's reply.
      Kind regards,
      Carlo
      (Stata 19.0)

      Comment


      • #4
        Just elaborating on what Carlo and Nick have already said, you only need to specify a time variable in your -xtset- command if you are going to use lag/lead/difference/seasonal operators in your analysis, or run analyses that estimate autoregressive correlation structures. In those cases, Stata needs to know the order in which the operations occur, and whether there are any gaps in the data. But if you're just doing -xtset- so that you can do analyses that appropriately accommodate nested observations, the time variable is unnecessary.

        Comment


        • #5
          Question was also posted at http://stats.stackexchange.com/quest...ith-panel-data

          Please note our policy on cross-posting which is that you should tell us about it: http://www.statalist.org/forums/help#crossposting

          Comment

          Working...
          X