Bookmark and Share

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: How to save cell values in the tabulate twoway output?


From   Bo Rud <[email protected]>
To   [email protected]
Subject   st: How to save cell values in the tabulate twoway output?
Date   Thu, 17 Mar 2011 00:23:59 +0100

I have a problem with the handling of data resulting from a dichotomous test performed by 53 observers in 102 patients. My data set consists of the 53 observers' assessments as well as the true diagnosis in the coloumns (variables). The data set has 102 rows corresponding to the number of patients assessed by each of the observers.

patient  obs1  obs2 ... obs53  diagnose
1
2
..
102

I use the following commands to generate 2x2 tables with numbers of true-positive(tp), false-positive(fp), false-negative(fn) and
true-negative(tn) test outcomes for each observer:

forvalues i = 1/53 {
tab obs`i' diagnose
}

I would like to save the cell values in the tab output for further analysis, but I can't find a way to do it.
My ambition is to generate a new data set with the following structure:

Obs tp fp fn tn
1
2
..
53

I'm aware of the matcell-option with tab, but the programing it entails appears beyond my level of expertise.
Is there an easier way around?

Bo Rud
*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index