Sometimes, data implicit in your data set needs to be made explicit. This can be achieved by computing a new variable. For example, in the slave trade data set, we have a variable called ‘men’ (originally called ‘menrat7’) which gives the percentage of the people embarked who were adult males. It might, under some circumstances, be useful to actually have the number of adult males embarked, rather than the fraction of slaves on the voyage. This can be achieved by computing a new variable, ‘nomen’ (number of men).
To compute a new variable, go to Transform and Compute Variable.
The compute variable dialog box will open. Enter the new variable name into the box at top left. You can move the variables of interest to the top right box using the right arrow, and enter the required function, in this case multiply (‘*’) using the keyboard or the pad on the dialog box.
Our new variable, ‘nomen’, is defined as our variable ‘number’ multiplied by the fraction of number who were adult males (‘men’). Once the variable is defined, click on OK. The new variable will be created as the rightmost variable in your data set.
There may be a few oddities to deal with. In the third entry down in the picture above, for example, what is 0.85 of a man? The answer lies in the rounding errors of both the original database and of the recomputation using SPSS. If you look at the numbers in the same case (line) you can see that we have multiplied 98 slaves embarked by 0.569892 as the fraction of adult males on board. To achieve an integer number of adult males we would need to multiply by around 0.57. The missing 0.15 of an individual is due to this slight inaccuracy.


