Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: How to graph several mean trajectories and combine them in a single graph


From   Nick Cox <njcoxstata@gmail.com>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: How to graph several mean trajectories and combine them in a single graph
Date   Wed, 26 Feb 2014 00:08:18 +0000

Type

sort wave

before your graph command or add -sort(wave)- as an option.

Nick
njcoxstata@gmail.com


On 25 February 2014 22:19, Han-Jung Ko (Koko)
<kohan@onid.oregonstate.edu> wrote:
> Thank you both for the help.
>
> I did try your suggestions and did more research. I am able to now
> graph the dots of means of my variables of interest by wave in a
> single graph (i.e., means of pr_ and pl_). Here is my command:
>
> egen pl_m = mean(pl_), by (wave)
> egen pr_m = mean(pr_), by(wave)
> graph twoway dot pl_m pr_m wave
>
> However, when I tried to connect the dots using the following command:
> graph twoway connected pl_m pr_m wave
>
> it not only connects the dots but also draw a line from wave 1 dot to
> wave 5 dot for pr_ and pl_. Do you know how I can do to have only the
> dots connected for pl_ and pr_ separately but not a straight line from
> wave 1 to wave 5 datapoints?
>
> Hope the question is clear. I am sorry that I am not a native speaker.
>
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index