Statalist


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

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


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: AW: simple question on two-way table
Date   Wed, 18 Feb 2009 11:36:01 -0000

The error message for -xml_tab- suggests some issue with your write
access, which you don't detail. 

I would expect that -tabstat- under the aegis of -by:- would save only
the last results it produced. So that is all that -tabstatmat- could
possibly see. Here is one test supporting that. Note that I don't get
the error message Shehzad reports. 

. sysuse auto
(1978 Automobile Data)

. by foreign : tabstat mpg, save

------------------------------------------------------------------------
---------
-> foreign = Domestic

    variable |      mean
-------------+----------
         mpg |  19.82692
------------------------

------------------------------------------------------------------------
-------
-> foreign = Foreign

    variable |      mean
-------------+----------
         mpg |  24.77273
------------------------

. ret li

matrices:
          r(StatTotal) :  1 x 1

. tabstatmat foo

symmetric foo[1,1]
            mean
Total  24.772727

Nick 
n.j.cox@durham.ac.uk 

Shehzad Ali

Thank you, Martin, Neil and Austin. All the suggestions were very
helpful.

Here are quick follow-up questions for Austin:

1. Following the -tabstatmat- code, -xml_tab A, save(a.xls) replace-
gives 
me the following error:

-file can not be saved at this location-

Looking at the help file for xml_tab, it suggests closing Excel files
but I 
don't have any open.

2. When I tried:

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

tabstatmat a

I get the following error: - no tabstat results in memory-

Instead if I tried:

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

tabstatmat a

It worked. I don't why.


*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index