Create new variables

Learn me by follow me exercises

You can create a new variable by selecting ¡°Data¡± from main menu and then click ¡°Create new variable¡±, or right click any place in the middle panel if you are in ¡°variables view window¡± or right panel if you are in ¡°analysis design window¡±, and then select ¡°Create new variable¡± in the popup menu.  In the popup dialogue enter the new variable¡¯s name.

Description: ScreenHunter_05 Sep. 26 17.09.gif

Click ¡°Ok¡±, a new window ¡°Derive a new variable¡± will show up.

 You can create a new variable by typing in a formula, for example, to create ¡°BMI¡±, type in ¡°weight/height/height¡±, see below:

Description: ScreenHunter_07 Sep. 26 17.35.gif

Or you can based on conditional coding or formula, for example to create ¡°HBP (high blood pressure)¡±, type in ¡°SBP>=140 or DBP>=90¡± as ¡°Conditions¡± and then type in ¡°1¡± as ¡°Code¡±, then click ¡°Add new condition¡± button, type in ¡°SBP>=0 and DBP>=0¡± as ¡°Conditions¡± and ¡°0¡± as code.  HBP will be coded as 1 and 0. See below:

Description: ScreenHunter_08 Sep. 26 17.36.gif