Statalist


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

st: Ungroup grouped data


From   Nikolaos Pandis <[email protected]>
To   [email protected]
Subject   st: Ungroup grouped data
Date   Mon, 28 Dec 2009 07:37:57 -0800 (PST)

Hi to all,

I have the dataset below which I would like to expand and list each observation in one row.

The counts variable shows the number of individuals with the outcome.
The cases variable shows the number of individuals that share the covariate pattern for the variables var1 and var2. 
The sum of cases (47) shows the total number of exposed individuals and the sum of counts (14) shows the total number of individuals,from the exposed, with the outcome.

The fully expanded dataset should list 47 observations (=sum of cases).

counts	cases	var1	var2
1	1	0	2
2	2	1	2
4	7	0	0
4	12	1	1
1	3	2	2
2	7	1	0
0	2	2	0
0	13	2	1

Your help would be appreciated.

Best wishes,

Nick


      
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index