Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: st: RE: How to use catplot to display the time variable in date format
From
A Loumiotis <[email protected]>
To
[email protected]
Subject
Re: st: RE: How to use catplot to display the time variable in date format
Date
Wed, 23 Jun 2010 12:55:20 +0300
Nick and Johannes thanks for your help.
Nick: Your work-around is exactly what I need! -catplot- is a great
program and has really assisted me in making informative graphs!
Antonis
On Wed, Jun 23, 2010 at 12:06 PM, Nick Cox <[email protected]> wrote:
> I wouldn't modify -catplot- (SSC); it's good code....
>
> More seriously, your complaint is really with -graph bar- which is doing
> most of the work here. Although there may well be other solutions, this
> appears to be a reasonable work-around:
>
> gen time2 = string(time, "%tq")
> catplot response time2, percent(time) recast(bar) asyvars stack
>
> Nick
> [email protected]
>
> A Loumiotis
>
> How can I modify the catplot command to display the time variable in
> date format and not as numeric format?
>
> For example I'm using an example that Nick Cox has provided with a
> small modification to format the time variable as quarters:
>
> . set obs 1000
>
> . egen id = seq(), block(10)
>
> . egen time = seq(), to(10)
>
> . format time %tq
>
> . gen response = ceil(3 * runiform())
>
> . catplot response time, percent(time) recast(bar) asyvars stack
>
>
> But the catplot command above does not display the time variable in
> quarter format even though it has such format.
>
>
> *
> * For searches and help try:
> * http://www.stata.com/help.cgi?search
> * http://www.stata.com/support/statalist/faq
> * http://www.ats.ucla.edu/stat/stata/
>
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/