How can I delete all observations containing a missing value?

User ForumHow can I delete all observations containing a missing value?
admin Staff asked 4 years ago

I have a matrix of observations and I would like to, in some cases, remove all of the rows in which there is a missing value for any of the variables. What is the easiest way to do this in GAUSS?

1 Answers
admin Staff answered 4 years ago

GAUSS has a function named 'packr' for exactly this purpose. The procedure name is short for "pack rows". If you have a matrix 'A' with missing values:

   newA = packr(A);

'newA' will be a copy of the original matrix 'A', but with all rows that contained a missing value removed.