Back to Notes

Descriptive Statistics and Hypothesis Testing

Basic theory and formulas for measures of location, spread and shape, and for tests on means, proportions, variances and categorical data.

Descriptive statistics summarises a sample with a few numbers and charts. Hypothesis testing decides, based on the same sample, whether the data agree with a claim about the population. This poster brings together the basic theory and formulas of both.

Measures of Location

  • Mean: x‾=1n∑xi
  • Median: the middle value of the ordered observations
  • Mode: the value with the highest frequency
  • Quartiles: Q1, Q2 (the median) and Q3

Measures of Spread

  • Range: R=x(n)−x(1)
  • Interquartile range: IQR=Q3−Q1
  • Sample variance: s2=1n−1∑(xi−x‾)2
  • Standard deviation: s=s2
  • Coefficient of variation: CV=s/x‾

Measures of Shape

  • Skewness: g1=m3/m23/2, positive when the tail is on the right
  • Kurtosis: g2=m4/m22−3, positive when the tails are heavier than those of the normal

Charts

  • Histogram: shows the shape of the distribution
  • Box plot: a box from Q1 to Q3, a line at the median, whiskers up to 1.5⋅IQR, and outliers beyond them
  • Scatter plot: shows the relationship between two variables

Basic Concepts

  • Null and alternative hypothesis: H0 and H1, with a two-sided or one-sided alternative
  • Test statistic: the quantity from the sample on which we base the decision
  • Rejection region: the values of the test statistic for which we reject H0
  • Significance level: α, usually 0.05 or 0.01
  • p-value: the probability, under H0, of getting a value as extreme as or more extreme than the observed one; we reject H0 when p<α

Errors and Power

  • Type I error: α=P(reject H0|H0 true)
  • Type II error: β=P(do not reject H0|H1 true)
  • Power: 1−β, increases with the sample size
  • Neyman–Pearson lemma: the likelihood ratio test is the most powerful for a given α

Mean and Proportion

  • z-test, known variance: Z=x‾−μ0σ/n
  • t-test, unknown variance: T=x‾−μ0s/n, with n−1 degrees of freedom
  • Two independent samples: t-test with pooled variance sp2
  • Paired observations: t-test on the differences di
  • Proportion: Z=pˆ−p0p0(1−p0)/n

Variance and Categorical Data

  • One variance: χ2=(n−1)s2σ02
  • Two variances: F=s12/s22
  • Goodness of fit: χ2=∑(Oi−Ei)2Ei
  • Independence in a contingency table: same formula, with (r−1)(c−1) degrees of freedom