"" Using Data to Improve Care for Children EKG
Home >

Defining Variables (Data Dictionary)

Eye Variable Graphic - eyeColor, text, blue, green, brown, bloodshotWhen you are collecting data in a database, you need a unique identifier for each of the individual items you are collecting. This identifier is usually called a variable or database element. The identifier is called a variable because the data it contains (the data element) can vary depending on the individual record.

For example, suppose you were collecting information about the color of pediatric patient's eyes for a research project. You may create a variable named "Eye Color " which could have values of "Blue," "Green," or "Brown." These values are text values for the "Eye Color" variable. A variable could also store numeric values such as 1 for blue eyes, or 2 for green eyes, etc.

Meaningful Variables

It is important to define the variables and what type of data elements they contain in a manner that will help those who are analyzing your data to be able to quickly identify the type of information they are reviewing.

When creating variables it is strongly suggested that you create a variable that has meaning to you - so you don't always have to look up and remember what the variable means.

For example, suppose we decided to call our "Eye Color" variable "EC" because it was short and simple. When you or someone else reviews your database later, it could be difficult to remember what "EC" means.

The variable should also be easy to use (as in typing) and easy to remember, but still meaningful.

For example, "Prfmc_Msr_1a" vs "PerfMeasure1a." The variable "Prfmc_Msr_1a" is difficult to type and you may have to remember that "Prfmc_Msr" was an abbreviation for Performance Measure.

Variable Naming Conventions

You should also build a standard "naming convention" for your database variables.

Some good practices for naming variables are:

  • One word variables: do not use variables that contain spaces or strange characters such as a slash, question mark, or an asterix.
  • Limit the length of your variable as some software applications have a restricition on the length of your variable - i.e., "schoolAttendedWhenTheIndividualWasEight" vs. "elementarySchool."
  • Avoid generic names such as "eyes"
  • Use the underscore for spaces: "Eye_Color"
  • Use lowercase to uppercase: "eyeColor"
  • Include the question numbers (for surveys): "Q1_Eye_Color" This practice will help you to quickly identify the question number "Q1" (question number one) on the actual survey.
  • Include the variable type: "intAge" (for age stored as an integer).
  • Finally be consistent - whatever method you choose make sure you use it consistenly and that your "naming convention" is written down.

Some Common Variable Types

Screen grab from Microsoft Access Data TypesYou should be aware that variables can store different types of information. This can vary between different software applications. Always consult your database software for the variable types specifically setup for that particular software application. Below are some of the common types followed by an example usage:

  • Text/String:
    • Variable: "firstName"
    • Variable Type: Text
    • Possible Data Element: "Joe"
  • Numeric:
    • Variable Name: "age"
    • Variable Type: Numeric
    • Possible Data Element(s): 1, 10, 100
  • Date/Time:
    • Variable Name: "currentDate"
    • Variable Type: Date (Short)
    • Possible Data Element: 06/25/06
  • Boolean (True/False, Yes/No):
    • Variable Name: "visitedERLastWeek"
    • Variable Type: Yes/No
    • Possible Data Element: 1 = YES, 0 = NO

Set Up a Data Dictionary!

No matter how clear you think your definitions are, it always helps to have a road map or resource that you or someone else can view to see how you'd like to setup the database OR how to interpret the database. A data dicitionary is the answer!

Common definitions to include are:

  • The Variable Name
  • The Variable Data Type
  • The Description / Purpose of the Variable
  • Possible "Acceptable" Values for the Variable (helps to keep your data clean).
  • Checks or Restrictions for the Variable (again, helps to keep the variable clean, i.e., text value not accepted, must be numeric).



Next StepData Storage Methods >>





rev. 04-Aug-2022




Resource Library

Link 1
(Description of link)


Disclaimer | Website Feedback | U of U
© NEDARC 2010

This website is supported by the Health Resources and Services Administration (HRSA) of the U.S. Department of Health and Human Services (HHS) as part of the Emergency Medical Services for Children Data Center award totaling $3,200,000 with 0% financed with non-governmental sources. The contents are those of the author(s) and do not necessarily represent the official views of, nor an endorsement, by HRSA, HHS, or the U.S. Government. For more information, please visit HRSA.gov.

(In accordance with the Americans with Disabilities Act, the information in this site is
available in alternate formats upon request.)