Introduction to Basic Statistics

Observed output rises by two units at each input level until the final observation jumps from the expected 21 to 35.

Figure 1. The observed relationship and a dashed continuation of the earlier pattern. The final point is evidence to investigate, not evidence to discard.

What You Will Learn

By the end of this article, you will be able to:

  • describe a numerical dataset using its center, spread, shape, and unusual values;
  • calculate and interpret the mean, median, standard deviation, quartiles, and interquartile range;
  • explain why an outlier flag is a question, not a verdict;
  • reproduce the analysis in Python; and
  • recognize when identical summary statistics conceal different patterns.

Before We Calculate: What Does One Row Mean?

A dataset is not just a list of numbers. Each row should represent an observation, and each column should represent a defined variable.

For this synthetic example, imagine that the input level is a controlled setting and the observed output is a measured response. The units are intentionally unspecified because the calculations work the same way for temperature, latency, yield, or another quantitative measure. In a real analysis, missing units would be a data-quality problem.

Our observed outputs are:

3, 5, 7, 9, 11, 13, 15, 17, 19, 35

We will treat these ten values as a sample from a process we want to understand. That choice matters when we calculate standard deviation.

Four Questions for a First Look at Data

A useful first description asks four different questions:

  1. Center: What value is typical?
  2. Spread: How much do the values vary?
  3. Shape: Are values symmetric, skewed, clustered, or separated?
  4. Unusual observations: Which values deserve investigation?

No single statistic answers all four.

Center: Mean and Median

Mean

The arithmetic mean adds all observations and divides by their count:

$$
\bar{x}=\frac{1}{n}\sum_{i=1}^{n}x_i
$$

For our outputs:

$$
\bar{x}=\frac{3+5+7+9+11+13+15+17+19+35}{10}=13.4
$$

The mean uses the magnitude of every observation. That makes it informative, but also sensitive to extreme values.

Median

The median is the middle value after sorting the observations. With an even number of observations, it is the mean of the two middle values:

$$
\tilde{x}=\frac{11+13}{2}=12
$$

The value 35 pulls the mean upward more strongly than it affects the median. Neither measure is automatically “better.” Their usefulness depends on the distribution and the question.

Measure Result What it emphasizes
Mean 13.4 Magnitude of every value
Median 12.0 Ordered middle position

Interpretation: A typical output is around 12–13, but the difference between the mean and median warns us to inspect the data rather than report one number alone.

Spread: Standard Deviation and IQR

Two datasets can have the same center and very different variability. Measures of spread describe how far values extend around the center.

Sample Standard Deviation

For a sample, the standard deviation is:

$$
s=\sqrt{\frac{\sum_{i=1}^{n}(x_i-\bar{x})^2}{n-1}}
$$

For our values, the sample standard deviation is approximately 9.18 output units.

Why square the deviations? Squaring prevents positive and negative deviations from cancelling and gives more weight to observations far from the mean. Taking the square root returns the result to the original unit.

If these ten observations were the complete population of interest, we would divide by $n$ rather than $n-1$, producing a population standard deviation of approximately 8.71. Software defaults differ, so an analysis should state which definition it uses.

Quartiles and Interquartile Range

Quartiles divide ordered data into regions. The first quartile $Q_1$ is the 25th percentile, the median $Q_2$ is the 50th percentile, and the third quartile $Q_3$ is the 75th percentile.

Using the linear percentile method employed by the accompanying script:

  • $Q_1=7.5$
  • $Q_2=12.0$
  • $Q_3=16.5$

The interquartile range measures the width of the middle half of the data:

$$
IQR=Q_3-Q_1=16.5-7.5=9.0
$$

Unlike standard deviation, the IQR is based on ordered positions and is less affected by extreme tails. Percentile methods can produce different results for small datasets, so the method should be recorded.

A Five-Number View

Statistic Value
Minimum 3.0
First quartile 7.5
Median 12.0
Third quartile 16.5
Maximum 35.0

A box plot would place the box from 7.5 to 16.5, with a line at 12. Under the common $1.5\times IQR$ convention, the fences are:

$$
\text{Lower fence}=Q_1-1.5(IQR)=-6
$$

$$
\text{Upper fence}=Q_3+1.5(IQR)=30
$$

Because 35 > 30, the value 35 is flagged as a potential outlier.

That label does not prove that 35 is wrong. It tells us to inspect its source, measurement conditions, and context. Deleting a valid unusual observation can erase the very phenomenon we need to understand.

Implementation From First Principles

The following code uses only Python’s standard library. The percentile function explicitly records its interpolation rule.

from math import sqrt

values = [3, 5, 7, 9, 11, 13, 15, 17, 19, 35]
ordered = sorted(values)
n = len(ordered)

mean_value = sum(ordered) / n
median_value = (ordered[n // 2 - 1] + ordered[n // 2]) / 2

sample_variance = sum(
    (value - mean_value) ** 2 for value in ordered
) / (n - 1)
sample_standard_deviation = sqrt(sample_variance)

def linear_percentile(data, proportion):
    position = (len(data) - 1) * proportion
    lower = int(position)
    upper = min(lower + 1, len(data) - 1)
    fraction = position - lower
    return data[lower] + fraction * (data[upper] - data[lower])

q1 = linear_percentile(ordered, 0.25)
q3 = linear_percentile(ordered, 0.75)
iqr = q3 - q1

print(f"Mean: {mean_value:.2f}")
print(f"Median: {median_value:.2f}")
print(f"Sample standard deviation: {sample_standard_deviation:.2f}")
print(f"Q1: {q1:.2f}, Q3: {q3:.2f}, IQR: {iqr:.2f}")

Expected output:

Mean: 13.40
Median: 12.00
Sample standard deviation: 9.18
Q1: 7.50, Q3: 16.50, IQR: 9.00

Implementation With Established Tools

For larger analyses, NumPy and pandas provide tested implementations:

import numpy as np
import pandas as pd

outputs = pd.Series([3, 5, 7, 9, 11, 13, 15, 17, 19, 35])

print(outputs.describe())
print("IQR:", outputs.quantile(0.75) - outputs.quantile(0.25))
print("Population standard deviation:", np.std(outputs, ddof=0))
print("Sample standard deviation:", np.std(outputs, ddof=1))

pandas.Series.describe() reports count, mean, sample standard deviation, minimum, quartiles, and maximum for numeric data. NumPy’s std defaults to ddof=0; use ddof=1 for the sample calculation shown in this article.

Failure Laboratory 1: Remove the Unusual Value

Suppose someone deletes 35 because it “looks wrong,” without investigating it.

Summary With 35 Without 35
Count 10 9
Mean 13.40 11.00
Median 12.00 11.00
Sample standard deviation 9.18 5.48

The story changes substantially. The original process may contain an error, a rare event, or a real shift at input level 10. Arithmetic cannot choose among those explanations. We need provenance and domain knowledge.

Failure Laboratory 2: When Summaries Lose Structure

Consider two sequences:

  • Sequence A: 1, 2, 3, 4, 5, 6, 7, 8, 9
  • Sequence B: 1, 9, 2, 8, 3, 7, 4, 6, 5

Both have:

  • mean 5;
  • median 5;
  • sample standard deviation approximately 2.74;
  • minimum 1; and
  • maximum 9.

Yet their order is completely different. Sequence A rises steadily; Sequence B oscillates. If order represents time, process stage, or musical sequence, the summaries have hidden the main pattern.

This is why statistical summaries should be paired with appropriate tables and visualizations. Center and spread describe values; they do not preserve every relationship among them.

Assumption Ledger

Assumption Why it matters Status here
Each row is a distinct observation Duplicated rows would distort every summary Assumed for the synthetic example
Outputs are quantitative and comparable Mean and standard deviation require meaningful numerical differences Assumed
Measurement units are consistent Mixed units make summaries meaningless Assumed; units intentionally omitted
Observation order may contain information Sorting helps calculate quantiles but can hide sequence Preserved in the original table
The ten observations are a sample Determines use of $n-1$ for sample variance Chosen for this analysis
Linear percentile interpolation is used Quartiles vary across conventions for small samples Verified in the script
35 is not automatically an error Outlier fences label observations for investigation Not verified; requires provenance

What Can We Honestly Conclude?

We observed a generally increasing sequence with one final value that departs from the earlier increments. The dataset has a mean of 13.4, a median of 12, and substantial spread that is strongly influenced by 35. Under one documented quartile convention, 35 crosses the upper IQR fence and deserves investigation.

We cannot conclude why it occurred, whether it should be removed, or whether the same pattern exists outside these ten observations. Those questions require context, additional data, and a study design.

Cross-Domain Pattern: Representation Changes What We Can See

The same observations can be represented as a list, an ordered table, a set of summaries, or a plot. Each representation preserves some information and suppresses something else.

  • Mathematics will express the relationship as a rule and function.
  • Code will turn the analysis into a repeatable process.
  • Machine learning will fit the relationship and test whether it generalizes.
  • Data engineering will preserve the measurements, definitions, and lineage needed to trust the result.

Statistics begins by asking whether the pattern survives variation and whether the evidence supports the story we want to tell.

Pattern Passport

Field Observation
Pattern observed A mostly increasing input-output relationship with one unusual response
Representation used Ordered table, numerical summaries, and sequence comparison
Transformation applied Aggregation into center, spread, quartiles, and IQR fences
Assumptions made Comparable quantitative observations, consistent units, sample interpretation, linear percentile method
Failure condition Summaries hide order, clusters, provenance, or extreme-value context
Related disciplines Mathematics, Code, Machine Learning, Data and Microsoft Fabric
Next learning step Represent the same relationship as a verbal rule, table, graph, function, and Python expression

Try It Yourself

Foundation

Calculate the mean and median after replacing 35 with 21. Why do they become equal?

Application

Add a unit and a plausible real-world meaning to the dataset. List three different explanations for 35 and the evidence you would seek for each one.

Exploration

Create a third sequence with the same values as Sequences A and B but a different order. Which summaries remain unchanged? What visualization reveals the difference?

References and Further Reading

  1. NIST/SEMATECH, Measures of Scale, e-Handbook of Statistical Methods. Accessed July 28, 2026.
  2. NIST/SEMATECH, Detection of Outliers, e-Handbook of Statistical Methods. Accessed July 28, 2026.
  3. NumPy Developers, numpy.mean, numpy.std, and numpy.percentile. Accessed July 28, 2026.
  4. pandas Developers, pandas.Series.describe. Accessed July 28, 2026.
  5. Matplotlib Development Team, matplotlib.pyplot.boxplot. Accessed July 28, 2026.

What Comes Next?

Next in Foundations: Learning to See Patterns:

From Numbers to Relationships: Why Algebra Is the Language of Patterns

We will take the same input-output observations and move among words, tables, graphs, functions, and Python expressions. The question changes from “How do the values vary?” to “What relationship might generate them?”

Revision History

  • July 28, 2026: Rebuilt the original “Introduction to Basic Statistics” as the Statistics and Probability pilot for the Foundations collection. Added a reproducible dataset, explicit assumptions, failure laboratories, implementation ladder, references, and Pattern Passport.

WordPress Publishing Fields

  • Post ID: 3680
  • New title: What Does Data Tell Us? A First Journey Through Statistics
  • Slug: introduction-to-basic-statistics (preserve to avoid breaking the existing URL)
  • Primary category: Rename existing category Statistics to Statistics and Probability; preserve category slug initially unless redirects are configured
  • Excerpt: Statistics begins with better questions, not just formulas. Analyze a small dataset through center, spread, quartiles, and potential outliers, then discover why identical summaries can conceal different patterns.
  • Suggested meta description: Learn how mean, median, standard deviation, quartiles, IQR, and outliers describe data—and what those summaries can hide—with reproducible Python examples.
  • Featured image: Required; use a purpose-built plot based on the article dataset, not the existing generated images
  • Comments: Disable unless a maintained moderation workflow is established
  • Series: Foundations: Learning to See Patterns

Pre-Publication Checklist

  • [ ] Editorial review completed
  • [ ] All calculations rerun from validate_article.py
  • [x] Purpose-built accessible chart created
  • [x] Alt text describes the instructional purpose of the chart
  • [ ] Chart checked in WordPress desktop and mobile previews
  • [ ] Equations render correctly in WordPress or are converted to accessible text
  • [ ] Code blocks remain readable without horizontal page overflow
  • [ ] Heading hierarchy contains one post-title H1 and body H2/H3 headings
  • [ ] Existing permalink remains unchanged
  • [ ] Category rename and navigation impact reviewed
  • [ ] Excerpt and meta description added
  • [ ] Draft preview checked on desktop and mobile
  • [ ] Links checked
  • [ ] Production backup date confirmed before replacing the published body
  • [ ] Final revision saved as a draft before publication

Leave a Comment

Your email address will not be published. Required fields are marked *