Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

st: RE: Labeling Graphs

From   "Nick Cox" <>
To   <>
Subject   st: RE: Labeling Graphs
Date   Thu, 1 Apr 2010 19:50:49 +0100

As someone who stopped any pretence to being a gentleman once past my

One good way to approach this is by adding an extra option. 

legend(order(2 "<stuff>" 3 "<stuff>" 4 "<stuff>")) 

The first variable plotted on your graph is the response. The 2nd, 3rd,
4th variables are the fitted values. Plug in the text you need. 


Jeffrey B. Wolpin

Ladies, Gentleman, Phds., and everyone on the list way smarter than me,

In Stata 10:

I went to the reference material but could not figure out the following:

Rather than go into the graph editor to label a graph, what would be the
syntax to save that step.

For instance:
I ran a quantile regression.  The following graph syntax does not label
the fitted lines by each quantile .25, .5, .75.

graph twoway scatter discount marketvalue || line pred25 marketvalue ||
line pred5 marketvalue || line pred75 marketvalue

The syntax above merely labels each quartile as "Fitted Value" w/o
identifying the quartile. I would prefer to label each quartile fitted
line specifically as "0.25 Quartile Fitted Value", "0.50 Quartile Fitted
Value", & "0.75 Quartile Fitted Value"

*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index