Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: how to repeat a value?


From   Nick Cox <njcoxstata@gmail.com>
To   "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu>
Subject   Re: st: how to repeat a value?
Date   Thu, 14 Jul 2011 23:59:47 +0100

See also

http://www.stata.com/support/faqs/data/missing.html

Nick



On 14 Jul 2011, at 20:43, Richard Goldstein <richgold@ix.netcom.com> wrote:

-replace var_name=var_name[_n-1] if var_name==""-

Rich

On 7/14/11 3:35 PM, Kresten Buch wrote:
Dear Stata experts,

I have a table generated from a website with two colums as below.

id    var_name
-------------------------
.    Area
185
187
190
201
.    Population
185
201
210
217
.    Education
165
167

And I would like to make it look like this version here below.

id    var_name
-------------------------
.    Area
185    Area
187    Area
190    Area
201    Area
.    Population
185    Population
201    Population
210    Population
217    Population
.    Education
165    Education
167    Education

I hope I explained myself?
Been looking for a answer for hours. Hope some of you can help me. Im
quite new to stata.

Thanks in advance
Kresten Buch
*
*   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/
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index