Statalist The Stata Listserver


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

Re: st: Join String Variables


From   "Svend Juul" <[email protected]>
To   <[email protected]>
Subject   Re: st: Join String Variables
Date   Sun, 19 Nov 2006 17:28:27 +0100

Socrates wrote: 
OK, I know how to split string variables but have not found a way to join string variables. Did a search but could not source something out. Can you direct me to a command? Or if not is there a way round it. I just want to put two or more strings in one even if missing values exist. For example,
 
obs     Var1     Var2    Var3       Var3
1          A        B       K        ABK
2                   C                  C
3          D               ED        BED
 
I have Var1 and Var2 and want to create Var3.
----------------------------------------
 
Assuming that you want to create var4 from var1, var2, and var3:
 
   generate var4 = var1+var2+var3
 
You might also want to study:
 
   help string functions
 
Hope this helps
Svend
 
________________________________________________________ 
 
Svend Juul
Institut for Folkesundhed, Afdeling for Epidemiologi
(Institute of Public Health, Department of Epidemiology)
Vennelyst Boulevard 6 
DK-8000 Aarhus C,  Denmark 
Phone, work:  +45 8942 6090 
Phone, home:  +45 8693 7796 
Fax:          +45 8613 1580 
E-mail:       [email protected] 
_________________________________________________________ 

*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index