Dear Statalists,
I'd like to ask for your advice on the " keep if " command. My database uses a unique identifier for each person (such as: 123456 or 654467 or 987344). As I want to keep only 40 persons from my database of around 30.000 persons I cannot use the "drop if" commmand. It is not possible to use
, because the identifiers are spread throughout the whole file, so there is no uniformity. After reading the FAQ by Nick Cox "How do I select a subset of observations using a complicated criterion?" this made me use
keep if identifier == "123456" | id == "654467" | id == "987344"| , but this is very time-consuming.
Do you happen to have another approach to select a subset of observations? Thanks in advance, Mariska
I'd like to ask for your advice on the " keep if " command. My database uses a unique identifier for each person (such as: 123456 or 654467 or 987344). As I want to keep only 40 persons from my database of around 30.000 persons I cannot use the "drop if" commmand. It is not possible to use
Code:
list
keep if identifier == "123456" | id == "654467" | id == "987344"| , but this is very time-consuming.
Do you happen to have another approach to select a subset of observations? Thanks in advance, Mariska
Comment