# Variables

## 1. The basic variable: column heading

These variables refer directly to columns in the data table.

- The name of the variable is the heading you enter for the column in the data table.
- A variable name should not include any spaces, nor the following characters:
**- + / * = < > # & $ | ^ : , ; . ( ) ' " [ ] { }**. - The variable name should not start with a number and it must be different from reserved words such as TRUE, FALSE, ROW and COLUMN.
- The variable name should not be equal to the address of a spreadsheet cell such as A1, S1, AB35, IL6, etc.

## 2. Combination of variables

A mathematical formula combining two or more variables.

For example: **WEIGHT/(HEIGHT*HEIGHT)**

Any of the following operators can be used to combine variables (in order of precedence):

^ | Exponentiation |

- | Negation |

* / | Multiplication, Division |

+ - | Addition, subtraction |

As shown in the example, brackets can be used to change the operators precedence.

## 3. Transformation of a variable

When a variable needs transformation, you can use one of the many MedCalc spreadsheet functions. For example, if a variable needs square root transformation you use the SQRT(variable) function as new variable.

## How to create a derived variable

The example file ExampleFile2 contains data on body weight (in *kg*) and length (in *m*). You want to have a new variable Body Mass Index which is the weight divided by length squared.

Click **Data** in the MedCalc.net menu. Next click **Variables**. The browser displays the variables in the data table.

Click the **New variable** hyperlink. A new input panel is displayed which you complete as follows:

Click **Save** and the new variable is added to the variables list: