[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Replace string values

From   David Kantor <>
Subject   Re: st: Replace string values
Date   Wed, 12 Mar 2008 15:07:05 -0400

At 01:54 PM 3/12/2008, Austin Nichols wrote:
replace table=table[_n-1] if mi(table)

On Wed, Mar 12, 2008 at 1:42 PM, sdm1 <> wrote:
> It's rather a coincidence would you undertake the reverse
> operation?

If you do this sort of operation a lot, you may want to try -carryforward-.

Though, on second thought, for this particular example, table was part of the key, and is partially lost. So, before you can run -carryforward-, you need to reconstruct a key -- which is the same as, or equivalent to restoring table. Notice that, once table has been partially wiped out, the dataset is in a precarious state: there is nothing to tie observations into appropriate groups aside from their present order. That's the reason behind Nick's suggestion to clone the table variable beforehand, and his warning about an "injudicious sort" afterwards.

But for those who may be interested in carryforward, see...
ssc desc carryforward
ssc inst carryforward


* For searches and help try:

© Copyright 1996–2019 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index