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

From |
oezguer.guererk@uni-erfurt.de |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: RE: Graphics with averages of variables (over other variables) |

Date |
Wed, 10 Jun 2009 13:15:23 +0200 |

Nick, this works! Thank you very much! Nick Cox schrieb:

The code you tried is undoubtedly wrong. It is quite inconsistent with the syntax specification. Some parts of the -graph- syntax allow datareduction on the fly, but not the -twoway- command.There are various ways to approach this. One of the easiest is to calculate your averages in advance. -egen mean()- in conjunction with -by:- or a -by()- option is in turn a convenient way to do that. In yourcase, the syntax sounds likebysort group period: egen mean = mean(myredpts)to be followed by a call to a graphics command. I think you should checkout -tsline- or -xtline-.Nickn.j.cox@durham.ac.ukoezguer.guererk@uni-erfurt.deI would like to create "twoway connected" graphics of a variable called"myredpts" on the Y-axis and the variable "period" on the X-axis."myredpts", however, should be averaged over several "subjects"belonging to the same "group", for each "period".I use the command: "twoway (connected mean(myredpts) period) iftreatment == 1, by(group)" which is apparently wrong because of the"mean"... If I skip mean and use only "twoway (connected myredptsperiod) if treatment == 1, by(group)" then stata draws in each periodseveral points for several subjects and connects them, I, however, wantStata to draw only one single data point for each group consisting of 4subjects in each period and connect these for the consecutive 20periods. * * 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/

-- Dr. Özgür Gürerk Lehrstuhl für Mikroökonomie & Laboratorium für experimentelle Wirtschaftsforschung (Microeconomics & Laboratory for Experimental Economics)

Tel: +49 361 7374561 Fax: +49 361 7374569 www.uni-erfurt.de/elab -- * * 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: Graphics with averages of variables (over other variables)***From:*oezguer.guererk@uni-erfurt.de

**st: RE: Graphics with averages of variables (over other variables)***From:*"Nick Cox" <n.j.cox@durham.ac.uk>

- Prev by Date:
**st: nlsur_elasticity estimates** - Next by Date:
**st: AW: nlsur_elasticity estimates** - Previous by thread:
**st: RE: Graphics with averages of variables (over other variables)** - Next by thread:
**st: nlsur_elasticity estimates** - Index(es):

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