Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down on April 23, and its replacement, **statalist.org** is already up and running.

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

From |
"Nick Cox" <n.j.cox@durham.ac.uk> |

To |
<statalist@hsphsun2.harvard.edu> |

Subject |
st: RE: AW: RE: line plot |

Date |
Mon, 10 May 2010 16:04:29 +0100 |

-collapse- as mentioned by Martin Weiss is fine too. The difference is that after -collapse- you need to retrieve your original dataset to do further analyses with it in the same session. Nick n.j.cox@durham.ac.uk Mareike Thank you Nick for your help. Using egen first solved the problem. Nick Cox There is a difference of principle here. -graph bar-, -graph dot- and -graph box- are reduction commands that typically show summary statistics derived from the data, rather the data themselves. (There are exceptions, flagged by -asis-.) On the other hand, most -twoway- commands, and those based on them, how the data directly. (There are exceptions, such as -histogram-.) Thus, for the most part, you need to do any reductions beforehand. Use -egen, total()- to calculate the sums beforehand. Note also -egen, tag()- to tag just one observation of each kind, in your case, one observation for each year. Mareike I'm working with panel data and I'm trying to plot the yearly sum of one variable for all countries over time. I was able to create a bar diagram for that purpose by using the command: graph bar (sum) variable, over(year). But actually I would prefer to present the numbers in form of a line plot: But all the commands I could think of (e.g. tsline, line, twoway connected, etc.) do not allow the sum-option, as far as I understand them correctly. It would be great if anybody of you would get up with an idea!? * * 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/

**Follow-Ups**:**st: AW: RE: AW: RE: line plot***From:*"Martin Weiss" <martin.weiss1@gmx.de>

**References**:**st: line plot***From:*mareikehahr@aol.com

**st: RE: line plot***From:*"Nick Cox" <n.j.cox@durham.ac.uk>

**st: AW: RE: line plot***From:*"Mareike" <MareikeHahr@aol.com>

- Prev by Date:
**st: AW: RE: AW: RE: AW: RE: AW: AW: RE: -ciplot- -eclplot- combine with box-options?** - Next by Date:
**st: RE: AW: RE: AW: RE: AW: RE: AW: AW: RE: -ciplot- -eclplot- combine with box-options?** - Previous by thread:
**st: AW: RE: line plot** - Next by thread:
**st: AW: RE: AW: RE: line plot** - Index(es):