Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Richard Goldstein <richgold@ix.netcom.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | Re: st: Missing value= Help with gen command. |
Date | Thu, 05 May 2011 08:47:54 -0400 |
if you actually want the sum, use -egen- with the rowtotal function however, it is not clear where the "1" comes from in the paragraph starting "however" so maybe you mean something else? of maybe this is a simple typo? Rich On 5/5/11 8:38 AM, vikramfinavker wrote: > 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. * * 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/