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]

Re: st: Dates in -graph bar-


From   "STOLOWY, Herve" <[email protected]>
To   [email protected]
Subject   Re: st: Dates in -graph bar-
Date   Wed, 12 Jun 2013 15:48:46 +0200

Dear All:

I forgot to mention the mean in the command line. Here it is:

graph bar (mean) var1 (mean) var2 if var3== 1, over (Year_Quarter)

I apologize for the second mail.

Best regards

Hervé

On Wed, Jun 12, 2013 at 2:31 PM, STOLOWY, Herve <[email protected]> wrote:
> Dear Statalisters:
>
> I have a question very similar to the one raised in:
>
> http://www.stata.com/statalist/archive/2010-04/msg00867.html
>
> I read the answer and some other threads on dates in graph
> (http://www.stata.com/statalist/archive/2011-10/msg00731.html) and do
> not find the answer for my problem.
>
> I want to make a graph with the command:
>
> graph bar Downgrade Upgrade if Crisis2 == 1, over (Year_Quarter)
>
> where Year_Quarter is formatted as  %tq. I have 8 quarters involved in
> the graphs (from 2007q1 to 2008q4).
>
> This produces a graph with the number corresponding to the quarter on
> the x-axis (from 190 to 197), rather than the actual quarter (e.g.
> '190' instead of '2007q1').
>
> How can I get the quarter to show up rather than the corresponding number?
>
> In the above mentioned thread, I read the solution. I do not
> understand why with a graph twoway, the label is by default the one I
> would like to have. With bar, it does not work by default. (But my
> graph cannot be twoway).
>
> I found the following solution:
>
> graph bar Downgrade Upgrade if Crisis2 == 1, over (Year_Quarter,
> relabel (1 "2007q1" 2 "2007q2" ... 8 "2008q4")).
>
> It works by it is painful. I was not able to use -mylabels-
> downloadable from ssc) to generate automatically the "relabel".
>
> Best regards
>
> Hervé
>
> ---
> Hervé Stolowy
> Professeur/Professor
> HEC Paris
> Département Comptabilité Contrôle de gestion / Dept of Accounting and
> Management Control
> 1, rue de la Liberation
> 78351 - Jouy-en-Josas - France
> Tel: +33 1 39 67 94 42
> mail: stolowy at hec dot fr
> web: http://www.hec.fr/stolowy
>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/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/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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