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]
st: Table output from three variables
From
Haluk Vahaboglu <[email protected]>
To
"[email protected]" <[email protected]>
Subject
st: Table output from three variables
Date
Fri, 26 Jul 2013 22:35:56 +0000
Dear All,
Just a quick (and a simple) question.
I am using Stata 12.1 for Linux 64 bit.
I want to get a table from three variables, using one as row other as column and the third as the element of the matrix (table).
Data is something like:
Compound Year Amount
X 2009 5
X 2010 9
X 2011 2
Y 2009 3
Y 2011 8
want to get a table as:
. 2009 2010 2011
X 5 9 2
Y 3 . 8
This might be achieved via the "reshape wide.." command but could this be also possible without reshaping the data?
I cannot find an exact answer to my problem in help files, manuals, FAQ (there is one without an exact solution to my problem) and google search.
To a similar thread by AJ Medwick (http://www.stata.com/statalist/archive/2009-05/msg00337.html) Nick J Cox posted a solution"tab var1 var2 [aw=var3], matcell(matrix)" that gives an output which is not what I want.
I will appreciate any help
Haluk Vahaboglu
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/faqs/resources/statalist-faq/
* http://www.ats.ucla.edu/stat/stata/