Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Cardani Roberta <roberta.cardani@unicatt.it> |
To | "statalist@hsphsun2.harvard.edu" <statalist@hsphsun2.harvard.edu> |
Subject | st: R: Dropping Observations |
Date | Tue, 9 Nov 2010 18:10:03 +0100 |
drop var11 if (var11==var5) you need = = ________________________________________ Da: owner-statalist@hsphsun2.harvard.edu [owner-statalist@hsphsun2.harvard.edu] per conto di momo [mmsabra@gmail.com] Inviato: martedì 9 novembre 2010 17.58 A: statalist@hsphsun2.harvard.edu Oggetto: st: Dropping Observations Dear Colleagues I have a dataset with the following shape: var1.......var5......var10(which sum obs in var11)... var11 co. N......1203.........................3........ ........................ .................................................. .....................1450 .................................................. ......................1203 .................................................. ......................1620 co.N......etc so, I need to drop the observations in var11 which equal the unique value in var5. in the example above I want to drop the observations in var11=1203 that =1203 in var5 for each var1(company). I tries drop var11 if (var11=var5) but doesn't work and gives me, var11=var5 invalid name or type mismatch if I put == in addition how can I change the value of var10 to be 2 in the example above instead of 3 after dropping the observation that =1203 in var11. I.e to change the summation of var11, which var10=number of observations in var11. Thanks in advanced -- View this message in context: http://statalist.1588530.n2.nabble.com/Dropping-Observations-tp5721657p5721657.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/ * * 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/