One you have dropped a variable, or only kept a certain set of variables, it's gone. Thus if you had five variables belonging to the sq scale and you no longer wanted any of them, you could tell Stata to drop sq* which would cause Stata to drop every single variable with a name that began sq. In addition to things like if, by, and =, you can use the * as a wildcard. For example drop if condition=3 would also cause Stata to delete every case that belonged to the third condition. In addition to these modifiers, they can use the double equal sign = which will tell Stata to drop or keep cases where a certain variable is equal to the specified value. You'll notice from the examples above that the basic commands drop and keep took both less than and greater than type modifiers (as well as if). In this case you can also tell Stata to keep This will cause Stata to only retain the specified variables. If you have a giant data set and only want to keep one or two variables, it is a lot faster to do the opposite command. To drop entire variables, simply type drop If you used a criterion that does not apply to any of your variables, Stata simply drops 0 cases.
![stata does not equal sign stata does not equal sign](https://cdn.onlinewebfonts.com/svg/img_25284.png)
For example, if I was using an old dataset with three conditions and the third condition was not relevant to my latest batch of analyses, I might tell Stata to drop if condition>2 When you do this, the Results window will display, in green, the number of cases dropped.
![stata does not equal sign stata does not equal sign](https://www.ionos.co.uk/digitalguide/fileadmin/DigitalGuide/Screenshots_2020/does-not-equal-sign-excel-6.png)
In either case, the basic command is simply dropįrom there, you can specify what precisely you want Stata to drop. This can also be useful if you accidentally make a variable you don't want to. Stata makes it very easy to drop such clutter. Sometimes, especially in instances where you are acquiring the data set from a third party or doing new analyses on old data, extraneous cases or variables can cause unnecessary clutter.