Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

Re: st: how to repeat a value?


From   Richard Goldstein <[email protected]>
To   [email protected]
Subject   Re: st: how to repeat a value?
Date   Thu, 14 Jul 2011 15:43:46 -0400

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


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index