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

st: rearranging observations within a variable


From   "Daniel Mueller" <dm_lists@gmx.net>
To   "Statalist" <statalist@hsphsun2.harvard.edu>
Subject   st: rearranging observations within a variable
Date   Tue, 10 Feb 2004 17:16:59 +0100

Hi.

There's probably a neat trick to that, but can't find it...

I have one variable:
     +-----+
     | var |
     |-----|
  1. |   1 |
  2. |   3 |
  3. |   5 |
  4. |   7 |
  5. |   9 |
     |-----|
  6. |  11 |
  7. |  13 |
  8. |  15 |
  9. |  17 |
 10. |  19 |
     +-----+

The observations of this variable I want to rearrange to arrive at the following:
     +-----+
     | var |
     |-----|
  1. |   1 |
  2. |   . |
  3. |   3 |
  4. |   . |
  5. |   5 |
     |-----|
  6. |   . |
  7. |   7 |
  8. |   . |
  9. |   9 |
 10. |   . |
     +-----+
i.e. I have to -expand- the data set to get running observation numbers with missing values for observations, which were
previouly missing.

How can I do that??

Thanks a bunch in advance,
greetings,
Daniel



*
*   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