Lecture 3: Data Display Methods and Statistical Visualization

Principles of Tool Selection for Data Display

The selection of an appropriate graphical tool for data visualization depends on two primary methodological criteria:

  1. Analytical Objective: Determining whether the goal is to examine the distribution of a single variable within a sample, or to analyze the associations and relationships between two or more variables.

  2. Variable Type: Identifying whether the variables under investigation are categorical or numerical.

Variable Classification and Taxonomy

Data variables are broadly divided into two primary categories, each containing specific sub-types:

Categorical Variables

Categorical variables represent qualitative attributes or groups. They are subdivided into:

  • Nominal Variables (N): Categories without any intrinsic quantitative order or ranking.

    • Examples: Major area of study, Survival status (Alive\text{Alive} / Dead\text{Dead}).

  • Ordinal Variables (O): Categories that possess a natural, sequential ordering or scale.

    • Example: Likert scale responses (Agree\text{Agree}, Agree somewhat\text{Agree somewhat}, Neutral\text{Neutral}, Disagree somewhat\text{Disagree somewhat}, Disagree\text{Disagree}).

Numerical Variables

Numerical variables represent measurable quantities. They are subdivided into:

  • Discrete Variables (D): Variables that take on distinct, countable integer values.

    • Example: Number of trees in a sample.

  • Continuous Variables (C): Variables that can take on any real value within a given continuous interval.

    • Example: Height.

Graphical Methods for Single-Variable Frequency Distributions

When analyzing the distribution of a single variable, the visual tool is selected based on data type:

  • Categorical Data: Displayed using a Bar graph.

  • Numerical Data: Displayed using a Histogram.

Framework for Displaying Associations Between Variables

When examining relationships between two variables, the choice of graph depends on the data types of both the explanatory variable (xx -axis) and the response variable (yy -axis):

| Explanatory Variable (xx -axis) | Response Variable (yy -axis) | Recommended Graphical Method | | :--- | :--- | :--- | | Categorical | Categorical | Mosaic plot, Grouped bar graphs | | Categorical | Numerical | Bar plots, Box-and-whisker plots | | Numerical | Categorical | Bin responses & plot averages using scatter plot or stacked bar graph | | Numerical | Numerical | Scatter plot |

Limitations of Software Tools

Standard spreadsheet software such as Microsoft Excel can easily construct basic plots (e.g., standard bar charts, scatter plots), but is poorly equipped to natively generate advanced displays such as mosaic plots or customized binned plots. Advanced statistical computing environments (e.g., R) are preferred for these complex visualization formats.

Associations Between Numerical Explanatory Variables and Categorical Responses

When analyzing a numerical explanatory variable alongside a categorical response variable, raw data must often be grouped into intervals (bins) and summarized before plotting.

Case Study 1: Dose-Dependent Mortality

An experiment measures the categorical response of survival (Survived?\text{Survived?}: Y=1\text{Y} = 1, N=0\text{N} = 0) across continuous numerical dosage levels.

Raw Observation Data
  • Dose 0.030.03: Survived YY (Code 11)

  • Dose 0.090.09: Survived YY (Code 11)

  • Dose 0.230.23: Survived YY (Code 11)

  • Dose 0.260.26: Survived YY (Code 11)

  • Dose 0.290.29: Survived YY (Code 11)

  • Dose 0.400.40: Survived NN (Code 00)

  • Dose 0.450.45: Survived YY (Code 11)

  • Dose 0.470.47: Survived YY (Code 11)

  • Dose 0.540.54: Survived NN (Code 00)

  • Dose 0.570.57: Survived YY (Code 11)

  • Dose 0.580.58: Survived YY (Code 11)

  • Dose 0.610.61: Survived YY (Code 11)

  • Dose 0.670.67: Survived YY (Code 11)

  • Dose 0.680.68: Survived NN (Code 00)

  • Dose 0.690.69: Survived NN (Code 00)

  • Dose 0.720.72: Survived NN (Code 00)

  • Dose 0.720.72: Survived NN (Code 00)

  • Dose 0.740.74: Survived YY (Code 11)

  • Dose 0.770.77: Survived NN (Code 00)

  • Dose 0.860.86: Survived NN (Code 00)

  • Dose 0.870.87: Survived NN (Code 00)

Binned Summary Table

Bin Range

Bin Midpoint

Average Survival

0.00−0.090.00 - 0.09

0.050.05

1.001.00

0.20−0.290.20 - 0.29

0.250.25

1.001.00

0.40−0.490.40 - 0.49

0.450.45

0.660.66

0.50−0.590.50 - 0.59

0.550.55

0.660.66

0.60−0.690.60 - 0.69

0.650.65

0.500.50

0.70−0.790.70 - 0.79

0.750.75

0.250.25

0.80−0.890.80 - 0.89

0.850.85

0.000.00

Graphical Representation

The summarized data is visualized by plotting the Estimated Probability of Survival on the yy -axis (ranging from 0.00.0 to 1.01.0) against the Dose Bin Midpoints on the xx -axis (ranging from 0.20.2 to 0.80.8).

Case Study 2: Questionnaire Response Across Income Levels

An evaluation of ordinal categorical survey responses to the statement: "Taxes in this country are too high" (Options: Disagree\text{Disagree}, Neutral\text{Neutral}, Agree\text{Agree}) across numerical income levels.

Data Summaries Table

Income Bin (×1000 USD\times 1000\,\text{USD})

Bin Midpoint

Disagree (%)

Neutral (%)

Agree (%)

0−24.990 - 24.99

12.512.5

70%70\%

15%15\%

15%15\%

25−49.9925 - 49.99

37.537.5

50%50\%

30%30\%

20%20\%

50−74.9950 - 74.99

62.562.5

33.3%33.3\%

33.3%33.3\%

33.3%33.3\%

75−99.9975 - 99.99

87.587.5

20%20\%

30%30\%

50%50\%

100−124.99100 - 124.99

112.5112.5

15%15\%

15%15\%

70%70\%

Graphical Representation

Data is plotted using a Stacked Bar Chart:

  • yy -axis: Proportion of Respondents (0%0\% to 100%100\%).

  • xx -axis: Income Bin Midpoint in ×1000 USD\times 1000\,\text{USD} (12.512.5, 37.537.5, 62.562.5, 87.587.5, 112.5112.5).

  • Segment Divisions: Percentage breakdown of Disagree\text{Disagree}, Neutral\text{Neutral}, and Agree\text{Agree} per bin.

  • Analytical Purpose: Evaluates whether response probabilities systematically depend on individual income.

Advanced Graphical Methods for Categorical Variables

Mosaic Plots

  • Definition: A specialized visual display designed to examine associations between two or more categorical variables.

  • Structure: Similar to a stacked bar plot, but with one critical distinction: the width of each bar varies proportionally to reflect the sample size of each category.

  • Example Application: Evaluating relative frequency (0.00.0 to 1.01.0) of disease incidence (No malaria\text{No malaria} vs. Malaria\text{Malaria}) across experimental treatment groups (Control\text{Control} vs. Egg removal\text{Egg removal}).

  • Implementation Note: Standard tools like Excel are inefficient at creating mosaic plots; statistical environments like R are recommended.

Grouped Bar Graphs

  • Definition: A graph used to compare bivariate categorical relationships by placing bars adjacent to one another within groupings along the xx -axis.

  • Operational Limitation: While useful, grouped bar graphs can make visual comparison across xx -axis groupings difficult if sub-sample sizes differ significantly between groups.