This article describes how to create a new variable(s) that is standardized and will have an average of 0 for each respondent, will optionally have a standard deviation of 1 for each respondent. Please consider the data below:
For each column/variable in the data, this QScript will subtract the mean of the column from each entry and then divide by the standard deviation of the column to yield the following
- A Displayr document that contains Numeric - Multi or Binary- Multi variable sets.
To use this transformation:
- Select one or more Numeric - Multi or Binary- Multi variable sets in the Data Sets tree.
- Still in the Data Sets tree, either hover over any variable in your Data Sets tree > Plus (+) > Insert Variable(s) > Ready-Made New Variable(s) > Scale Variable(s) > Standardize Within Variable or else from the toolbar menu, select Anything > Data > Variables > New > Ready-Made New Variable(s) > Scale Variable(s) > Standardize Within Variable.
- OPTIONAL: If your document contains more than one data file you will be prompted to select the data file. Click OK.
- Next, you will be asked to select the variable sets you want to transform, click OK.
- For each selected variable set, a new R question containing the standardized data within the variable is created.