Statistics Basics

Fundamental statistical measures and concepts.

  • JSON5,017 B
  • YAML3,574 B · −29%
  • TOON2,850 B · −43%

The basic measures of central tendency, spread and association: mean, median, mode, variance, standard deviation, correlation and the z-score, plus range, interquartile range, covariance, skewness, standard error, coefficient of variation, confidence intervals and the p-value, each with its formula.

Use it when

  • You need the definition and formula for a descriptive statistic.
  • You are choosing a summary that is robust to outliers.

Watch out for

  • Sample and population versions differ (n versus n - 1 in the denominator).
  • A p-value is not the probability that a hypothesis is true, and correlation does not establish causation.

The data

MeasureDescriptionFormula
Mean (Average)Sum of all values divided by count.xbar = Sum(xi) / n
MedianMiddle value when data is sorted. Robust to outliers.Middle element (or avg of two)
ModeMost frequently occurring value in the dataset.argmax frequency
VarianceAverage squared deviation from the mean.sigma2 = Sum(xi - xbar)2 / n
Standard DeviationSquare root of variance; measures spread in original units.sigma = sqrt(variance)
CorrelationMeasure of linear relationship between two variables.r = Cov(X,Y) / (sigma_x * sigma_y)
Z-ScoreNumber of standard deviations a value is from the mean.z = (x - xbar) / sigma
RangeDifference between the largest and smallest value; very sensitive to outliers.max - min
Interquartile RangeSpread of the middle half of the data; robust to outliers.Q3 - Q1
CovarianceHow two variables vary together; positive when they tend to move in the same direction.cov(X, Y) = E[(X - mean(X)) (Y - mean(Y))]
SkewnessAsymmetry of a distribution; positive when the right tail is longer.E[((X - mean) / sd)^3]
Standard Error of the MeanStandard deviation of the sample mean across repeated samples.sd / sqrt(n)
Coefficient of VariationStandard deviation relative to the mean, allowing comparison across different scales.sd / mean
Confidence Interval for a MeanA range computed so that, over repeated samples, it contains the true mean a stated share of the time.mean +/- z * sd / sqrt(n)
p-valueProbability of data at least as extreme as observed if the null hypothesis were true.P(data at least this extreme | H0)

Fields

The shape of this dataset, read from the data itself: every column, its type and a real value. Agents can use this to plan a query without fetching the whole document.

SectionFieldTypeExample
datameasurestringMean (Average)
datadescriptionstringSum of all values divided by count.
dataformulastringxbar = Sum(xi) / n

Fetch the same bytes

The static files contain the same reference rows as the API, with no API rate limit. Live metadata, such as view counts, may differ. Use the API for content negotiation; use the static files for a cacheable snapshot.

curl "https://yjtoon.yunusemrevurgun.com/api/dataset/statistics-basics?format=toon"
const res = await fetch(
  "https://yjtoon.yunusemrevurgun.com/static-data/dataset/statistics-basics.toon"
);
const toon = await res.text();

Rate limit: 120 requests per minute per IP, no key and no signup. API reference →

Topics

  • math
  • statistics
  • probability
  • data-science

Search the library

Search by a topic, title, or keyword.

Start with a collection

Browse all 205 datasets