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

st: how to create groups


From   "Radu Ban" <rban@nber.org>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: how to create groups
Date   Tue, 24 Sep 2002 11:50:50 -0400

I translated an excel dataset into Stata and now it looks like this

Group1        obs1
Subgroup1    obs2
<blank>        obs3
<blank>        obs4
  .........        .........
<blank>       obsn1
Group1        obs1
Subgroup2    obs2
<blank>        obs3
...............    ........                   
 <blank>     obsn2
............................
Groupk        obs1
Subgroupl    obs2
<blank>       obs3
                    .....
<blank>       obsns

I would like to transform this into:
Group1 Subgroup1         obs1
Group1 Subgroup1         obs2
.......... ..................
Group1 Subgroup2        obs
Group1 Subgroup2        obs
..........
Group1 Subgroup_n        obs
Group2 Subgroup_n+1    obs
Group2 Subgroup_n+1    obs
..............................


I know I could just do the changes in excel by copying and dragging
but I would like to learn how to do it in Stata.

Thanks so much,

Radu Ban



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