Hi,
I am having difficulties of finding an efficient and less time-consuming way of replacing negative values from my variable list. What I have initially done is use the replace function but this was for a few variables. Now, I'm interested in dropping all negative values within my dataset i.e. 278 variables and 2,000+ observations. Could anyone advice me on what's the best way to do this?
I wasn't able to find an answer to this online, I came across the following commands recently but they do not work as my variables are not labelled as var1-varx...:
egen rmin=rowmin(var1 - var50)
drop if rmin<0
Many thanks for your help!
Rocio
I am having difficulties of finding an efficient and less time-consuming way of replacing negative values from my variable list. What I have initially done is use the replace function but this was for a few variables. Now, I'm interested in dropping all negative values within my dataset i.e. 278 variables and 2,000+ observations. Could anyone advice me on what's the best way to do this?
I wasn't able to find an answer to this online, I came across the following commands recently but they do not work as my variables are not labelled as var1-varx...:
egen rmin=rowmin(var1 - var50)
drop if rmin<0
Many thanks for your help!
Rocio
Comment