Statalist


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

Re: st: combining two text cells into one cell


From   Michael McCulloch <mm@pinest.org>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: combining two text cells into one cell
Date   Sat, 4 Oct 2008 11:09:47 -0700

Hello Dahlia,
You could try:
-------begin example--------
clear
set obs 3
gen var1="Microsoft"
gen var2="Gates"
gen var3=var1+", "+var2
list
-------end example--------
The comma and space between the quote signs are optional.
-gen- is an abbreviation for -generate-
-set obs 3- makes a new dataset with 3 observations.
Hope this helps,
Michael




Hi, I want to combine two txt fields into one.  For example, one field
has company names such as "microsoft" and the other had owner name
such as "Gates", and I want a third field that will combine the two
cells and produce "microsoft Gates."  Can anyone tell me how I can do
this in stata?

thanks. I appreciate your help.
dalhia
*
*   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   |   What's new   |   Site index