You are not logged in. You can browse but not post. Login or Register by clicking 'Login or Register' at the top-right of this page. For more information on Statalist, see the FAQ.
while checking whether you've saved the dataset in memory.
Hi Nick,
I have a similar issue, but I want to drop the observations that has missing values in any of the variables. I have too many variables and I don't want to use the if option for all these variables. Do you know how to realize this?
I have a similar issue, but I want to drop the observations that has missing values in any of the variables. I have too many variables and I don't want to use the if option for all these variables. Do you know how to realize this?
Thanks!
I tried to use the code below, and find that there are 1302 obs with missing values. But it says no obs qualify. Do you know why this happened?
. missings dropobs, force
-missings dropobs- removes those observations that have missing values on all variables. You asked to remove observations with a missing value on any variable.
I suspect there is a way to do this with -missings-, but I'm not a user of that program and wouldn't know how. See my response in #7 which will do what you ask and is simple to implement.
Clyde Schechter is right on the main point. Here is the help for missings, with some emphasis added.
missings dropobs drops any observations that are missing on all values in varlist.
Creating entirely empty observations (rows) and variables (columns) is a habit of many spreadsheet users, but neither is
helpful in Stata datasets. The subcommands dropobs and dropvars should help users clean up. Conversely, there is no explicit
support here for dropping observations or variables with some missing and some nonmissing values. Users so minded will find
other subcommands of use as an intermediate step, but multiple imputation might be a better way forward.
It is easy enough to find out how to find out with missings which observations have any values missing, but the much older method explained by Clyde is good enough. .
-missings dropobs- removes those observations that have missing values on all variables. You asked to remove observations with a missing value on any variable.
I suspect there is a way to do this with -missings-, but I'm not a user of that program and wouldn't know how. See my response in #7 which will do what you ask and is simple to implement.
Clyde Schechter is right on the main point. Here is the help for missings, with some emphasis added.
It is easy enough to find out how to find out with missings which observations have any values missing, but the much older method explained by Clyde is good enough. .
Thanks, Nick. I was just confused why it won't delete the obs with missings. No the issue is solved. Thanks a lot!
Comment