Bookmark and Share

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, is already up and running.

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

Re: st: summarize, store multiple means?

From   Nick Cox <>
Subject   Re: st: summarize, store multiple means?
Date   Wed, 29 Jun 2011 09:20:16 +0100

There is no way to change the behaviour of -summarize- here.

You can set up your own loops or use Mata or use -tabstat- (see also
-tabstatmat- from SSC) or ....


On Wed, Jun 29, 2011 at 9:09 AM, D-Ta <> wrote:

> I would like to simply store multiple means as generated by the summarize
> command:
> sum var1 var2 .. var100
> matrix averages=r(mean)
> However, only the mean of the last (var100) is stored in that matrix. Is
> there anyway to store all the means or do I have to loop over all variables
> and store each mean value seperately in the matrix column?
> Ultimately, I would like to run a command like:
> bys sex: sum var1 var2 .. var100
> and store two set of means in two matrix columns, but I assume accessing
> r(mean) after that command would, again, only give me the very last mean
> entry.
*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index