Types of Variable > Quantitative Variables
You’re probably used to the word “variable” in algebra. Letters like x and y are used in place of numbers. Two types of variables are used in statistics: Quantitative and categorical (also called qualitative). Quantitative variables are numerical variables: counts, percents, or numbers. Categorical variables are descriptions of groups or things, like “breeds of dog” or “voting preference”.
Examples of Quantitative Variables / Numeric Variables:
- High school Grade Point Average.
- Number of pets owned.
- Bank account balance.
- Number of stars in a solar system.
- Average number of lottery tickets sold.
- How many cousins you have.
- The amount in your paycheck.
General rule: if you can add it, it’s quantitative. For example, a G.P.A. of 3.3 and a G.P.A. of 4.0 can be added together (3.3 + 4.0 = 7.3), so that means it’s quantitative.
Examples of Categorical Variables:
- Class in college (freshman, sophomore, junior, senior).
- Party affiliation (Republican, Democrat, Independent).
- Type of pet owned (dog, cat, rodent, fish).
- Favorite author.
- Preferred airline.
- Hair color.
- Your race.
- Types of hats.
As a general rule, if you can’t add something, then it’s categorical. For example, you can’t add cat + dog, or Republican + Democrat.
Categorical vs. Quantitative
Watch this video on the difference between categorical(qualitative) and quantitative variables.
What is a Quantitative Data Condition?
When you graph or plot statistical data, make sure you have quantitative data of known units. If you don’t have known units, then you won’t be able to graph it. For example, the first list above states that “G.P.A.” is quantitative data. However, you won’t be able to graph G.P.A. versus another variable (say, race or sex) unless you actually have a unit, like 3.1 or 2.9. This sounds obvious, but with more complex data you should always check the quantitative data condition for missing or nonsensical information before you start a graph.
Histograms, boxplots and scatter plots all require that you have quantitative (numerical data). If you try to graph categorical data with a histogram, boxplot or scatter plot, you’ll run into the same type of problem as if you try to graph numerical data with pie charts: your graphs won’t make any sense. The following scatter plot illustrates this point. I made a scatter plot in Microsoft Excel of categorical data (names) along with their ages in Excel. Excel didn’t recognize the categorical data and assigned numbers instead. The scatter plot is meaningless; no one will know that “1”, “2”, “3”, “4” and “5” refer to names and even if they do…the graph will be a mess if you have 100 names!:
Check out our YouTube channel for more help and tips.------------------------------------------------------------------------------
If you prefer an online interactive environment to learn R and statistics, this free R Tutorial by Datacamp is a great way to get started. If you're are somewhat comfortable with R and are interested in going deeper into Statistics, try this Statistics with R track.Comments are now closed for this post. Need help or want to post a correction? Please post a comment on our Facebook page and I'll do my best to help!