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: label one variable using values from another variable when you have nonintegers


From   Nick Cox <[email protected]>
To   [email protected]
Subject   Re: st: label one variable using values from another variable when you have nonintegers
Date   Thu, 11 Oct 2012 19:29:39 +0100

-labmask- is from SJ. You are asked to say where it comes from.

You can't attach value labels to non-integers.

There are at least three work-arounds:

1.

gen xaxis2 = round(10* xaxis)

and plot in terms of -xaxis2-.

2.

Use -mylabels- (SSC) to generate the argument for an -xlabel()- option.

. mylabels 11 14 19 21, myscale(@/10) local(stuff)
1.1 "11" 1.4 "14" 1.9 "19" 2.1 "21"

3. Type in the bottom line above directly.


On Thu, Oct 11, 2012 at 7:07 PM, Felipe Benguria <[email protected]> wrote:

>       I have data that looks like the following and I want to make a
> graph using yaxis vs xavis data:
>
>
> "yaxis"  "xaxis"    "desired x axis to appear on graph (only as label)"
>
> 10          1.1           11
> 9            1.4           14
> 12           1.9           19
> 15           2.1           21
>
> Labmask, suggested in other posts, does not work, since I cannot assign a
> label for the second column using the third column, since the second column
> has non-integers.
>
> I have not been able to find an alternative, and would appreciate your help
*
*   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