Bookmark and Share

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]

Antwort: st: How to use catplot to display the time variable in date format


From   Johannes Geyer <[email protected]>
To   [email protected]
Subject   Antwort: st: How to use catplot to display the time variable in date format
Date   Wed, 23 Jun 2010 11:07:41 +0200

Dear Antonis,

you have to label your time-variable, e.g. like:

***********************************************
 clear
 set obs 1000

 egen id = seq(), block(10)

 egen time = seq(), to(10)

 format time %tq
 
 label define test 1 "1960q1"   /* define a value label */
 label values time test
 
 gen response = ceil(3 * runiform())

 catplot response time, percent(time) recast(bar) asyvars stack

***********************************************


Johannes




[email protected] schrieb am 23/06/2010 10:38:58:

> Dear all,
> 
> 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.
> 
> Thanks,
> Antonis Loumiotis
> *
> *   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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index