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: RE: saving -tabstatmat- output as matrix/data
From
Nick Cox <[email protected]>
To
[email protected]
Subject
Re: st: RE: saving -tabstatmat- output as matrix/data
Date
Sat, 25 Jun 2011 07:58:07 +0100
Evidently, "Fernando" sent a private solution. He is clearly entitled
to do that, but the rest of us can have no idea what it was unless it
is explained
Nick
On Fri, Jun 24, 2011 at 5:54 PM, Enayetur Raheem
<[email protected]> wrote:
> Solved. Thanks to Fernando :)
Enayetur Raheem
> I was searching for a way to save -tabstatmat- output as a matrix so
> that I can transform it as data. Any suggestion would be much
> appreciated.
>
> Lets consider the Auto data:
>
> . sysuse auto, clear
>
> . tabstat price, by(foreign) stat(mean) save
>
> Summary for variables: price
> by categories of: foreign (Car type)
>
> foreign | mean
> ---------+----------
> Domestic | 6072.423
> Foreign | 6384.682
> ---------+----------
> Total | 6165.257
> --------------------
>
> What I want to achieve is to save the following output to a matrix (or
> any other way to make it the data)
>
> . tabstatmat price
>
> price[3,1]
> price
> Domestic:mean 6072.4231
> Foreign:mean 6384.6818
> Total:mean 6165.2568
*
* 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/