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: Value labels won't show on box plot axis


From   Nick Cox <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: Value labels won't show on box plot axis
Date   Thu, 1 Aug 2013 11:00:00 +0100

This didn't work either in my experiments. Here's a replicable example
and a work-around:

. sysuse auto
(1978 Automobile Data)
. graph box foreign, over(rep78) yla(0 1, valuelabel)

. levelsof foreign , local(levels)
0 1

. foreach lev of local levels {
  2. local call `call'  `lev'  "`: label (foreign) `lev''"
  3. }

. mac li
<stuff>
_call:          0 "Domestic" 1 "Foreign"
_levels:        0 1

. graph box foreign, over(rep78) yla(`call')

In your case you want

forval i = 1/7 {
      local call `call' `i' "`: label (response) `i''"
}

The quotation marks are like piano practice. 10, 000 hours and it will
seem obvious.

If `i' refers successively to 1/7 then its value label is

`: value label (response) `i''

and that is a string so we need " " as delimiters

"`: value label (response) `i''"

Think of the ` ' and " " as like parentheses in elementary algebra.
Each left mark is a promise to put down a matching right mark.

Nick
[email protected]


On 1 August 2013 10:46, Walsh, Lee <[email protected]> wrote:
> Hello,
>
> I am box plotting a variable grouped by another.  I am telling stata to use the value labels for the y axis but it insists on showing the numerical values.  This is the command :
>
> graph box response if stimOn==1 & setNum==1, over(statementNum) cwhisker ytitle(Response to the statement) ylabel(1(1)7, valuelabel) title(Responses when stimulation is on in the first block)
>
> My understanding from reading this section of the manual is that using -ylabel(1(1)7, valuelabel)- should label the y axis from 1 to 7 in increments of 1 and use the value labels for the response variable.  The option -ylabel(,valuelabel) does nothing either.
>
> The value labels show up everywhere else (browse, list, etc).  I have read the manual, searched statlist but I can't find a solution.  What am I missing?
>
> Thank you for any help with this
> Lee.
>
>
> --
> Dr. Lee Walsh
> Institute of Cognitive Neuroscience
> University College London
> Ph: +44 20 7679 5431
>
>
>
>
>
>
>
> *
> *   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