Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: Query: "Before-and-after" line graphs and the 'xtline' command


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Query: "Before-and-after" line graphs and the 'xtline' command
Date   Fri, 11 Mar 2005 12:24:01 -0000

The whole area is discussed in excruciating detail 
in 

Graphing agreement and disagreement. 
Stata Journal 4(3): 329--349 (2004) 

This reveals some different approaches
to the problem, based on -pairplot- and -linkplot- 
from SSC. Among several other details, -pairplot- 
points to a useful reference 

McNeil, D.R. 1992. On graphing paired data.  
American Statistician 46, 307-11.

which contains a critique of the kind of graph 
you have in mind (although -linkplot- will
do most or perhaps even all of what you want). 

Nick 
[email protected] 

David Fisher

> I am working on a study where a group of women were measured 
> before and 
> after a month during which they were given a nutritional supplement 
> intervention.  I would like to create a graph with a line for 
> each subject 
> (overlaid on the same plot), joining their "before" and 
> "after" measurements 
> for a particular variable (blood vitamin B12, say).  I can do 
> this, roughly, 
> by using the "tsset" and "xtline, overlay" commands.
> What I am having trouble with, however, is controlling the 
> look of these 
> lines.  The nature of the "xtline, overlay" command seems to 
> be that you 
> have to alter each line individually using the "plopts#" 
> option.  Using a 
> local macro to create a huge line of text to alter each line 
> one after the 
> other doesn't work because would be "too many options".  Is 
> there a way to 
> change all the lines at once (specifically, I would like them 
> to be all the 
> same colour, or ideally one of 3 colours depending on their 
> supplement 
> category)?  E.g. can I say something like "plopts1/77()" 
> (this doesn't work, 
> by the way!)  Or, failing that, is there a completely 
> different approach to the problem?

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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