Bookmark and Share



st: normalize variables

Subject   st: normalize variables
Date   Sun, 11 Apr 2010 17:45:14 +0100


I am using panel data analysis and I want to generate an index but first I
must normalise the variables (x1,x2) contained in the index. I normalised
them by the following set of commands:

egen min_x1=min(x1)
egen max_x1=max(x1)
gen normal_x1=(x1-min_x1)/(max_x1-min_x1)

So, my question is whether I need to transform the commands to include the
"by(.)" option i.e.

egen min_x1=min(x1), by(.)
egen max_x1=max(x1), by(.)

and if so, should i include the panel or time variable.

*   For searches and help try:
