Statalist


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

Re: st: Replace string values


From   "Austin Nichols" <austinnichols@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Replace string values
Date   Wed, 12 Mar 2008 13:54:00 -0400

Try
replace table=table[_n-1] if mi(table)

On Wed, Mar 12, 2008 at 1:42 PM, sdm1 <sdm1@york.ac.uk> wrote:
> It's rather a coincidence but...how would you undertake the reverse
> operation?  That is, I need to fill in the 'gaps' and go from:
>
> >   +---------------------------+
> >   |     table   quarter     n |
> >   |---------------------------|
> >   | qtr_a.dta         1   128 |
> >   |                   2   129 |
> >   |                   3   128 |
> >   |                   4     4 |
> >   | qtr_b.dta         1   130 |
> >   |                   2   129 |
> >   |                   3   130 |
> >   |                   4     5 |
> >   +---------------------------+
>
> to
>
> >      qtr_a.dta         1   128
> >      qtr_a.dta         2   129
> >      qtr_a.dta         3   128
> >      qtr_a.dta         4     4
> >      qtr_b.dta         1   130
> >      qtr_b.dta         2   129
> >      qtr_b.dta         3   130
> >      qtr_b.dta         4     5
>
> Thanks.
>
> Steve
>
*
*   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