Home Forums ASDOC : Easy Publication Quality Tables in Stata bysort prefix with date format in asdoc messes up the date order

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • Dr. Aamina Khurram
    Guest
    Post count: 118

    Hope you are doing well with your endeavors. I have greatly benefited from your asdoc program in Stata and have used this in my first research paper. While using it again I came across a little query and was not able to resolve.

    I am running the follow command in Stata but the dates are not shown in their quarterly formats rather they get the random numbers:

    bys Time_period:asdoc sum var1

    when I use the same code without asdoc command, the dates are shown in their proper format like 2019q1, 2019q2 etc.

    bys Time_period: sum var1

    I believe this is something that asdoc fails to pick up and present in its proper format.

    It would be kind enough if you can clarify this bit.

    Thanking in anticipation

    Attaullah Shah
    Keymaster
    Post count: 69

    Assalam-O-Alaikum

    Thanks for your email and kind words. Can you please send a sample of your data to reproduce the error.

    Aamina Khurram
    Guest
    Post count: 118

    Dear Dr Attaullah Shah

    Please find enclosed the Stata example file for my data.

    The code that I am running is :

    bys Time_period: asdoc sum Lerner_w

    Attaullah Shah
    Keymaster
    Post count: 69

    Since Stata treats date variables as numeric, asdoc reports the numeric variable without formating it as a Stata date. I think it can be fixed sometime in future, but at the moment, the trick is to convert the date variable first to a string and then use it with asdoc, like this

    tostring Time_period, gen(time) u force
    bys time:asdoc sum Lerner_w
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.