Statalist The Stata Listserver


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

RE: st: Join String Variables


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: Join String Variables
Date   Sun, 19 Nov 2006 17:54:41 -0000

Note that this won't work, as -egen- never -replace-s. 

If you did want to overwrite -Var3-, 

egen temp = concat(Var1 Var2 Var3) 
replace Var3 = temp
drop temp 

Nick 
[email protected] 

Robert A Yaffee

> Try egen Var3=concat(Var1 Var2 Var3)

Socrates Mokkas
 
> > 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.
> > Thanks a lot.

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