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]

st: Re: Axis label


From   Arti Rayit <[email protected]>
To   [email protected]
Subject   st: Re: Axis label
Date   Wed, 13 Apr 2011 10:12:20 +0100 (BST)

I have a dataset which has a str5 variable 'parm' of the form 1-2, 1-3, 1-4 etc 
and I want to use this as the variable on the x axis of a twoway scatter plot. I 
have converted this to numeric:

encode parm,gen(id) label(parm)
twoway (scatter qvs id), xlabel(, valuelabel)

but the new variable has the sort order based on parm:
 parm   estimate          p         qvs   sid   id |
     |----------------------------------------------------|
  1. |   1-2   125.5616   3.83e-29       .0001     1    3 |
  2. |   1-3   125.5616   3.83e-29       .0001     2    4 |
  3. |   1-4   125.5616   3.83e-29       .0001     3    5 |
  4. |   1-5   125.5616   3.83e-29       .0001     4    6 |
  5. |   1-6   125.5616   3.83e-29       .0001     5    7 |
     |----------------------------------------------------|
  6. |   1-7   125.5616   3.83e-29       .0001     6    8 |
  7. |   1-8   125.5616   3.83e-29       .0001     7    9 |
  8. |   1-9   125.5616   3.83e-29       .0001     8   10 |
  9. |  1-10   125.5616   3.83e-29       .0001     9    1 |
 10. |  1-11   125.5616   3.83e-29       .0001    10    2 

which means the first plotted variable is 1-10 rather than 1-2.

How can I sort this so that the plot sequence is 1-2, 1-3 etc.

I am using Stata 11.

Thank you,
Arti


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


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