normvar = (oldvar - minimum) / (maximum - minimum)
Hence you get a long way with the -summarize- command and r(min) and r(max).
However, in some cases you want to normalize to a wider range than appears in the data, e.g. rescale a variable that was coded 1-5 to 0-100, despite there not being units with either value 1 or 5. Maybe such cases exist in another pool, so you want to transform the variable in the same way. Again this is easy to do, but it may get tedious and make your syntax look ugly and confusing.
This is where the -norm- command may be of use.
Syntax
norm var [, replace generate(newvarname) scale(integer) maximum(integer) minimum(integer) [no]label]The default scale is 1, hence range: 0-1.
By default value 0 gets the label 'Minimum' and the maximum gets a label too. You can wipe the label using the option nolabel.
Examples
norm q89, scale(100) replacenorm q93, scale(20) max(5)