Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Missing value= Help with gen command.


From   Oliver Jones <ojones@wiwi.uni-bielefeld.de>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Missing value= Help with gen command.
Date   Thu, 05 May 2011 14:48:52 +0200


gen sum_of_a_b = A + B

gen byte dumab = (sum_of_a_b > 0) | (sum_of_a_b == .)


Best
Oliver


Am 05.05.2011 14:38, schrieb vikramfinavker:
HI all,

I am trying to generate new variable which is sum of A and B. i used:

gen dumab=0

replace dumab=1 if A+B>0

however my problem is that where A has value and B has missing value (.) it
gives me answer (.) but instead i want 1.

Could any one please help me with this.

Thanks a lot.

--
View this message in context: http://statalist.1588530.n2.nabble.com/Missing-value-Help-with-gen-command-tp6334141p6334141.html
Sent from the Statalist mailing list archive at Nabble.com.
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/

--
Universität Bielefeld
Fakultät für Wirtschaftswissenschaften
Lehrstuhl für Ökonometrie und Statistik
- -
Bielefeld University
Faculty of Business Administration and Economics
Chair of Econometrics and Statistics
- -
Raum / room:  V9-110
Tel / phone:  +49 (0)521 106 4871
---
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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   |   Site index