Sometimes it's necessary to remove respondents from a data set entirely. This article describes how to delete those cases (observations).
- Optional - Knowledge of how to create a filter in Q. See: How to Create and Use Filters
Cases are deleted on the Data tab. The Case ID must be set prior to deleting any cases (this is set using the dropdown at the top-left of the Data tab).
Right-click on the row(s) to be deleted and select Delete Row(s). With large projects that contain many variables, this can take a surprisingly long amount of time as Q checks the consequences of the deletion on every variable and every table in a project, so it is often better to delete using a filter.
Deleting cases using a filter
Create a new Filter and, in the Data tab, apply the filter, then right-click and select Delete Rows Matching Filter (Green). If deleting large amounts of data, it is often advisable to delete them in the data file.
Deleting cases from the raw data
If you want to delete variables that are in a raw data file, you can do this by:
- Open a new instance of Q.
- Import the data file via File > Data Sets > Add to Project, selecting No to any questions.
- Delete the cases using one of the methods described above.
- Select Tools > Save Data as SPSS/CSV File and save it to somewhere appropriate.
- Select File > Data Sets > Update > select current data file in project.
- Select the file created at Step 4 and import the modified data file.
Restoring deleted cases in the raw data
If you want to "undelete" or restore deleted rows, you can do so as follows:
- Go to the Data tab.
- Right-click on any row header.
- Select Revert deleted rows.
- Select the rows that you want to restore in the Revert column or tick the Check/uncheck all checkbox to restore all deleted rows.
- Click Revert to restore the deleted rows.