Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: using outcome of the command "list"


From   Md Alauddin Majumder <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: using outcome of the command "list"
Date   Tue, 20 Aug 2013 04:23:09 +0000

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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index