Skip to main content

2.7 Removing variables from datasets

In an analysis situation there is often a need to remove some of the variables first imported, as they are considered irrelevant. For instance, some variables are used solely for the purpose of deriving values ​​for new variables, and are considered redundant after the particular operation is finished.

Streamlining a dataset is done through the command drop, where the name of the redundant variable is specified:

drop <variable>

As we have seen, the drop-command can be used both to remove units (= rows in the data matrix), see section 2.6, and variables (= columns in the data matrix).