Statalist


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

st: RE: replacing some values in column A by the values from column B


From   "Ward Vanlaar" <wardv@trafficinjuryresearch.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: replacing some values in column A by the values from column B
Date   Tue, 5 Feb 2008 13:00:49 -0500

Try this:

replace materials=costmaster if materials==.|materials<0

Ward

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Oliinik,
Victoria
Sent: Tuesday, February 05, 2008 12:48 PM
To: statalist@hsphsun2.harvard.edu
Subject: st: replacing some values in column A by the values from column
B

Dear statalisters, 

Does anyone know whether (and how) I can get Stata to do the following:

I have a variable "materials" which contains a lot of missing and
negative values. Where values are missing, or negative, I want Stata to
take corresponding values from a variable "costmater" and replace them
in the column "materials".

Thanks 
Victoria



======================================================
LICOS Centre for Institutions and Economic Performance
Katholieke Universiteit Leuven
Deberiotstraat 34 - bus 3511, B-3000 Leuven, Belgium

Office:  03.21
ph ++32 (0)16 32 65 66
fax ++32 (0)16 32 65 99
Website: http://www.econ.kuleuven.be/licos/ 
 


Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm


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