Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

st: Removing the overall variable label and using only variable value in sts graph

From   Tim Evans <>
To   "''" <>
Subject   st: Removing the overall variable label and using only variable value in sts graph
Date   Fri, 24 Feb 2012 09:13:53 +0000

Hi all,,

I'm using Stata 11.2 and am creating and exporting some Kaplan Maier curves but I want to drop the variable label from the legend in my sts graph so that I only have the value rather than both.

For instance, if I run the following code:

webuse drug2
sts graph, by(drug)

I end up with a legend that shows drug = 0 and drug = 1

What I would like to do is drop the 'drug' and return only 0 or 1. There are many reasons for this, not least because if I have more than a few values in the variable, the legend becomes a little unwieldy and I also entitle the graph so that its clear what I'm graphing.

I've had a search around on Google but don't seem to be able to find exactly what I want. So any help gratefully received.

Best wishes

This email and any attachments hereto contains proprietary information, some or all of which may be confidential or legally privileged. It is for the exclusive use of the intended recipient(s) only. If an addressing or transmission error has misdirected this e-mail and you are not the intended recipient(s), please notify the author by replying to this e-mail. If you are not the intended recipient you must not use, disclose, distribute, copy, print, or rely on this e-mail or any attachments, as this may be unlawful.

*   For searches and help try:

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