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 |
RE: st: Re: Scatterplot of mean values |

Date |
Wed, 31 Mar 2010 13:31:31 +0100 |

-egen, tag()- is an automated way of getting Antoine's -ok- variable. (His method is certainly OK.) Nick n.j.cox@durham.ac.uk Antoine Terracol you could generate the means and then plot them sysuse auto, clear bysort rep78 : egen m_mpg=mean(mpg) bysort rep78 : egen m_weight=mean(weight) twoway scatter m_mpg m_weight here each observation contribute to the plot, which could thus take time to draw. You could limit yourself to one obs per group using bysort rep78 : gen ok=(_n==1) and then twoway scatter m_mpg m_weight if ok On 31/03/2010 13:55, Fernando Terrés wrote: > Martin, perhaps I didn't explain it correctly > Let us say that, in the auto.dta dataset, I want to plot the mean values > of mileage against the mean values of weight, both means grouped by > repair record. > I could do: > > ************* > sysuse auto, clear > collapse mpg weight, by(rep78) > twoway (scatter mpg weight) > ************* > > My problem is that I need to do the same task for several categorical > variables of a large file, and every collapse forces me to upload the > dataset again. * * 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: Re: Scatterplot of mean values***From:*Fernando Terrés <fernando.terres@upc.edu>

**Re: st: Re: Scatterplot of mean values***From:*Antoine Terracol <Antoine.Terracol@univ-paris1.fr>

- Prev by Date:
**st: RE: Re: Scatterplot of mean values** - Next by Date:
**st: -findname- available from SSC** - Previous by thread:
**Re: st: Re: Scatterplot of mean values** - Next by thread:
**Re: st: Re: Scatterplot of mean values** - Index(es):