This article describes how to create stand-alone footers and customize them. The Sample Size Description updates based on new data updates and filters applied. You may want to use a sample size description widget when:
- You have a page with lots of outputs and you want to reduce clutter by deleting their individual footers.
- Your output doesn't have a footer generated for it automatically (as-is for visualizations without tests).
Requirements
-
A Complete Data Variable. This needs to be a variable which has missing values for any observations that are not shown on the page. Normally this will just be a variable used in the outputs, but you can choose any variable depending on what you want to describe.
-
If you want to report the sample size for the entire data set, an ID variable is a good idea.
-
If your outputs have varying base sizes, you may need to construct a variable which has the correct cases for the Complete Data Variable and customize the sample size widget using R code.
-
Please note these steps require a Displayr license.
Method
- From the toolbar, click Anything > Page Design > Sample Size Description.
- In the Complete data variable field (shown in the object inspector) select a variable (see requirements above). Whatever variable is selected will be used to compute the sample size, based on all responses without missing values.
- [Optional]: Select the filters applied to outputs on the page in the Filter(s) dropdown. This ensures the sample size shown will be adjusted for filtering.
- [Optional]: Select the weights applied to outputs on the page in the Weight dropdown. This ensures the sample size shown will be adjusted by the weight.
-
[Optional]: You can customize the wording and the formatting from the object inspector in the Initial text, Total sample description, Sample size description, and Final text fields.
- Check Automatic, if not already ticked. This ensures that whenever the data changes, including when a viewer applies a filter in View Mode, the sample size description will update accordingly.
- [Optional]: Use the Properties > Appearance menu to customize the background font color, font size, font style, border, etc. as desired.
Next
How to Customize the Sample Size Description Widget Using R Code
How to Show / Hide / Edit Captions for Tables and Charts
How to Add Custom Captions to R-based Tables, Visualizations, and Outputs