Ever review your data and wonder “What?! How did I get a mean of 2.13 on a 2-point scale?”

Surveys sometimes code special values like “Not asked” or “Don’t know” as integers like 9, -9 or 99. These can definitely throw off your analysis.

Here’s how to fix them in Protobi…

Recode special values

Recode special values to either missing (“[NA]”) or any non-integer value. That way they won’t count toward the mean.

Press the circle icon and from the context menu choose “Recode…”. This will bring up the recode dialog:

Here drag the special values, such as 9 in this case, to the blue “New code” button. You can enter [NA] which will recode these values as missing/blank values. Or you can enter a string like DK. Either way, it’s not a number so it won’t count toward the mean:

Here we can see the mean now falls between 1 and 2 as expected:

Format special values

After recoding we still see an entry for the old value even though it has 0% responses. This is because it’s still mentioned in the format.

To remove that, press the circle edit icon and from the context menu choose “Format…”. Within this dialog, press the ‘x’ to remove the entry for "9 - Don't know/Refused (VOL.)".

Result

You’ll now see the distribution with the correct mean and a human-readable display for the special value: