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" <[email protected]>
To   <[email protected]>
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: <[email protected]>
To: <[email protected]>
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 na�v� 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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index