Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Dates in -graph bar-

From   "STOLOWY, Herve" <>
Subject   st: Dates in -graph bar-
Date   Wed, 12 Jun 2013 14:31:58 +0200

Dear Statalisters:

I have a question very similar to the one raised in:

I read the answer and some other threads on dates in graph
( 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é Stolowy
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

*   For searches and help try:

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