Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: Tempvars with ylabel

From   "Michael Blasnik" <>
To   <>
Subject   st: Re: Tempvars with ylabel
Date   Tue, 8 Jun 2004 14:46:53 -0400

ylabel and xlabel both want a list of numbers -- they do not accept variable
names.  If you put the value of the mean in a local macro, you can use that
as an argument.  The reference line could also be drawn with yline and using
the value of the mean in a macro. you don't need to use a variable and
include it as a avriable, but of course Stata will graph a constant if you

Michael Blasnik

----- Original Message ----- 
From: "Doug Simmons" <>
To: <>
Sent: Tuesday, June 08, 2004 2:35 PM
Subject: st: Tempvars with ylabel

> Is it possible to use tempvars (or some other Stata variable) to specify
> values with the -ylabel- command? I have tried
> -tempvar Mean-
> -ylabel(`Mean', axis(2))-
> but it gives me the error
> "invalid label specifier, :  __000000:".
> It appears to be evaluating to the macro name, but not the stored
> value. I have tried using compound quotes, but get similar results.
> I am attempting to build a .do file that will automate the graphing of
> data that varies such that `Mean' could be different at each run of the
> file. I use -graph twoway line `Mean'- to generate a reference line on
> my graph and it works as expected. It just doesn't seem quite right to
> me that I can use the temporary variable to draw the graph, but not to
> label it.
> Thank you for your assistance.
> Doug A. Simmons, MBA
> Director of Research and Statistics
> Larned State Hospital
> R.R. 3, Box 89
> Larned, Kansas  USA  67550
> 620-285-4562 voice
> 620-285-4579 fax
> *
> *   For searches and help try:
> *
> *
> *

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index