Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: reshaping a data file: cell frequency = number of rows in the new dataset


From   "G. ter Riet" <[email protected]>
To   [email protected]
Subject   st: reshaping a data file: cell frequency = number of rows in the new dataset
Date   Fri, 17 Dec 2004 01:12:18 +0100

Dear List members,
In the context of a diagnostic meta-analysis, I have data from 2x2 
tables (cells a thru' d, signifying true positives, false positives, 
etc). My file has a wide format and is perfectly suited for a meta-
analytic command like <metan a b c d, or>.
As a hypothetical example, suppose one of my studies (rows) contained 
the cell frequencies 1 2 3 4, for variables a, b, c, d, respectively.
How could I efficiently create another file (long format), based on 
these data, that looked like
1 1
1 0
1 0
0 1
0 1
0 1
0 0
0 0
0 0
0 0
where the 1st column signified a binary test result, and the 2nd 
column a binary outcome according to a reference standard (gold 
standard test).
Any help would be much appreciated.

Gerben ter Riet, Amsterdam

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   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