Statalist The Stata Listserver

[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Dropping/Keeping observations

From   "Michael Blasnik" <>
To   <>
Subject   Re: st: Dropping/Keeping observations
Date   Sat, 22 Apr 2006 10:25:24 -0400

This approach will also drop the multiple observations for all of the other farmerIDs. Why not just:

bysort farmerID: drop if _N==1

Michael Blasnik

----- Original Message ----- "Maarten buis" <> wrote:

*---------begin example------------
sysuse auto, clear
replace rep78 = 10 in 10 /*create a unique value in rep78*/
sort rep78
list rep78 in 1/10
by rep78: keep if _n==_N & _N>1 & rep78 <.
list rep78
*----------end example--------------

--- Gauri Khanna <> wrote:
I would like to KEEP those plots/observations
where farmerID appears more than once. Hence, I would like to DROP those
observations which have only one farmerID. Any tips?
*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index