Geoff-Hart.com: Editing, Writing, and Translation

Home Services Books Articles Resources Fiction Contact me Français

You are here: Articles --> 2023 --> Naming variables
Vous êtes ici : Essais --> 2023 --> Naming variables

Naming and typing variables and mathematical symbols: Part 1: Naming variables

by Geoffrey Hart

Previously published as: Hart, G. 2023. Naming and typing variables and mathematical symbols: Part 1: Naming variables. https://www.worldts.com/english-writing/448/index.html

Most scientific manuscripts use at least some mathematics, but since mathematical symbols require specific formats and some cannot be easily typed from the keyboard, it’s important to learn how to insert these variables correctly and efficiently. (If you’ve read this article before and only want to remind yourself of the details, I’ve added a summary at the end of part 2.) I’ll divide this article into two parts: part 1 (this page) discusses how to choose clear and effective names for variables, and part 2 explains how to format these variables using your computer software.

Names for simple variables

Simple variables such as the weight of a sample at a given time have only a single value at that time. Their names (e.g., w = weight) are traditionally italicized to help them stand out from the surrounding text and to emphasize that they are variables, not words.

When you name simple variables, choose logical names that resemble the full words that these names replace to help readers remember their meaning. (You are more familiar with your research than your readers. Thus, they will have more trouble remembering the meaning of a long list of variable names.) The simplest way to name variables is to use the first letters of the key words in the variable’s full name. For example, if you studied energy in your study, you can use PE and KE for Potential Energy and Kinetic Energy, respectively. This works best when there are relatively few variables you must name in a given category such as energy.

Choose names that relate as closely as possible to the variable’s meaning. For example, use C = Cost if you are studying costs, but Q = Quantity if you are studying things that are counted or L = Length for size measurements. Add subscript numbers (numbers that appear below the line that holds the letters in the variable name) to the name to represent a sequence of times, such as 0 = the initial value and 2 = the value after two time periods. When you’re comparing time periods using a time variable (t), use t for a given time, t–1 for the previous time, and t+1 for the next time. Conversely, for variables that don’t have a clear numerical sequence, use letters instead of numbers. For example, B = Beijing and T = Tokyo are much easier to remember than “city 1” and “city 2”.

Note: Letters such as B and T that are not variables should not be italicized. Similarly, numbers and function names (e.g., ln, max, probit) are not variables and should not be italicized.

If there are many variables in a group, variable names are easier to remember if you choose a single letter to represent each group (e.g., E = Energy for the group of variables), followed by subscript letters such as p = potential, k = kinetic, and c = chemical (Ep, Ek, and Ec, respectively) for the specific variables in that group. This helps readers because they quickly learn that all variables whose name begins with E belong to the Energy group and that the subscript letters define the type of energy.

Names for multi-value variables

Multi-value variables can have multiple values at a given time. For example, the matrix E might represent a table of the values of energy consumption for all cities and years included in a study, with one row for each city and one column for each year. The names of multi-value variables are traditionally boldfaced to help them stand out from the surrounding text and to emphasize that they are different from simple variables.

The most common multi-value variable is a “matrix”: an array (i.e., a table) with rows and columns. For example, the columns might be the populations of a given city in several consecutive years, with consecutive rows representing the data for all the cities in your analysis. Each cell of the matrix contains a single value: a city’s population in year t. If the matrix has the dimension 2×2, then it has two rows and two columns, for a total of four values; for example, the two cities might be Beijing and Tokyo and the two years might be 2000 and 2020. A “vector” is a single row (a row vector) or a single column (a column vector), and is usually extracted from a matrix with multiple columns or rows. Vectors can also represent a specific group of values; that is, they are a “set”, as in the example E = {kinetic, potential, chemical}. In this example, the set represents a 1×3 matrix: one row and three values.

Note: The name “vector” comes from vector mathematics, in which a vector typically has only two values: its magnitude and its direction.

One common format is to use boldfaced capital letters for matrix names (e.g., Q for Quantity) and use the corresponding lower-case letter, italicized but not boldfaced, for the values of individual elements in that matrix (e.g., qfor quantity). For example, qrc equals the value stored in row r and column c of matrix Q. This can be denoted as Q = (qrc).

Superscripts and subscripts

In English, we use two additional formats in variable names: subscripts (letters or numbers positioned below the line that contains the variable name) and superscripts (letters or numbers positioned above the line that contains the variable name).

Subscripts should be used for explanations, as in the example above in which k = kinetic energy or the index number in a series (e.g., using t0 to represent the initial value in a time series). If you have many subscripts, presenting them all at the same time can become complex. There are two clear alternatives:

Superscripts should only be used for exponents. For example, q3 = q×q×q. Although readers of a journal manuscript will generally be able to figure out that qBsup>and qT represent the quantities for Beijing and Tokyo, respectively, since it makes no sense mathematically to raise a number to the power “Beijing”, the meaning is less obvious for other variables. Placing the letter in the correct position (subscript or superscript) eliminates that temporary confusion.

Matrix variables are an exception because they use slightly different mathematical notation in some cases. For matrices, letters formatted as superscripts sometimes have special meanings, such as T = the Transpose matrix, and numbers often have a special meaning, such as –1 = the inverse of a matrix. Superscripts are also used for the power of a matrix, which is similar to the meaning of an exponent (i.e., to multiply the matrix by itself one or more times).

In part 2 of this article (coming soon), I’ll explain how to type the names of the variables most efficiently.


©2004–2024 Geoffrey Hart. All rights reserved.