• Descriptive
    • Moments
    • Concentration
    • Central Tendency
    • Variability
    • Stem-and-Leaf Plot
    • Histogram & Frequency Table
    • Data Quality Forensics
    • Conditional EDA
    • Quantiles
    • Kernel Density Estimation
    • Normal QQ Plot
    • Bootstrap Plot

    • Multivariate Descriptive Statistics
  • Distributions
    • Binomial Probabilities
    • Geometric Probabilities
    • Negative Binomial Probabilities
    • Hypergeometric Probabilities
    • Multinomial Probabilities
    • Dirichlet
    • Poisson Probabilities

    • Exponential
    • Gamma
    • Erlang
    • Weibull
    • Rayleigh
    • Maxwell-Boltzmann
    • Lognormal
    • Pareto
    • Inverse Gamma
    • Inverse Chi-Square

    • Beta
    • Power
    • Beta Prime (Inv. Beta)
    • Triangular

    • Normal (area)
    • Logistic
    • Laplace
    • Cauchy (standard)
    • Cauchy (location-scale)
    • Gumbel
    • Fréchet
    • Generalized Extreme Value

    • Normal RNG
    • ML Fitting
    • Tukey Lambda PPCC
    • Box-Cox Normality Plot
    • Noncentral t
    • Noncentral F
    • Sample Correlation r

    • Empirical Tests
  • Hypotheses
    • Theoretical Aspects of Hypothesis Testing
    • Bayesian Inference
    • Minimum Sample Size

    • Empirical Tests
    • Multivariate (pair-wise) Testing
  • Models
    • Manual Model Building
    • Guided Model Building
  • Time Series
    • Time Series Plot
    • Decomposition
    • Exponential Smoothing

    • Blocked Bootstrap Plot
    • Mean Plot
    • (P)ACF
    • VRM
    • Standard Deviation-Mean Plot
    • Spectral Analysis
    • ARIMA

    • Cross Correlation Function
    • Granger Causality
  1. Descriptive Statistics & Exploratory Data Analysis
  2. 62  Histogram
  • Preface
  • Getting Started
    • 1  Introduction
    • 2  Why Do We Need Innovative Technology?
    • 3  Basic Definitions
    • 4  The Big Picture: Why We Analyze Data
  • Introduction to Probability
    • 5  Definitions of Probability
    • 6  Jeffreys’ axiom system
    • 7  Bayes’ Theorem
    • 8  Sensitivity and Specificity
    • 9  Naive Bayes Classifier
    • 10  Law of Large Numbers

    • 11  Problems
  • Probability Distributions
    • 12  Bernoulli Distribution
    • 13  Binomial Distribution
    • 14  Geometric Distribution
    • 15  Negative Binomial Distribution
    • 16  Hypergeometric Distribution
    • 17  Multinomial Distribution
    • 18  Poisson Distribution

    • 19  Uniform Distribution (Rectangular Distribution)
    • 20  Normal Distribution (Gaussian Distribution)
    • 21  Gaussian Naive Bayes Classifier
    • 22  Chi Distribution
    • 23  Chi-squared Distribution (1 parameter)
    • 24  Chi-squared Distribution (2 parameters)
    • 25  Student t-Distribution
    • 26  Fisher F-Distribution
    • 27  Exponential Distribution
    • 28  Lognormal Distribution
    • 29  Gamma Distribution
    • 30  Beta Distribution
    • 31  Weibull Distribution
    • 32  Pareto Distribution
    • 33  Inverse Gamma Distribution
    • 34  Rayleigh Distribution
    • 35  Erlang Distribution
    • 36  Logistic Distribution
    • 37  Laplace Distribution
    • 38  Gumbel Distribution
    • 39  Cauchy Distribution
    • 40  Triangular Distribution
    • 41  Power Distribution
    • 42  Beta Prime Distribution
    • 43  Sample Correlation Distribution
    • 44  Dirichlet Distribution
    • 45  Generalized Extreme Value (GEV) Distribution
    • 46  Frechet Distribution
    • 47  Noncentral t Distribution
    • 48  Noncentral F Distribution
    • 49  Inverse Chi-Squared Distribution
    • 50  Maxwell-Boltzmann Distribution
    • 51  Distribution Relationship Map

    • 52  Problems
  • Descriptive Statistics & Exploratory Data Analysis
    • 53  Types of Data
    • 54  Datasheets

    • 55  Frequency Plot (Bar Plot)
    • 56  Frequency Table
    • 57  Contingency Table
    • 58  Binomial Classification Metrics
    • 59  Confusion Matrix
    • 60  ROC Analysis

    • 61  Stem-and-Leaf Plot
    • 62  Histogram
    • 63  Data Quality Forensics
    • 64  Quantiles
    • 65  Central Tendency
    • 66  Variability
    • 67  Skewness & Kurtosis
    • 68  Concentration
    • 69  Notched Boxplot
    • 70  Scatterplot
    • 71  Pearson Correlation
    • 72  Rank Correlation
    • 73  Partial Pearson Correlation
    • 74  Simple Linear Regression
    • 75  Moments
    • 76  Quantile-Quantile Plot (QQ Plot)
    • 77  Normal Probability Plot
    • 78  Probability Plot Correlation Coefficient Plot (PPCC Plot)
    • 79  Box-Cox Normality Plot
    • 80  Kernel Density Estimation
    • 81  Bivariate Kernel Density Plot
    • 82  Conditional EDA: Panel Diagnostics
    • 83  Bootstrap Plot (Central Tendency)
    • 84  Survey Scores Rank Order Comparison
    • 85  Cronbach Alpha

    • 86  Equi-distant Time Series
    • 87  Time Series Plot (Run Sequence Plot)
    • 88  Mean Plot
    • 89  Blocked Bootstrap Plot (Central Tendency)
    • 90  Standard Deviation-Mean Plot
    • 91  Variance Reduction Matrix
    • 92  (Partial) Autocorrelation Function
    • 93  Periodogram & Cumulative Periodogram

    • 94  Problems
  • Hypothesis Testing
    • 95  Normal Distributions revisited
    • 96  The Population
    • 97  The Sample
    • 98  The One-Sided Hypothesis Test
    • 99  The Two-Sided Hypothesis Test
    • 100  When to use a one-sided or two-sided test?
    • 101  What if \(\sigma\) is unknown?
    • 102  The Central Limit Theorem (revisited)
    • 103  Statistical Test of the Population Mean with known Variance
    • 104  Statistical Test of the Population Mean with unknown Variance
    • 105  Statistical Test of the Variance
    • 106  Statistical Test of the Population Proportion
    • 107  Statistical Test of the Standard Deviation \(\sigma\)
    • 108  Statistical Test of the difference between Means -- Independent/Unpaired Samples
    • 109  Statistical Test of the difference between Means -- Dependent/Paired Samples
    • 110  Statistical Test of the difference between Variances -- Independent/Unpaired Samples

    • 111  Hypothesis Testing for Research Purposes
    • 112  Decision Thresholds, Alpha, and Confidence Levels
    • 113  Bayesian Inference for Decision-Making
    • 114  One Sample t-Test
    • 115  Skewness & Kurtosis Tests
    • 116  Paired Two Sample t-Test
    • 117  Wilcoxon Signed-Rank Test
    • 118  Unpaired Two Sample t-Test
    • 119  Unpaired Two Sample Welch Test
    • 120  Two One-Sided Tests (TOST) for Equivalence
    • 121  Mann-Whitney U test (Wilcoxon Rank-Sum Test)
    • 122  Bayesian Two Sample Test
    • 123  Median Test based on Notched Boxplots
    • 124  Chi-Squared Tests for Count Data
    • 125  Kolmogorov-Smirnov Test
    • 126  One Way Analysis of Variance (1-way ANOVA)
    • 127  Kruskal-Wallis Test
    • 128  Two Way Analysis of Variance (2-way ANOVA)
    • 129  Repeated Measures ANOVA
    • 130  Friedman Test
    • 131  Testing Correlations
    • 132  A Note on Causality

    • 133  Problems
  • Regression Models
    • 134  Simple Linear Regression Model (SLRM)
    • 135  Multiple Linear Regression Model (MLRM)
    • 136  Logistic Regression
    • 137  Generalized Linear Models
    • 138  Multinomial and Ordinal Logistic Regression
    • 139  Cox Proportional Hazards Regression
    • 140  Conditional Inference Trees
    • 141  Leaf Diagnostics for Conditional Inference Trees
    • 142  Conditional Random Forests
    • 143  Hypothesis Testing with Linear Regression Models (from a Practical Point of View)

    • 144  Problems
  • Introduction to Time Series Analysis
    • 145  Case: the Market of Health and Personal Care Products
    • 146  Decomposition of Time Series
    • 147  Ad hoc Forecasting of Time Series
  • Box-Jenkins Analysis
    • 148  Introduction to Box-Jenkins Analysis
    • 149  Theoretical Concepts
    • 150  Stationarity
    • 151  Identifying ARMA parameters
    • 152  Estimating ARMA Parameters and Residual Diagnostics
    • 153  Forecasting with ARIMA models
    • 154  Intervention Analysis
    • 155  Cross-Correlation Function
    • 156  Transfer Function Noise Models
    • 157  General-to-Specific Modeling
  • Model Building Strategies
    • 158  Introduction to Model Building Strategies
    • 159  Manual Model Building
    • 160  Model Validation
    • 161  Regularization Methods
    • 162  Hyperparameter Optimization Strategies
    • 163  Guided Model Building in Practice
    • 164  Diagnostics, Revision, and Guided Forecasting
    • 165  Leakage, Target Encoding, and Robust Regression
  • References
  • Appendices
    • Appendices
    • A  Method Selection Guide
    • B  Presentations and Teaching Materials
    • C  R Language Concepts for Statistical Computing
    • D  Matrix Algebra
    • E  Standard Normal Table (Gaussian Table)
    • F  Critical values of Student’s \(t\) distribution with \(\nu\) degrees of freedom
    • G  Upper-tail critical values of the \(\chi^2\)-distribution with \(\nu\) degrees of freedom
    • H  Lower-tail critical values of the \(\chi^2\)-distribution with \(\nu\) degrees of freedom

Table of contents

  • 62.1 Definition
  • 62.2 Horizontal axis
  • 62.3 Vertical axis
  • 62.4 Rows of associated Frequency Table
  • 62.5 Column “Midpoint” of associated Frequency Table
  • 62.6 Column “Abs. Freq.” of associated Frequency Table
  • 62.7 Column “Rel. Freq.” of associated Frequency Table
  • 62.8 Column “Cumul. Rel. Freq.” of associated Frequency Table
  • 62.9 Column “Density” of associated Frequency Table
  • 62.10 R Module
    • 62.10.1 Public website
    • 62.10.2 RFC
  • 62.11 Purpose
  • 62.12 Pros & Cons
    • 62.12.1 Pros
    • 62.12.2 Cons
  • 62.13 Examples
  • 62.14 Tasks
    • 62.14.1 Number of bins
    • 62.14.2 Scale of the data
  1. Descriptive Statistics & Exploratory Data Analysis
  2. 62  Histogram

62  Histogram

62.1 Definition

The Histogram is computed for quantitative data and involves the following steps:

  • the observations are sorted in ascending order
  • the observations are categorized into a number of “bins” (most histograms have bins of equal width)
  • for each bin, the number of observations is counted (absolute frequency)
  • the absolute frequencies are plotted as rectangular shapes for each bin -- the height of the rectangles corresponds to the absolute frequency of the corresponding bin (the width of the rectangles is equal to the width/range of the bins)

62.2 Horizontal axis

The variable under investigation is shown on the horizontal axis. This is always used for quantitative variables (either continuous or discrete).

62.3 Vertical axis

The absolute frequency (of each bin) is displayed on the vertical axis.

62.4 Rows of associated Frequency Table

The rows of the Frequency Table correspond to the bins that have been created to categorize the original observations. Each bin is written as an interval with a lower and upper bound. The bounds can be open-ended or closed: for instance, the bin [1000, 1500[ has an open-ended upper bound (i.e. the value 1500 is not included) and a closed lower bound (i.e. the value 1000 is included).

62.5 Column “Midpoint” of associated Frequency Table

The midpoint is simply the central value of the bin. One can think of the midpoint as the value by which each observation that falls inside the bin is replaced.

62.6 Column “Abs. Freq.” of associated Frequency Table

This column shows the Absolute Frequency (i.e. the count) or the number of observations that are contained in the bin.

62.7 Column “Rel. Freq.” of associated Frequency Table

This column shows the Relative Frequency which is defined as the Absolute Frequency divided by the total number of observations. In other words, the Relative Frequency is the (percentage) share of observations that fall inside the bin.

62.8 Column “Cumul. Rel. Freq.” of associated Frequency Table

The Cumulative Relative Frequency is based on the previous column (Relative Frequency) and represent the share (percentage) of observations that are smaller than the upper bound of the bin that is considered. For instance, the computation of Section 62.13 shows that the Cumulative Relative Frequency of bin ]1000, 1500] is 0.9856115. This implies that about 98.6% of all observations are smaller than (or equal to) 1500.

62.9 Column “Density” of associated Frequency Table

The Density is derived from the Relative Frequency and has a scale which ensures that the surface of the Histogram (i.e. the sum of all bin widths multiplied by their respective Densities) are equal to 1. The Density can be computed by dividing the Relative Frequency by the bin width.

62.10 R Module

62.10.1 Public website

The Histogram can be found on the public website:

  • https://compute.wessa.net/histo.wasp

62.10.2 RFC

The Histogram is available in RFC under the menu “Descriptive / Histogram & Frequency Table”.

If you prefer to compute the Histogram on your local computer, the following code snippet can be used in the R console:

x <- runif(300,30,200)
par1 = 'Sturges' #number of bins
par2 = 'grey' #colour
par3 = FALSE #right-closed intervals
xlab = 'x'
main = 'Histogram'
myhist<-hist(x,breaks=par1,col=par2,main=main,xlab=xlab,right=par3)

myhist
$breaks
 [1]  20  40  60  80 100 120 140 160 180 200

$counts
[1] 17 40 33 48 33 25 34 38 32

$density
[1] 0.002833333 0.006666667 0.005500000 0.008000000 0.005500000 0.004166667
[7] 0.005666667 0.006333333 0.005333333

$mids
[1]  30  50  70  90 110 130 150 170 190

$xname
[1] "x"

$equidist
[1] TRUE

attr(,"class")
[1] "histogram"

To create a Histogram, the R code uses the hist function to produce the plot. The dataset is simulated with the runif function as a series of random numbers (N = 300) from the Uniform Distribution with a lower bound of 30 and an upper bound of 200.

62.11 Purpose

The Histogram can be used to graphically examine the distribution of the data. The following properties of the distribution can be visualized by the histogram: central tendency, variability, skewness, modality, and the presence of outliers.

62.12 Pros & Cons

62.12.1 Pros

The Histogram has the following advantages:

  • It is easy to compute with many software packages (even spreadsheets have functions which allow to create histograms and associated frequency tables).
  • It is relatively easy to interpret and conveys a lot of information in a simple graph.
  • Many readers are familiar with histograms -- therefore it is one of the preferred methods to report information about the distribution of a variable of interest.

62.12.2 Cons

The Histogram has the following disadvantages:

  • The Histogram groups the original observations into bins which implies that some information is lost. In the Histogram each observation is represented by the center of each bin.
  • The amount of information that is conveyed depends on the bin size (and the number of bins). Bad choices for the number of bins may conceal distributional features (such as multi modality, central tendency, variability, etc.). Common rules for choosing the number of bins include Sturges’ rule (Sturges 1926).
  • With discrete variables (such as scores on a Likert scale) one must be careful when interpreting the results (because it is possible that all observations are located on the lower or upper bounds of the bins). It may be beneficial to choose bounds in such a way that the observations are all in the center of bins.
  • In the presence of outliers, the histogram may not be very informative. Trimming the outliers from the dataset may be necessary to solve this problem.

62.13 Examples

The Histogram shown below represents the time that was needed by students to submit a survey (in seconds). This Histogram is not very informative because there are several outliers on the right side of the scale.

Interactive Shiny app (click to load).
Open in new tab

The Histogram shown below represents the scores on a 7-point Likert scale from a survey. The bins have been chosen in such a way that the actual scores (1, 2, 3, 4, 5, 6, and 7) fall exactly in the center of each bin (observe how the field “Scale of data” was set to “7-point Likert”).

Interactive Shiny app (click to load).
Open in new tab

62.14 Tasks

62.14.1 Number of bins

Use the first Histogram of Section 62.13 and identify the average time that is needed to submit the survey. There are (at least) two different ways to do this!

62.14.2 Scale of the data

Use the second Histogram of Section 62.13 and set the “Scale of data” field to “Unknown”. Compare the results with the original ones. Which histogram is easier to interpret? Why? What if you set the number of bins to 6?

Sturges, Herbert A. 1926. “The Choice of a Class Interval.” Journal of the American Statistical Association 21 (153): 65–66. https://doi.org/10.1080/01621459.1926.10502161.
61  Stem-and-Leaf Plot
63  Data Quality Forensics

© 2026 Patrick Wessa. Provided as-is, without warranty.

Feedback: e-mail | Anonymous contributions: click to copy (Sats) | click to copy (XMR)

Cookie Preferences