You may have some new variables that you'd like to add to your data after you've started creating your report. There are a variety of ways to do this depending on how you'd like to analyze your data and what type of data you want to add. If adding variables from an outside source, you can refer to updating and linking methods 1, 2, and 6 below. Ways of creating new variables using Displayr, are covered in the rest of the items.
-
Update the data set with a new, combined copy of the data file that includes the new variables. - This is best if you're planning on using these variables in banners or filters alongside your other variables. Typically you'd do this when merging in new questions in a tracking study data set (along with the new cases) and analysis/text coding done outside the software. Having all the variables in the same data set is the most flexible way to work with them in the document, however, there are other options below. You'll want to be sure these new variables are somehow merged into the original raw data file used in the document. Displayr has merge tools to help you with this:
- How to Combine Data Files by Adding New Records (this option will also add in any new/unmatched variables between the files)
- How to Combine Data Files by Adding New Variables
- Add the new data as a new data set in the document and link it to the original data set. - This method is typically used when working with a stacked version of the data alongside an unstacked version. There are some limitations and other guidance found in the article, How to Create Data File Relationships. You can also copy a variable from a linked data set with a one-to-one relationship using JavaScript, see How to Copy Variables Between Linked Data Sets.
- The quickest way to create a new variable is to Duplicate and modify an existing variable in the Data Sources tree. You can manually modify things like recoding categories, changing category labels, or converting a variable from showing percentages to averages in tables (or vice versa). However, there are also automations to do common modifications as well in the Modify Variable Sets section in the object inspector
(see below).
-
Most commonly, variables are created via the variable inserter menu, which is accessed via the + sign after selecting a variable in your data set.
This menu includes creating new variable(s) via the filtering tool, weighting tool, text categorization module, other data manipulation automations, and creating custom R and JavaScript variables with code. Other data manipulation automations include calculations across variables, converting variable structures, combining/binning categories, flagging for data quality, and more. - Many analysis outputs include a section in their object inspector
for Save Variable(s), such as saving Max Diff coefficients and categories from a List of Items analysis.
- You can paste the data into the Data Editor in Displayr. - This is how you can copy and paste data to Excel. Keep in mind, this is not an efficient way of adding the variable, as Displayr has to map each value to each case of the original data. If used a lot or on large data sets, this may cause performance issues.