This article describes how to create a complete data variable that can be used in a sample size description widget. We want the sample size description to note the sample size in outputs shown on the page, but sometimes the data shown on the page is not the total sample. In this case, we want to choose or create a variable that has missing data for any observations.
Normally your complete data variable would be the same variable as used in the output you want to describe. It's important to also apply the same filters and weights as applied to the output to the sample size description.
You can also create a separate variable to serve as your complete data variable that would have missing values for people who are not included on your page. For example, I have a page showing charts or tables only for the Males in my sample. In such a case, I can use the filter variable to define my sample.
Requirements
Please note these steps require a Displayr license.
A filter variable (for this example).
Method
- Select the filter variable in Data Sources > right-click > Duplicate.
- In the object inspector, click Data > Data Values > Missing values.
- For any categories that are not included in the sample, change the setting in the Missing Values column to Exclude from analyses, and click OK.
The new variable can be used as the Complete Data Variable in the sample size widget.
Next
How to Tag a Variable as a Filter
How to Add Customized Footers and Sample Size Widgets
How to Customize the Sample Size Description Widget Using R Code