Statistics Library / Chapter 2

Describe and visualize data

See the distribution before compressing it into a single number.

Connect the ideas

Describe the data before fitting a model. Graphs reveal shape and unusual observations; preparation makes transformations explicit.

Use a distribution for one variable, a scatterplot for two measurements, and counts for categories. Investigate missing codes, duplicates and unusual values in context. A flagged observation is a reason to inspect, not permission to delete.

Look before fittingThe same table can be examined through a distribution and a relationship plot.Shape of one variableRelationship between variables
Look before fitting. The same table can be examined through a distribution and a relationship plot. Schematic illustration; not calculated from a dataset.
Before you continue

Compare raw and prepared rows, document exclusions and check whether a summary table has been mistaken for individual observations.

A mathematical connection: 95% confidence interval of the mean

xˉ±t0.975, n−1(sn)\bar x \pm t_{0.975,\, n-1} \left(\dfrac{s}{\sqrt{n}}\right)

s is the sample standard deviation. Under independent normally distributed observations the t interval has exact nominal coverage; in other settings coverage may be approximate.

Read the formula in context: Descriptive summary

Exploration can suggest questions. A pattern discovered here needs appropriate follow-up; trying many views changes the interpretation of later tests.

Further reading: NIST/SEMATECH · Engineering statistics handbook · Berkeley · Computational and Inferential Thinking.

Before you begin

What you will learn

  • Choose summaries that match the variable and the question.
  • Use distribution shape and unusual observations to qualify a summary.
  • Distinguish raw observations from an already aggregated table.

Let shape and context guide the summary

A mean answers one question about location; it does not describe every typical observation. A median answers a different question. Pair a measure of location with variation and a graph so a reader can see skew, clusters and unusual values.

A histogram shows the distribution of a numerical variable through intervals. Its appearance depends on the binning. A boxplot gives a compact comparison of quantiles and potential outliers. Neither graph explains why an observation is unusual or whether it should be removed.

Before running a method, identify whether rows are individual observations, counts or summaries. A table of group means does not retain all the within-group variation of the original data. Treating those means as if they were raw observations can change both the question and the uncertainty.

Worked reasoning / Original illustration

The same location, a different picture

A service team reports that its average waiting time is acceptable, but customers describe occasional very long waits.

  1. Inspect a distribution rather than relying on the mean alone.
  2. Compare the median and upper quantiles with the mean, using the same recorded waits.
  3. Investigate long waits and missing records in their operational context before excluding anything.

A useful summary tells the reader about both ordinary experience and the tail that matters to the question.

Read the ideas in sequence

Follow these readings, then return for the reasoning check below.

  1. 2.1
    Descriptive summary

    A descriptive summary condenses each variable into its center, spread and shape (mean, median, SD, quartiles, skewness, kurtosis; level counts for categorical variables) as an honest first look at a dataset. It fits no model and reports no p-values; the 95% confidence interval of the mean it also shows is its one inferential number and rests on the usual sampling assumptions.

  2. 2.2
    Histogram

    A histogram divides a continuous variable into equal-width bins and counts how many observations fall into each, giving a quick visual read on the variable's shape, center, spread, and any obvious skew or multiple peaks.

  3. 2.3
    Boxplot

    A boxplot summarizes a numeric variable's distribution as a box from the first to the third quartile with a line at the median and whiskers reaching the most extreme values within 1.5 IQR of the box, making several groups' distributions easy to compare side by side.

  4. 2.4
    Exploratory Data Analysis (one-click EDA)

    One-click EDA profiles every selected variable, flags data-quality problems, maps the pairwise correlation and association structure, and (with a grouping column) auto-picks group comparisons, with every p-value honestly labeled exploratory and adjusted for the number of tests run.

  5. 2.5
    Summary table instead of raw data

    Analyzing a table that has already been summarized (means, counts, or percentages per group) instead of the original row-level data throws away the within-group variability a valid test needs, and standard tests cannot be run correctly on it.

Pause and reason

Check your understanding

Two branches have the same mean waiting time. Does that imply customers experience the same pattern of waits?

Show explanation

No. The branches can differ in variation, skew, clusters and extreme waits. Look at distributions and relevant quantiles, and check whether recording practices are comparable. An equal mean is one shared summary, not an equal distribution.

Take it with you

Describe location, variation, shape and data quality together. Keep the level of aggregation visible.

Begin this chapter's readings →

Further university reading

The chapter bridges and reasoning checks are original KernelStats material. These sources offer further study; they have not reviewed or endorsed this book. Read about sources and review limits.