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

st: AW: Exporting simple counts from 3-way table

From   "Martin Weiss" <>
To   <>
Subject   st: AW: Exporting simple counts from 3-way table
Date   Thu, 16 Apr 2009 13:58:51 +0200


-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


-----Ursprüngliche Nachricht-----
[] Im Auftrag von Rob James
Gesendet: Donnerstag, 16. April 2009 01:32
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.



*   For searches and help try:

*   For searches and help try:

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