Understanding Descriptive and Inferential Statistics
An introduction to descriptive statistics (measures of central tendency and dispersion) and inferential statistics (hypothesis testing, confidence intervals, and sampling distributions) used in data analysis.
In the world of data analysis, we are constantly trying to answer two fundamental questions: "What does our data look like?" and "Is what we are seeing actually meaningful, or just a lucky coincidence?" To answer these, we rely on two pillars of mathematics: descriptive statistics, which summarize the characteristics of a dataset, and inferential statistics, which allow us to make predictions about a larger population based on a smaller sample.
Describing Your Data: Central Tendency and Dispersion
Before we can test for significance, we must first understand the "shape" and "center" of our data. This is achieved through descriptive statistics.
Measures of Central Tendency
These values provide a single number that represents the "typical" value in a dataset:
Mean (M): The arithmetic average, calculated by summing all data points and dividing by the total number of points (N).
Median: The middle value when the data is ordered from lowest to highest.
Mode: The value that appears most frequently in the dataset.
Measures of Dispersion (Spread)
Knowing the average is not enough; we also need to know how much the scores vary. If everyone in a class scores between 70% and 75%, the mean tells a very different story than if scores range from 20% to 100%.
To calculate how much scores deviate from the mean, we use the Sum of Squares (SS), which is the sum of the squared differences between each data point and the mean. From this, we derive:
Variance: The average squared deviation, calculated by dividing the Sum of Squares by the Degrees of Freedom (df). For variance, $df = N - 1$.
Standard Deviation (SD): The square root of the variance, representing the average amount scores deviate from the mean.
Interquartile Range (IQR): The difference between the 75% quartile and the 25% quartile, representing the spread of the middle 50% of the data.
The Path to Inference: From Samples to Populations
When we collect data, we are usually looking at a sample—a small subset of a larger population. Because of sampling variation, different random samples from the same population will produce slightly different results. To manage this uncertainty, we use standardized scores and distributions.
Standardized Scores and Distributions
z-score: A standardized score that tells us exactly how many standard deviations a raw score is from the mean. It is calculated as:
z=SDx−mean
Sampling Distribution: A theoretical distribution of means created by taking thousands of random samples from a population.
t-distribution: Used when sample sizes are small; it is a "compressed" version of the normal distribution that accounts for the extra uncertainty of small samples.
Estimating the Truth: Confidence Intervals and Standard Error
We rarely know the true population mean, so we estimate it using the Standard Error of the Mean (SEM). The SEM tells us how much the sample mean is expected to vary from the actual population mean. It is calculated as:
SEM=NSD
We use this to build 95% Confidence Intervals (CI), which provide a range of values likely to contain the true population mean.
Lower CI:Mean−(t-score×SE)
Upper CI:Mean+(t-score×SE)
Exam Tip: If you are comparing two groups and their 95% Confidence Intervals do not overlap, the difference between them is statistically significant (p<0.05). If they do overlap, the difference is likely due to chance.
Null Hypothesis Significance Testing (NHST)
NHST is the formal framework used to decide if an observed effect is "real" or just a result of sampling error.
The Logic of the Test
Null Hypothesis (H0): The default position that there is no difference between conditions; any observed difference is due to chance.
Alternative Hypothesis: The position that a difference does exist.
Alpha Level (α): The threshold set before the experiment (usually 0.05) to decide when to reject the null hypothesis.
p-value: The probability that the observed difference occurred by chance.
If p<0.05: The result is statistically significant; we reject the null hypothesis.
If p>0.05: The result is non-significant; we fail to reject the null hypothesis.
Dealing with Data Complications: Bias and Outliers
Real-world data is rarely perfect. Two major issues that can ruin an analysis are bias and outliers.
Bias occurs when your sample statistics are systematically different from the true population values. Outliers are scores that fall far outside the normal range of the rest of the data.
Outliers are particularly dangerous because they have a disproportionate impact on the Sum of Squared Errors (SSE). Because deviations are squared, a single extreme outlier can massively inflate the variance, standard deviation, and standard error, which then "cascades" through your entire analysis, leading to incorrect p-values and confidence intervals.
How to Detect and Fix Problems
To detect outliers, researchers use visual plots (like Boxplots or Histograms) or check if z-scores exceed certain thresholds (e.g., ∣z∣>1.96 or ∣z∣>3.29).
If your data is messy, you can use the TWAT (or WATT) methods to reduce bias:
Trimming: Deleting a percentage of extreme scores from the tails.
Winsorizing: Replacing outliers with the next most extreme non-outlier value.
Robust Methods (e.g., Bootstrapping): Treating the sample as the population by taking thousands of sub-samples to create a stable estimate.
Data Transformation: Applying mathematical functions to "squash" the data into a more normal shape.
Transformation
Best Used For...
Key Restriction
Log (log(X))
Strong positive skew, unequal variances
Cannot use 0 or negative numbers; add a constant first
Square Root (X)
Moderate positive skew
Cannot use negative numbers; add a constant first
Reciprocal (1/X)
Severe positive skew
Cannot use 0; reverses the order of scores
Reverse Score
Negative skew
Must be used before applying other transformations
Final Pro-Tip: While transformations are useful, modern statisticians like Andy Field recommend using robust procedures like bootstrapping whenever possible. Transformations change the very nature of what you are measuring (e.g., comparing geometric means instead of arithmetic means), which can make your results harder to interpret.
Keep reading for free.
Create an account to finish this reading and make it part of your study routine.