Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE : RE: RE: Add variable value on a graph


From   [email protected]
To   [email protected]
Subject   st: RE : RE: RE: Add variable value on a graph
Date   Thu, 28 Aug 2008 09:57:26 +0200

Thank you Nick.
Your suggestion 

foreach ID of local IDS { 
	su BMI if id == `ID', meanonly  
	line hem time, t1title(`r(min)') 
}

seems the only one which allows to display a changing value for each subject.

Alvine

-----Message d'origine-----
De : [email protected]
[mailto:[email protected]] De la part de Nick Cox
Envoy� : 27 August 2008 15:58
� : [email protected]
Objet : st: RE: RE: Add variable value on a graph


The persuasion Martin suggests is unnecessary. You can add text to a
-line- graph using 
-text()-. Or you can put the same text in a title or the legend. 

Here is a dopey example. 

. sysuse auto

. sort weight mpg

. line weight mpg, text(3000 25 "some text")

If Alvine's problem were mine, I'd probably use -t1title()-. This is best
done as a loop, e.g. 

levelsof id, local(IDS)

foreach ID of local IDS { 
	su BMI if id == `ID', meanonly  
	line hem time, t1title(`r(min)') 
} 

Nick 
[email protected] 

Martin Weiss

If you could be persuaded to use a -scatter- instead of -line-, then -help
scatter##marker_options- shows that you can add the value of a variable of
your choice to the marker symbols...

[email protected]

I would like to create a graph with  repeated values of hemoglobin versus
time (0,1,2,6 and 12 months) for each subject of my data .

 gr twoway (line hem time) if id==1

I have a variable "BMI" in my data base which gives the BMI of each subject.
I would like to add the value of BMI on each graph for each subject (as
legend) .
Is it possible to add on a plot the value of a variable ?

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