Code:
. ssc install nscale
If you are interested in rescaling variables to lie between 0 and 1, nscale alone can do almost anything you want--reverse coding, renaming variables, recoding some values to missing (e.g. exclude 99 as DK in survey questions).
Code:
newvar=var-min(var)/max(var)-min(var)
cf. N, the initial letter of nscale, is an abbreviation for normalization, which commonly refers to rescaling variables this way (at least in political psychology).
0 Response to nscale: new package for rescaling variables to run from 0 to 1 now available on SSC
Post a Comment