This rule moves the marginal statistics in Statistics - Below so that they appear at the top of the table. You can choose to either move all statistics that are currently selected in Statistics - Below, or to choose a subset of statistics. New rows are created at the top of the table for each statistic, and the corresponding rows will be removed from the bottom of the table. You also have the option to shade the new rows that are added (which helps set them apart from normal table rows), and you can also choose to rename the rows for particular statistics.
Options
The options screen for this rule looks as follows:
Shade rows Adds color to the new rows in the table. When selected you will be able to choose a Primary color and Secondary color. The rows in the table will be shaded alternately.
Rename statistics Use this option to override the row names for statistics you wish to place at the top of the table. For example, with the selection above, the row which would normally be called the Average will instead be called Mean.
Always show sample size When this option is ticked, the rule will determine the most appropriate sample size statistic for the columns of each table (either Column n or Base n) and add it as the first new row above the main table. This means that if some of your tables should show Column n and some others should show Base n you can apply this rule once to all of the tables and it will intelligently choose the right statistic for each table.
Choose statistics to place at top When this option is ticked you can choose which statistics to move, and those statistics will be shown in the order that you choose. When this option is not ticked, all statistics from Statistics - Below will be migrated to the top of the table. The order of the rows will be the opposite of the order in which the rows are normally shown in Statistics - Below.
Examples
Technical details
This rule uses a number of tricks to move the numbers around in the table, and as a result there are some limitations to be aware of:
- This rule should not be used when generating charts by exporting to Office, or using Q's built-in charts. The formatting is not compatible with charts.
- When exported to Excel, the new rows will only contain as many decimal places as shown in the table in Q. This is different to the numbers from normal table cells, which always export with all of the decimal places that are available, even though only one or two may be shown (depending on what you show in Q).
- When exported to Excel, the new rows will occupy as many rows in Excel as there are statistics selected in Statistics - Cells. This means that if your table contains a number of statistics in Statistics - Cells, there will be several blank rows at the top of your Excel export.
How to apply this rule
For the first time in a project
- Select the table(s)/chart(s) that you wish to apply the rule to.
- Start typing the name of the Rule into the Search features and data box in the top right of the Q window.
- Click on the Rule when it appears in the QScripts and Rules section of the search results.
OR
- Select Automate > Browse Online Library.
- Choose this rule from the list.
Additional applications of the rule
- Select a table or chart that has the rule and any table(s)/chart(s) that you wish to apply the rule to.
- Click on the Rules tab (bottom-left of the table/chart).
- Select the rule that you wish to apply.
- Click on the Apply drop-down and choose your desired option.
- Check New items to have it automatically applied to new items that you create. Use Edit > Project Options > Save as Template to create a new project template that automatically uses this rule.
Removing the rule
- Select the table(s)/chart(s) that you wish to remove the rule from.
- Press the Rules tab (bottom-right corner).
- Press Apply next to the rule you wish to remove and choose the appropriate option.
How to modify the rule
- Click on the Rules tab (bottom-left of the table/chart).
- Select the rule that you wish to modify.
- Click Edit Rule and make the desired changes. Alternatively, you can use the JavaScript below to make your own rule (see Customizing Rules).
Next
Displayr: How to Show Below Statistics at the Top of a Table
Q: How to Show Only a Specified Number of Rows from the Top of a Table