There are different ways of removing categories from tables, and each has a different consequence as some (such as right click Hide and Delete) will change how the variable set is analyzed in all outputs, rather than just the table being modified. This article describes how to hide and remove categories from tables using different methods.
- Method - Removing categories and setting values as missing
- Method - Re-basing multiple response (Binary - Multi) variable sets
- Method - Hiding categories
- Method - Use a rule
- Special functionality using NETs and Combined categories
Requirements
A Displayr document with tables created from Nominal: Mutually exclusive categories, Nominal - Multi: Grid with unordered categories, or Binary - Multi: Non-mutually exclusive categories variable sets.
Method - Removing categories and setting values as missing
You can remove one or more categories from the table as well as exclude those from the base and analyses, via a table or Value Attributes. This method will change how the variable set is shown and analyzed in all outputs.
Using a table with a Nominal or Nominal - Multi variable set, select the category header(s) you want to remove, right-click > Delete simultaneously hides the category and recomputes the percentages in the table removing respondents choosing those categories from the base.
If you prefer, you can use the variable set's Value Attributes dialogue to perform the same action, select the variable set from the Data Sources tree and click on the Data > Attributes > Values & Labels button in Properties . Here, you can change the selections in the Missing Values column to Exclude from analyses to delete a category from the table. This is identical to using the Delete option described above.
You can undo changes from either method by pressing undo in the toolbar or by right-clicking any row on the table and selecting Reset > Table Categories.
Method - Re-basing multiple response (Binary - Multi) variable sets
When using Delete on a table created from a Binary - Multi variable set, you will sometimes see the NET drop below 100%. This is because some respondents will not have selected any of the responses in the question. One solution to this is to create a filter based on the NET and apply it to the table. This will ensure that the NET will be 100%. You can do this by:
- Expand the variable set in the Data Sources tree by clicking the small triangle to the left of the variable's name.
- Select all of the variables within the variable set except for the variable(s) that you are deleting.
- Go to Calculation
> Any of > Any of.
- This will create a new variable based on the NET. With the new variable selected, go to the Data tab in the Properties
and check Usable as a filter.
- You can then apply this filter to the existing table, which will then be based on the NET.
Method - Hiding categories
You can also right-click on a category in a table and select Hide to prevent it from being shown in the table, while still including it in the base and other analyses. This method will change how the variable set is shown and analyzed in all outputs. When you hide a category in this way, no change is made to the base going into Statistics on the table.
You can undo hiding by pressing undo , or right-clicking any row and selecting Reset > Table Categories (which returns the variable set to its original state).
Method - Use a rule
You can use a rule to hide empty rows and/or columns. To apply the rule, select the table, and from Properties, go to Data > Rules > + > Rows/Columns > Hide Empty Rows, Hide Empty Columns, or Hide Empty Rows and Columns. You can also write a custom rule using code similar to:
table.deleteColumn(table.numberColumns-1); // Delete last column
See How to Modify Table Rows and Columns using a Rule for more examples.
Special functionality using NETs and combined categories
To remove a NET or combined category using the right click menu, you should Hide the category rather than Delete because Delete will also remove the individual categories going into it. Additionally, the header will not reappear if you Reset > Table Categories (this only applies to the original categories). You will need to rebuild the the header using right click Combine or Create NET or by clicking Undo in the Info panel.
Next
How to Hide Rows and Columns with Small Sample Sizes in Tables and Visualizations
How to Hide Empty Rows and Columns in a Table or Visualization
UPCOMING WEBINAR: How to Hand Half Your Job to AI (the Right Half)