# Statistical variables

34,200pages on
this wiki

This banner appears on articles that are weak and whose contents should be approached with academic caution
.

In psychology a variable is a symbol denoting a quantity or symbolic representation. Variables are often contrasted with constants, which are known and unchanging.

In other scientific fields such as biology, chemistry, and physics, the word variable is used to refer to a measurable factor, characteristic, or attribute of an individual or a system. In a scientific experiment, so called "independent variables" are factors that can be altered or chosen by the scientist. For example, temperature is a common environmental factor that can be controlled in laboratory experiments. "Dependent variables" or "response variables" are those that are measured and collected as data. An independent variable is presumed to affect a dependent one.

In social sciences, variable is a logical set of attributes. A variable such as "gender" would have two attributes: male and female.

## General overview

Variables are used in open sentences. For instance, in the formula: x + 1 = 5, x is a variable which represents an "unknown" number. In mathematics, variables are usually represented by letters of the Roman alphabet, but are also represented by letters of other alphabets; as well as various other symbols. In computer programming, variables are usually represented by alphanumeric strings.

## Why are variables useful?

Variables are useful in mathematics because they allow instructions to be specified in a general way. If one were forced to use actual values, then the instructions would only apply in a more narrow, and specific set of situations. For example: specify a mathematical definition for finding the square of ANY number: square(x) = x · x.

Now, all we need to do to find the square of a number is replace x with any number we want.

• square(x) = x · x = y
• square(1) = 1 · 1 = 1
• square(2) = 2 · 2 = 4
• square(3) = 3 · 3 = 9

etc...

In the above example, the variable x is a "placeholder" for ANY number. One important thing we are assuming is that the value of each occurrence of x is the same -- that x does not get a new value between the first x and the second x.