next up previous
Next: About this document Up: No Title Previous: More data modification

Ignoring data

Most commands that require a list of variables can be given the if option to ignore some of the data. This is useful when comparing nested regression models to ensure that the same observations are used in each model. Suppose that there were some missing values in the alcohol variable (there aren't) and that you wanted to compare a model for tobacco and for tobacco adjusted for alcohol consumption. In order for the models to be nested the observations with missing alcohol consumption must be excluded from the first model. This is how to do it:

logistic case tobacco if alcohol!=.
Here . is the Stata code for missing values and != means ``not equal''.

Thomas Lumley
Wed Jan 22 09:16:46 PST 1997