توضیح 1
The live starter code is self-contained and uses only runner-compatible functions.
Loading
درس 7 از 22
Describe centre, spread, shape, relationships, and unusual observations without turning discovery into confirmation.
Motivation
EDA reveals scale, structure, and quality problems before a model compresses the data into coefficients.
Why this matters
Describe centre, spread, shape, relationships, and unusual observations without turning discovery into confirmation.
Packages and data
Base stats; ggplot2 is optional for polished graphics.
توضیح 1
The live starter code is self-contained and uses only runner-compatible functions.
توضیح 2
Book-only outputs are labelled when the separate source dataset or advanced package was not supplied.
توضیح 3
R code, paths, function names, and formulas remain left-to-right in every locale.
اصطلاحات
Typical location measured by statistics such as mean or median.
Median resists extreme values
Variation measured by SD, IQR, or quantiles.
Report the unit and period
Pattern discovery that generates questions and checks assumptions.
Not untouched confirmatory evidence
نمادگذاری و فرمولها
IQR = Q3 - Q1
The IQR spans the middle half and is less sensitive to tails than the standard deviation.
مثال حلشده
سناریو
What do centre, spread, and quantiles reveal about an illustrative inflation sample?
بررسی با R
x <- c(1.4,1.9,2.1,2.3,2.7,3.4,4.8,6.2)
print(c(mean=mean(x), median=median(x), sd=sd(x), IQR=IQR(x)))
print(quantile(x, c(.25,.5,.75)))
hist(x, breaks=5, main='Inflation distribution', xlab='Percent')The sample is right-skewed, so centre should be described with both mean and median. Limitation: Histogram appearance depends on bin boundaries, and eight observations cannot establish a population distribution.
Visual
Counts thin into the upper tail.
ارتباط با R
Run the self-contained starter code in the protected STATLAB R runner. The code prints an auditable result and avoids network or unrestricted file access.
Live R Lab
Run a self-contained example, verify its output, and explain one limitation for exploratory data analysis.
Ready to run
Common mistake
Points beyond 1.5 IQR are flags, not automatically errors.
STATLAB Tip
Describe what the plot shows, a plausible interpretation, and what evidence is still needed.
تمرین هدایتشده
سناریو
Plot an empirical CDF and compare its quartiles with quantile().
Compare your result with the definition, units, and model assumptions—not only with a target number.
Exercises
Complete these without looking at the selected solutions. More than one defensible program may exist.
توضیح 1
Compare mean, median, SD, and IQR.
توضیح 2
Draw histograms with two bin counts.
توضیح 3
List two reasons a scatterplot is not causal evidence.
Selected solutions
These are compact solution routes. Confirm dimensions, units, and any changed modelling choices.
توضیح 1
c(mean=mean(x), median=median(x), sd=sd(x), IQR=IQR(x))
توضیح 2
Use hist(x, breaks=3) and hist(x, breaks=8); observations do not change.
توضیح 3
Confounding and reverse timing remain possible.
Chapter summary
Describe centre, spread, shape, relationships, and unusual observations without turning discovery into confirmation.
توضیح 1
Report centre, spread, shape, and context.
توضیح 2
Graphics have tuning choices.
توضیح 3
Investigate unusual observations.
توضیح 4
Exploration is not confirmation.
اصطلاحات
centre
Use in Exploratory Data Analysis.
spread
Use in Exploratory Data Analysis.
cut points
Use in Exploratory Data Analysis.
cumulative distribution
Use in Exploratory Data Analysis.
References and provenance
Safavi (2026), Chapter 7. Student notes: Mohammad Safavi, Ph.D., STATLAB Academy, Version 1.0.
منبع
The authoritative 125-page English PDF accompanies this native lesson.
دریافتبازاندیشی
Name the assumption, evidence you would seek, and how the recommendation might change.
ارزیابی پایانی