Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Md Alauddin Majumder <mm4v@mtmail.mtsu.edu> |
To | "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu> |
Subject | RE: st: using outcome of the command "list" |
Date | Tue, 20 Aug 2013 04:42:37 +0000 |
Eric, thanks for your reply. Actually I want to fill 'NewID[1]' by Wyoming's IDnumber. Majumder ________________________________________ From: owner-statalist@hsphsun2.harvard.edu [owner-statalist@hsphsun2.harvard.edu] on behalf of Eric A. Booth [eric.a.booth@gmail.com] Sent: Monday, August 19, 2013 11:33 PM To: statalist@hsphsun2.harvard.edu Subject: Re: st: using outcome of the command "list" <> bys IDnumber: replace NewID = IDnumber[1] On Mon, Aug 19, 2013 at 11:23 PM, Md Alauddin Majumder <mm4v@mtmail.mtsu.edu> wrote: > Dear Statalist, > I have a data set like the following: > > IDnumber State NewID > > 1 Alabama . > 2 Alaska . > .. .... ... > .. .... ... > .. .... ... > 52 Wyoming . > > If I input -list IDnumber if State=="Wyoming"-, the outcome will be '52'. Now I want to replace missing value in the first cell of the variable NewID by this outcome. How can I write code for that? > > I tried the following but it did not work: replace NewID[1]=list IDnumber if State=="Wyoming". > > Any help will be greatly appreciated. Thanks in advance. > > > Regards > Majumder > > > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/faqs/resources/statalist-faq/ > * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/faqs/resources/statalist-faq/ * http://www.ats.ucla.edu/stat/stata/