How to Delete Variables
There are a number of ways to remove variables in Q, and the method to use depends on your needs.
If you only want to prevent variables or questions from showing in your menus in Q (for example if there are a lot of junk variables stored in the data which you don't need for your analysis) you can do so by marking the variables as hidden by clicking the in the Tags column in the Variables and Questions tab. These variables can be returned again by toggling the tag.
Deleting constructed variables
Variables which have been created in Q as copies of other variables, or as formulas or filters, can be deleted by right-clicking them in the Variables and Questions tab and selecting Delete Copied or Constructed Variables. Note that if other variables depend on the variables that you want to delete then you will need to delete those other variables first.
Delete variables from the raw data
In some cases it is necessary to remove variables from the raw data entirely, for example if email addresses or other identifying information have been included in the data set (more details here). In this case a new copy of the data file must be created which does not contain these variables.
The first 2 steps below are very important! If you export directly from your current project all of your calculated variables will become hard-coded and your raw data structure may change.
You can do this in Q by:
- Opening a new blank version of Q.
- Go to File > Data Sets > Add to Project > From File, and when prompted select Use original data file structure.
- On the Variables and Questions tab, against all the variables you want to delete, click the H button in the Tags column.
- Select Tools > Save Data as SPSS/CSV File and save it to somewhere appropriate.
If you want to then use this modified datafile (with the deleted variables) in an existing project, select File > Data Sets > Update and import the modified data file.