Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 65601

Drop all observations with negative values

$
0
0
Hi, I have been trying to delete all negative values from my dataset (instead of doing it by variable) using the below 2 approaches, but am ending up with 0 observations in each case.

APPROACH1

foreach v of var * {
drop if `v' < 0
}

APPROACH 2
egen rmin=rowmin(_all)
drop if rmin<0


Thanks in advance!


Viewing all articles
Browse latest Browse all 65601

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>