You can use scripts to carry out arithmetic operations on the result of other arithmetic operations, and display the result (and, if you wish, hide any intermediate operations). Scripts can return a number (e.g. weighted counts or unweighted counts) or a string (such as displaying a custom text or message to indicate that something is significant).
To access this dialog, in the calculation properties window click script.... Note that the script... button is available only for "script" calculation types.
You should enter the script details directly into the dialog (see below for details). For example, the following script calculates the percentage of the impact of the weighting on the frequencies:
.png?Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9kemY4dnF2MjRlcWhnLmNsb3VkZnJvbnQubmV0L3VzZXJmaWxlcy8xMTAwLzMzMjkvY2tmaW5kZXIvaW1hZ2VzL2NhbGN1bGF0aW9uJTIwYXJpdGhtZXRpYyUyMHNtYWxsKDEpLnBuZyIsIkNvbmRpdGlvbiI6eyJEYXRlTGVzc1RoYW4iOnsiQVdTOkVwb2NoVGltZSI6MTc2NzM0ODExMH19fV19&Signature=P2IHAiZhAkk-bokcc8LX9FxM7ZWS47os8rqhCN65HXFelH2pqNFh4P-aQC-3S6LvbWcbmi6pjiMZDyThIMHDsWwxgNzgRzJordvuSrmi-4XdEXk6vrVW6-LPzHuA4EaobqNqYDbz4NN~RLa09wTPZnYIrIH4Pb~0WRCZXLRh8MZARwTN0fsBsiSZtAftVxXr5le9HN4qwJw6R9C9f7aVGUMO-d1jIGpNaoFgp-uPQiBKM73cv1sZC5jeENR1JhlTg0mWXyUxM4Ba85NjajsHZyTQNU6~xhNgFfc1yhx3PCIUnDRivSsoYNhmTNF9CbxhiFj1iLTL-ZPPtyF6JITFaQ__&Key-Pair-Id=K2TK3EG287XSFC)
When you click OK, you are returned to the calculation properties dialog. To hide this calculation (which you may want to do when you are using it as an intermediary step in a larger calculation), simply ensure that hide this calculation (but leave it available for arithmetics or conditional formatting) is checked.
When entering your script, you can refer to other calculations by their name inside double quotation marks (which is recommended) or by using the numbers in the table at the bottom of the dialog (we do not recommend this method, however, because the list of calculations, and hence the numbers, can change). In our example above, we use Calc("Unweighted Percentage") to refer to the unweighted percentage, for example (we could also use Calc(2), but as noted, this is not the recommended method). You can quickly insert a reference to a calculation by double-clicking it in the list (e.g. double-clicking 1 places Calc(1) in the list).
If you select hide this calculation, you ensure your calculation will not appear in tables and charts, but it can still be used as the basis of further calculations (i.e. using other scripts), or in conditional formatting.
Several keywords are available to allow statistical functions:
Student
Khi2
Normal
NormalInv (the inverse of the normal distribution).
The Student and Khi2 keywords must be given a "degrees of freedom" parameter. For example, if you wanted to use the Z-score and obtain the probability that it is significant, you could use the following formula:
Normal (abs ( Calc("Z-Score") ) )* 100
You can also use calculation arithmetic as a string for visual representations of the frequencies with a formula like the following:
ForSum ("i",Calc(2)/4,"*")