Announcement

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

  • Dates in tables with stata 17

    I have a quarterly date variable, x. I can set it up as quarterly using z=qofd(x) and then format %tq z. This converts it into annual/quarterly form when I look at the data using the variables manager. But when I try to tabulate the date using table z to find the number of observations in each date, it comes out as an integer-- the number of quarters since 1960q1. Does anyone know how I can set it into annual/quarterly form in the table, please?
    Martin Weale

  • #2
    Is your Stata 17 fully up-to-date?

    Here is a short example where I'm getting the expected row headers from table.
    Code:
    sysuse auto
    set seed 17
    gen z = runiformint(100,110)
    format %tq z
    table z
    Here is the reported table.
    Code:
    . table z
    
    ---------------------
             |  Frequency
    ---------+-----------
    z        |           
      1985q1 |          7
      1985q2 |          3
      1985q3 |          4
      1985q4 |          3
      1986q1 |          7
      1986q2 |         12
      1986q3 |         12
      1986q4 |          8
      1987q1 |          8
      1987q2 |          4
      1987q3 |          6
      Total  |         74
    ---------------------

    Comment

    Working...
    X