<>
-contract- has a zero option that may be of use to you
*************
sysuse auto, clear
contract foreign rep78, zero
list, noobs
*************
You can transfer its output into Excel afterwards in no time via
*************
xmlsave "myfile", doctype(excel)
!start myfile.xml
*************
HTH
Martin
-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Rob James
Gesendet: Donnerstag, 16. April 2009 01:32
An: [email protected]
Betreff: st: Exporting simple counts from 3-way table
I am trying to genereate counts from a 3-way cross-classification of
variables into CSV, and eventually into EXCEL. I have many such 3 way
tables to make, with two variables (B (2 levels) and C (4 levels)) being
constant across a large set of variables (A) which represent the third
dimension. Of course, for any particular value of A, any particular
cross-classification with B & C may have a count of 0.
STATA clearly generates nice 3D tables on screen using the TABLE
command, and I have worked with the REPLACE option, but I am struggling
to find a way to produce
a dataset out of STATA that I can readily and quickly. For example,
the TABLE, replace option does not generate row when the
cross-classification yields 0 observations, making it very difficult to
cut and paste sections of data out of table, replace and put them into
the spreadhseet. TABLE, replace, also has a disconcerting habit of
switching the order of variables across various A values, further making
this messy and error-prone work.
I'd welcome any ideas. This must be very straight foward.
Thanks,
ROb
*
* 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/