# min(x)

#### graziella85

##### New Member
Dear All,
I need to know which command and which syntax are necessary to estract the minimum value of one variable.

Thank you.

#### bukharin

##### RoboStataRaptor
If you want to create a new variable based on minimum value of myvar you can use:
Code:
egen min=min(myvar)
Alternatively, if you want to use the minimum value of myvar for a calculation you should use a macro:
Code:
sum myvar
local min=r(min)