Statalist The Stata Listserver


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

st: repeating strings


From   "MA V" <ma_v@hotmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: repeating strings
Date   Wed, 18 Oct 2006 02:03:11 +0000

Hello,
I believe that there is an easy answer for my problem but I can seem to find
it anywhere...
I have a table with the following format (this is a toy example where we
have the cities on which each person has lived in order - city1 is where
they lived first):

name city1 city2 city3
John  SF       .     .
John     .     Chi     .
John     .      .      LA
Mary      .      NY    .
Mary   Chi       .     .
...

What I would like to do is to fill in the missing values with the strings,
i.e. I would like to get at the end:

name city1 city2 city3
John   SF     Chi    LA
John   SF     Chi     LA
John   SF      Chi    LA
Mary   Chi      NY    .
Mary   Chi      NY     .
...

Any suggestions?
Thanks!

_________________________________________________________________
Stay in touch with old friends and meet new ones with Windows Live Spaces
http://clk.atdmt.com/MSN/go/msnnkwsp0070000001msn/direct/01/?href=http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us

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