Statalist


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

Re: st: RE: using another variable as a label


From   Ashim Kapoor <[email protected]>
To   [email protected]
Subject   Re: st: RE: using another variable as a label
Date   Thu, 29 Jan 2009 16:56:42 +0530

Dear Roger and Nick,

I tried both your methods and they work great.Thank you. And yes Roger
my variable is an elapsed date, I had forgotten to mention it. You
guessed it right.

Thank you,
Ashim.

On Wed, Jan 28, 2009 at 8:19 PM, Nick Cox <[email protected]> wrote:
> This is a very common need and there are several user-written solutions
> for it. Ulrich Kohler mentioned my -egen- function -axis()- from
> -egenmore- (although then changed his mind) and Roger Newson mentioned
> his -sencode-.
>
> A command that is I think exactly what you seek is -labmask-.
>
> . search labmask
>
> FAQ     .  How to assign the val. of a var. as the val. labels of
> another var.
>        . . . . . . . . . . . . . . . . . .  UCLA Academic Technology
> Services
>        5/08    http://www.ats.ucla.edu/stat/stata/faq/labmask.htm
>
> Example . Code frag.: Hazard ratio of baseline char. by a dichotomous
> variable
>        . . . . . . . . . . . . . . . . . .  UCLA Academic Technology
> Services
>        12/06   http://www.ats.ucla.edu/stat/stata/code/display_hr.htm
>
> SJ-8-2  gr0034  . . . . . . . . . .  Speaking Stata: Between tables and
> graphs
>        (help labmask, seqvar if installed) . . . . . . . . . . . .  N.
> J. Cox
>        Q2/08   SJ 8(2):269--289
>        outlines techniques for producing table-like graphs
>
> reveals that the wonderful UCLA site contains two documents mentioning
> -labmask- and also that since those documents were written I have
> written up -labmask-'s application to graphs in the Stata Journal.
> Regardless of whether you subscribe to the Journal you should install
> -labmask- together with -seqvar- from the Stata Journal site.
>
> The code is also in the SSC package -labutil-, but installing from the
> SJ site is better.
>
> Nick
> [email protected]
>
> Ashim Kapoor
>
> I have a question. My dataset is like this.
>
> Matchscore   order             ymonth
> 200                 1                 1990m1
> 280                 2                 1990m1
> 290                 3                 1995m7
> 300                 4                 2000m3
> 251                 5                 2000m4
>
> This is just a small part of the dataset, but it kind of gives the
> message that ymonths are not evenly spaced and can be repeated ( this
> is the reason I would not graph this by ymonth). So I want to graph
> this by order but I want the corresponding values of ymonth displayed.
>
> I want to do  something like : -
> twoway ( line matchscore order )  , xlabel ( using ymonth in place of
> order for the xlabel )
>
> There is a clumsy way of pulling out the order values and ymonth
> values and making a numlist but I was hoping there is something better
> than this because I have to automate this process.
>
> *
> *   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/
>
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index