PDA

View Full Version : min(x)



graziella85
03-10-2011, 08:16 AM
Dear All,
I need to know which command and which syntax are necessary to estract the minimum value of one variable.

Thank you.

bukharin
03-10-2011, 08:16 PM
If you want to create a new variable based on minimum value of myvar you can use:

egen min=min(myvar)

Alternatively, if you want to use the minimum value of myvar for a calculation you should use a macro:

sum myvar
local min=r(min)