Statalist The Stata Listserver


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

st: Re: MIME-Version: 1.0


From   "Sergiy Radyakin" <Radyakin@aoek.uni-hannover.de>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: Re: MIME-Version: 1.0
Date   Tue, 20 Feb 2007 15:09:07 +0100

Hi!

var1 var2
1 .
2 .
3 .
. 1
. 2
. 3

gen var3=.
replace var3=var1 if var1!=.
replace var3=var2 if var2!=.

Regards,
Sergiy



----- Original Message ----- From: <jsilberm@sas.upenn.edu>
To: <statalist@hsphsun2.harvard.edu>
Sent: Tuesday, February 20, 2007 2:56 PM
Subject: st: MIME-Version: 1.0



Hi all,

I have a single variable that was erroneously split into several variables, and
I need to re-merge many variables into a single variable.

Within any single observation, just 1 of the variables to be merged has data in
it, and I need to get the data from all of the variables into a single
variable.

Short of lots of cutting and pasting, does anybody know exactly how to do this?

Apologies if this is a nav question; I'm a Stata novice.
*
* 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/
*
*   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