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: R: Dropping Observations


From   Cardani Roberta <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: R: Dropping Observations
Date   Tue, 9 Nov 2010 18:10:03 +0100

drop var11 if (var11==var5)
you need = =

________________________________________
Da: [email protected] [[email protected]] per conto di momo [[email protected]]
Inviato: martedì 9 novembre 2010 17.58
A: [email protected]
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/


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