Statalist


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

AW: st: AW: simple question on two-way table


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   AW: st: AW: simple question on two-way table
Date   Tue, 17 Feb 2009 14:30:36 +0100

<> 

Several things: -tabstat- has a save option which leaves behind results if
you request it. Then you have to fend for yourself, with things like -ssc d
mat2txt-. 

Try -ssc d estout- instead. It has a subcommand -estpost tabstat- which does
what you want automatically...


*************
cap ssc inst estout

sysuse auto, clear
estpost tabstat price mpg rep78, by(foreign) ///
 statistics(mean sd) columns(statistics) listwise

esttab . using myfile.csv, main(mean) aux(sd) nostar unstack ///
   noobs nonote label replace
   
!start  myfile.csv
*************

You may want to finetune the call to -esttab- with the help of its
helpfile...

HTH
Martin


-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Shehzad Ali
Gesendet: Dienstag, 17. Februar 2009 14:11
An: [email protected]
Betreff: Re: st: AW: simple question on two-way table

Thanks, Martin. I tried:

bysort week: tabstat A B C D E F G H I J, stat(mean sd median min max) 
col(stat)

I get the summary which is presented for each week. Is there a way to 
export this into Excel so the summary stats for each week appear next to 
each other instead of how Stata shows it (as separate tables)?

Apologies for posting twice. I thought the first post didnt go.

Thanks,
Shehzad

On Feb 17 2009, Martin Weiss wrote:

>
><> 
>
>
>Look at -table- or -tabstat- with the -by- prefix or an appropriate -if-
>qualifier...
>
>
>
>HTH
>Martin
>
>-----Ursprüngliche Nachricht-----
>Von: [email protected]
>[mailto:[email protected]] Im Auftrag von Shehzad Ali
>Gesendet: Dienstag, 17. Februar 2009 13:27
>An: [email protected]
>Betreff: st: simple question on two-way table
>
>Hi,
>
>I have a simple question about tabulation of summary statistics.
>
> I want a table with summary statistics (mean, median, SD, minimum and 
> maximum) for 5 time points for 10 variables. The columns should show time 
> points (10 weeks, 20 weeks, 30 weeks, 40 weeks, 50, weeks) and rows 
> should reflect the variables (A through J). Each column should be 
> sub-divided into 5 sub-columns for each of the summary statistic. I want 
> the table to look like this (not sure if this will copy well in the 
> email).
> 
>
>            -------------------- Week 10 -------------------- 
>-------------------- Week 20 -------------------- ---.
>
>            Mean Median SD Min Max Mean Median SD Min Max
>
> 
>
>            
>
>A
>
>B
>
>C
>
>.
>
>.
>
>.
>
>J
>
>
>Can you help me with the best way to do this?
>
>Thank you,
>
>Shehzad
>
>*
>*   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/
>
>
>*
>*   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/
>



*
*   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/


*
*   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/



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