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

From |
Nick Winter <nwinter@virginia.edu> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: Graph note label ("Graphs by") |

Date |
Mon, 09 Nov 2009 09:28:11 -0500 |

Note the placement of the two notes in this command: sysuse auto

That is, the -note()- for the overall graph is a suboption of -by()- - Nick Winter Philip Jones wrote:

Hi,I have a follow-up question to a question answered helpfully by peopleon this list a few days ago.My goal is simply to put a P value on a graph either in a text box or inthe caption using *code*, not the Graph Editor.I have a graph with one plot region with two separate graphs, based onthe value of a certain grouping variable.At the bottom of the graph, there is a note stating "Graphs by..."followed by the variable's label. I would like to replace this whole bitof text with the P value, but I cannot find out how. Each time I try toadd a note or caption, the note or caption is repeated for each"instance" of the graph (see example code below). The text I want toreplace is the "Graphs by..." bit. That is, instead of " P = 0.5"showing up below each graph in the code snippet below, I would like itto replace the very bottom text.Does anyone know how to do this? Many thanks! Phil Jones Code to replicate the issue: -------------------------------------- clear * input group ease 1 1 1 2 1 3 1 3 1 3 1 3 1 4 1 5 1 5 2 2 2 2 2 2 2 3 2 3 2 4 2 4 2 5 2 5 end label variable group "Group to which the patient was randomized" label define group 1 "GSS" 2 "Malleable" label values group group graph twoway ///(histogram ease if group==1, by(group, legend(off)) discretefrequency xtick(1(1)5) xlabel(1(1)5) ymtick(##5) gap(5) color(navy)) ||///(histogram ease if group==2, by(group) discrete frequencyxtick(1(1)5) xlabel(1(1)5) gap(5) color(maroon) note("P = 0.5"))* * 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/

-- -------------------------------------------------------------- Nicholas Winter 434.924.6994 t Assistant Professor 434.924.3359 f Department of Politics nwinter@virginia.edu e University of Virginia faculty.virginia.edu/nwinter w PO Box 400787, 100 Cabell Hall Charlottesville, VA 22904 * * 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/

**References**:**st: Graph note label ("Graphs by")***From:*Philip Jones <pjones8@uwo.ca>

- Prev by Date:
**st: AW: Keeping variable After restore** - Next by Date:
**st: AW: Keeping variable After restore** - Previous by thread:
**st: RE: Graph note label ("Graphs by")** - Next by thread:
**st: re: referencing eresult matrices** - Index(es):

© Copyright 1996–2023 StataCorp LLC | Terms of use | Privacy | Contact us | What's new | Site index |