Chapter 3 Variables

3.1 Data collection

For the purposes of the exercises, we will collect some data from you (the students)

On the green card, please state:

1: Your height

2: Your (right) hand span

3: Your gender (please use F for female and M for male)

4: Number of siblings in your family (how many siblings, including yourself, are there in your family?)

5: How much time (in hours, you can state fractions, for example, 3.5) did you spend yesterday watching videos (TV, Youtube, Netflix, etc.)?

6: How much soda (drinks like cola, Sprite, etc.) did you drink last week?

7: What is your handedness score (please use the handedness questionnaire below)?

Handedness questionnaire

Figure 3.1: Handedness questionnaire (Gelman, 2022)

Handedness questionnaire in Google docs: https://docs.google.com/document/d/1tnyBBuuJWyLpa95TXirH01rirvJE-lKyoZe1j3UP_Lg/edit?usp=sharing

Example of filled-in green card:
Filled-in green card example

Figure 3.2: Green card example

3.2 Qualitative and quantitative variables

In statistics, we usually distinguish two main types of variables:

  1. Qualitative (sometimes referred to as categorical) variables - variables that cannot be treated as numbers. We will include nominal and ordinal variables here.

  2. Quantitative (numerical) variables - variables represented and interpreted as numbers.

For the purposes of modelling or visualization we may classify quantitative variables into two groups:

  1. Discrete variables (variables that take on distinct, countable values)

  2. Continuous variables (variables that take on any value within a range)

Please notice that in statistical modelling we sometimes treat theoretically discrete variables (like income) as continuous variables.

3.3 Measurement scales

Usually we identify four measurement scales, two for qualitative, two for quantitative variables. Nominal scale is the weakest, ratio scale is the strongest.

3.3.1 Nominal scale

Nominal scale is for qualitative variables when there is no natural ordering of attributes.

Examples: eye colour, type of vehicle.

3.3.2 Ordinal scale

If the variable attributes can be ordered, the measurement scale is ordinal. It is often assumed that dichotomous variables are naturally ordinal.

Examples:

spectrum of values (‘completely agree’, ‘mostly agree’, ‘mostly disagree’, ‘completely disagree’),

US Army military rank (private, private second class, private first class, specialist, corporal, sergeant, staff sergeant, sergeant first class, master sergeant, first sergeant, sergeant major, command sergeant major and sergeant major of the Army)

3.3.3 Interval scale

Interval scale is for quantitative variables where zero is arbitrary. The most popular example is temperature in degrees Celsius or Fahrenheit (but not in Kelvins).

3.3.4 Ratio scale

Quantitative variables where zero means real zero are ratio scale variables. Most numerical variables are ratio variables.

3.4 Exercises

Exercise 3.1 For the variables on the green card, please state whether they are qualitative or quantitative. What is their measurement scale? For numerical variables - would you consider them continuous or discrete?

Exercise 3.2 Classify each of the following variables as qualitative or quantitative; if quantitative, as discrete or continuous:

  1. occupation

  2. region of residence

  3. weight

  4. height

  5. number of automobiles owned

Exercise 3.3 Biologists at a university are studying the patterns of extinction in the New Zealand bird population. The following variables were measured for each bird species. Identify each variable as quantitative or qualitative.

  1. Flight capability (volant or flightless)

  2. Type of habitat (aquatic, ground terrestrial, or aerialterrestrial)

  3. Nesting site (ground, cavity within ground, tree, cavity above ground)

  4. Nest density (high or low)

  5. Diet (fish, vertebrates, vegetables, or invertebrates)

  6. Body mass (grams)

  7. Egg length (millimeters)

  8. Extinct status (extinct, absent from island, present)