Statalist


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

Re: Re: st: Placing the content of 3 cells in 1 new cell?


From   n j cox <n.j.cox@durham.ac.uk>
To   statalist@hsphsun2.harvard.edu
Subject   Re: Re: st: Placing the content of 3 cells in 1 new cell?
Date   Mon, 05 Nov 2007 12:48:38 +0000

Svend's answer assumes that the variables in question
are string. If they were numeric variables with value labels,
use -egen, concat()- with the -decode- option.

Nick
n.j.cox@durham.ac.uk

Svend Juul
--------------------------------------------------------------------------------

Ziad wrote:

In Excel the person can have the content of 3 other cells in one cell,
for example

Drug1        Drug2         Drug3         Drugs
--------------------------------------------------------------
Panad        Asp          Val            Panad/Asp/Val

by typing:
drugs=drug1&"/"&drug2&"/"drug3

Is it possible to do something similar in STATA?

-----------------------------------------------------------------

yes:
   generate drugs = drug1 + "/" + drug2 + "/" + drug3
or:
   egen drugs = concat(drug1-drug3), punct(/)


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