Statalist


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

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


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: Placing the content of 3 cells in 1 new cell?
Date   Mon, 5 Nov 2007 14:42:21 -0000

This is true, but the wrong way round. My -catenate- was superseded by
my   -egen, concat()- which then become official. Svend mentioned the
latter. 

Thus there is no need to install yet another user-written command when
exactly the same functionality (indeed more, if I recall correctly) is
already in official Stata. 

So why, you may ask, is -catenate- still available on SSC? Well, 
SSC is an archive and much stuff is there because it might be used
within other programs or do files, and/or be useful to people still
using old Statas. Over time the number of users may become very small,
including zero, but old stuff usually does no harm. 

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

Carter Rees

Nick Cox's -catenate- automates the generate command suggested by Svend.

ssc install catenate

catenate Drugs = Drug1 Drug2 Drug3, p(/)

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