Announcement

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

  • How to change the storage type of an hourly-based date variable

    Hi everyone,

    I work with hourly panel data (format %tc) which can only be stored in double format. However, when I try to run xtdidregress I get the following error:

    xtdidregress (consumption) (receivedher) , group(clientid) time(date) vce(cluster clientid)

    date: factor variables may not contain noninteger values
    r(452);

    Any thoughts on how to deal with this?

    Best,

    Ioannis

  • #2
    A date-time variable in Stata is mathematically an integer, but as you know it's strongly recommended to hold such date-times in double storage type as those integers can be very big, often in quadrillions. (double isn't a format.)

    I can't advise on why xtdidregress doesn't like those values. But it may be that dividing by 60000 and possibly using a different time origin allows a different storage type. Together with revisiting the xtset that may yield a work-around.

    Comment


    • #3
      Thank you!

      Comment

      Working...
      X