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

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


From   "David Fisher" <[email protected]>
To   [email protected]
Subject   st: Query: "Before-and-after" line graphs and the 'xtline' command
Date   Fri, 11 Mar 2005 11:33:10 +0000

Hi all,
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?
Thanks,
David Fisher.


*
* 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