Statistical analysis

Table of contents

  1. Descriptive Statistics
  2. Inferential Statistics: Making The Leap from Sample to Population
  3. Inferential Statistics: Making the Leap from sample to population 2 – 09/28/26
  4. t-tests for Independent Groups and Paired Designs

1. Descriptive Statistics

1.1 Variable types

Variables in research can be classified into two main categories: continuous and discrete. This classification helps in understanding the nature of the data and choosing appropriate statistical methods.

  • Continuous variable: A variable that can take on any value within a given range. There are an unlimited number of possible values between any two given values.
  • Examples include height, weight, time, and temperature.
  • Discrete variable: A variable that can only take on specific, distinct, or separated values. These are often whole numbers and cannot have fractional values between them.
  • Examples include the number of eggs in a basket, the number of children in a family, or the number of toys in a box.

1.2 Pictures of data: Histograms

Histograms are graphical tools used to visualize the distribution of data, particularly for continuous variables. They help in understanding the shape, center, and spread of the data.

  • Histogram: A graphical representation that displays the distribution of numerical data. The data is divided into bins (intervals), and the height of each bar represents the number of observations that fall within that bin.
  • Histograms are useful for depicting the frequency distribution of a dataset.
  • They allow for quick visual assessment of data patterns, such as skewness and modality.

1.3 Measures of central tendency

Measures of central tendency provide a single value that represents the center or typical value of a dataset. The most common measures are the mean, median, and mode.

  • Mean: The average of a dataset, calculated by summing all values and dividing by the number of values.
  • Represented by μ\mu for a population and MM for a sample.
  • It is sensitive to outliers, especially in smaller datasets.
  • Median: The middle value in a dataset when the data is ordered from least to greatest.
  • If there is an even number of data points, the median is the average of the two middle values.
  • It is less affected by outliers than the mean and can be used for ordinal data.
  • Mode: The value that appears most frequently in a dataset.
  • It can be used for any level of measurement, including nominal data.
  • A dataset can have one mode (unimodal), two modes (bimodal), or more (multimodal).

1.4 Measures of spread

Measures of spread, also known as measures of variability or dispersion, describe how spread out or clustered the data points are. Key measures include range, standard deviation, variance, and interquartile range.

MeasureDescriptionSensitivity to Outliers
RangeThe difference between the maximum and minimum scores in a dataset.High
Standard Deviation (s or σ)The average or typical deviation of data points from the mean.High
Variance (s² or σ²)The average of the squared deviations from the mean; expressed in squared units.High
Interquartile Range (IQR)The difference between the third quartile (Q3) and the first quartile (Q1).Low
  • Quartiles: These divide the data into four equal parts.
  • Q1: The 25th percentile.
  • Q2: The 50th percentile (same as the median).
  • Q3: The 75th percentile.
  • Interquartile Range (IQR): Calculated as Q3 - Q1, it represents the spread of the middle 50% of the data and is resistant to extreme values.

1.5 Individual data points: Z-scores

A z-score standardizes an individual's score by expressing it in terms of standard deviation units from the mean. This allows for comparisons across different datasets with varying scales and units.

  • Z-score: A measure of how many standard deviations an individual score is away from the mean.
  • The formula for a z-score is z=X−μσz = \frac{X - \mu}{\sigma} for a population, or z=X−Msz = \frac{X - M}{s} for a sample, where XX is the individual score, μ\mu or MM is the mean, and σ\sigma or ss is the standard deviation.
  • Z-scores provide standardization, enabling comparisons between scores from different measurement scales.
  • Standard Normal Distribution: A normal distribution with a mean of 0 and a standard deviation of 1. Transforming all scores in a population to z-scores results in this distribution.

📝 If a student scores 85 on a test where the class mean is 70 and the standard deviation is 10, their z-score is z=85−7010=1.5z = \frac{85 - 70}{10} = 1.5. This means their score is 1.5 standard deviations above the mean.

2. Inferential Statistics: Making The Leap from Sample to Population

2.1 Z-scores and the Standard Normal Distribution

  • A z-score indicates how many standard deviations a data point is away from the mean.
  • The standard normal distribution is a normal distribution with a mean of 0 and a standard deviation of 1.
  • The percentage of the distribution lying below a specific z-score can be determined. For instance, 50% of the distribution is below a z-score of 0.
  • A z-score can also represent a percentile; a z-score below which a certain percentage of the distribution falls is the corresponding percentile.

📝 If 84% of the distribution lies below a certain z-score, that z-score represents the 84th percentile.

2.2 From Samples to the Population

  • Sample statistics (M for mean, s for standard deviation) are used to estimate population parameters (μ\mu for population mean, σ\sigma for population standard deviation).
  • Sample statistics are expected to vary from sample to sample due to sampling variability.
  • Population parameters (μ\mu, σ\sigma) are consistent for an entire population.
  • Sample means (M) are useful for predicting population means (μ\mu).

2.3 The Dance of the Means: Sampling Distributions

  • Taking the means of many samples helps visualize the differences between samples and how they relate to the population mean.
  • Due to sampling variability, a range of sample means is expected, but they generally cluster around the population mean (μ\mu).
  • Larger sample sizes (N) typically result in sample means that are closer to the population mean, leading to a narrower distribution of sample means.
  • Smaller sample sizes lead to more dramatic variations in sample means.

2.4 The Mean Heap: Sampling Distribution of Sample Means

  • The sampling distribution of sample means, often visualized as a "mean heap," is the empirical distribution of sample means.
  • This distribution approximates a normal distribution, even if the population distribution is not normal, especially with larger sample sizes.
  • The mean of the sampling distribution of sample means estimates the population mean (μ\mu).
  • The standard deviation of the sampling distribution of sample means is called the standard error of the mean (SEM).

2.5 The Standard Error of the Mean (SEM)

  • The SEM quantifies the precision of the sample mean (M) as an estimate of the population mean (μ\mu).
  • A smaller SEM indicates a more precise estimate of μ\mu.
  • A larger SEM indicates a less precise estimate of μ\mu.
  • The SEM is calculated as the standard deviation of the sampling distribution of sample means.
StatisticRepresents
SD (Standard Deviation)Descriptive statistic describing variability within a sample
SEM (Standard Error of the Mean)Inferential statistic capturing variability in the estimate of the population mean
  • To reduce the SEM by half, the sample size (N) must be multiplied by four.
  • As the sample size (N) decreases, the precision of the estimate decreases, leading to a larger SEM.

2.6 The Central Limit Theorem

  • The Central Limit Theorem states that the sampling distribution of sample means will be approximately normal, regardless of the shape of the original population distribution.
  • A larger sample size (N) results in a sampling distribution of sample means that is more closely normal.

2.7 Errors of Estimation

  • Estimation error is the difference between a sample mean (M) and the population mean (μ\mu), represented as (M−μ)(M - \mu).
  • This error reflects the distance between the point estimate from the sample and the true population parameter.
  • Estimation error varies for each individual sample mean.
  • Similar to how individual observations can be expressed as z-scores, estimation error can also be expressed as a z-score within the sampling distribution.

3. Inferential Statistics: Making the Leap from sample to population 2 – 09/28/26

3.1 Margin of error (MoE)

The margin of error (MoE) quantifies the largest likely error in an estimation. This "likely" is typically set at 95%, meaning that 95% of sample means are expected to fall within this margin around the true population mean.

  • The MoE is calculated by combining the sample mean with a Z-score that corresponds to the desired confidence level.
  • For a 95% confidence level, the Z-score is 1.96.
  • The formula for the standard error of the mean (SEM) is used in conjunction with the Z-score to determine the MoE.

3.2 Confidence intervals (CI)

A confidence interval (CI) provides a range of values within which the true population parameter is likely to lie. It is constructed by adding and subtracting the margin of error from the sample statistic.

  • When the population standard deviation (σ\sigma) is known, the MoE is calculated using the Z-score for the desired confidence level multiplied by the SEM.
  • A 95% CI is calculated as: Sample Mean ±\pm (Z-score for 95% ×\times SEM).
  • The Z-score of 1.96 is used for a 95% confidence level, as it captures 95% of the area under a normal distribution curve.

3.3 The dance of the CIs

The "dance of the CIs" illustrates that while random sampling means most sample means do not exactly equal the population mean (μ\mu), most calculated confidence intervals do contain μ\mu. However, some intervals will inevitably fail to capture μ\mu, meaning 100% certainty is not achievable.

3.4 When the population standard deviation (σ\sigma) is unknown

When the population standard deviation (σ\sigma) is unknown, the sample standard deviation (ss) is used as its best estimate. This necessitates a shift from the Z-distribution to the t-distribution.

3.5 The t-distribution

The t-distribution is similar to the normal distribution but has higher tails. This is because both the sample mean and the sample standard deviation are estimates, introducing additional variability.

  • Calculating a t-score requires an additional piece of information: degrees of freedom (df).
  • The t-distribution allows for the calculation of confidence intervals when σ\sigma is unknown.

3.6 Degrees of freedom (df)

Degrees of freedom (df) represent the number of independent pieces of information available in a dataset.

  • The formula for df is typically N−1N-1, where NN is the sample size.
  • Knowing the df is crucial for selecting the correct t-distribution curve and finding the appropriate critical t-values.

3.7 Confidence intervals when σ\sigma is unknown

When σ\sigma is unknown, confidence intervals are calculated using the sample standard deviation (ss) and critical t-values instead of Z-scores.

  • The length of the CI becomes more dependent on the sample's standard deviation (ss), which can vary more between samples than the known population standard deviation.
  • The general formula for a CI when σ\sigma is unknown is: Sample Mean ±\pm (t-value for desired confidence level and df ×\times SEM using ss).

3.8 Null Hypothesis Significance Testing (NHST)

Null Hypothesis Significance Testing (NHST) is a dominant framework for testing hypotheses about population means.

  • Null Hypothesis (H0H_0): The skeptical hypothesis, stating there is no effect or difference (e.g., "The mean IQ of UoG students is equal to 100").
  • Alternative Hypothesis (HaH_a): Mutually exclusive with the null, predicting a difference (e.g., "The mean IQ of UoG students is NOT equal to 100").

3.9 NHST Steps

  1. Formulate Hypotheses: State the null and alternative hypotheses.
  2. Collect Data: Gather a sample from the population of interest.
  3. Evaluate Likelihood: Determine the probability of obtaining the sample data if the null hypothesis were true.

3.10 NHST and Confidence Intervals

  • If the value specified by the null hypothesis falls within the 95% CI calculated from the sample, the null hypothesis is accepted (we cannot conclude the population mean is different).
  • If the null hypothesis value falls outside the 95% CI, the null hypothesis is rejected (we conclude the population mean is likely different).

3.11 p-values

A p-value indicates the probability of observing the obtained results, or more extreme results, if the null hypothesis were true.

  • A common threshold for statistical significance is α=0.05\alpha = 0.05.
  • If p<αp < \alpha, the null hypothesis is rejected.
  • If p≥αp \ge \alpha, the null hypothesis is not rejected.

3.12 One-sample t-test

This test compares a sample mean to a known or hypothesized population mean when σ\sigma is unknown.

  • The obtained t-value is compared to critical t-values that define the rejection regions based on the chosen alpha level (α\alpha).
  • Example: N=40N = 40, M=106M = 106, SD=12SD = 12. The calculated t-value would be compared to the critical t-value for df=39df = 39 and α=0.05\alpha = 0.05.

3.13 Decision Making with NHST

  • Type I Error: Rejecting the null hypothesis when it is actually true (false positive). The probability of this error is α\alpha.
  • Type II Error: Failing to reject the null hypothesis when it is actually false (false negative). The probability of this error is β\beta.

3.14 p-values and CIs for One-Sample Designs

  • A lower p-value indicates that the null hypothesis is further from the sample's point estimate.
  • When the null hypothesis value is outside the CI, the result is statistically significant at the α\alpha level, where α=1−confidence level\alpha = 1 - \text{confidence level}.

3.15 Alpha (α\alpha) and Beta (β\beta)

  • α\alpha (Alpha): Protects against Type I errors. A lower α\alpha reduces the chance of a false positive but increases the risk of a Type II error.
  • β\beta (Beta): The probability of a Type II error. It is influenced by sample size, effect size, and α\alpha.

3.16 NHST Planning: Power

Power is the probability of correctly rejecting a false null hypothesis.

  • Increasing the sample size (NN) is a primary way to increase power.
  • Power is influenced by:
  • Effect size: Larger effects are easier to detect.
  • NN (Sample size): Larger samples increase the likelihood of detecting an effect.
  • α\alpha (Alpha): A higher α\alpha increases power but also Type I error risk.

3.17 Planning with Precision

Sample size (NN) can also be determined by the desired precision of the estimates, often defined by the target margin of error.

  • A larger NN leads to a narrower CI and higher precision, but may be more costly or difficult to achieve.
  • The target MoE specifies the desired precision for a study's estimates.

3.18 Independent Groups Design

An independent groups design involves assigning participants to two separate conditions or groups.

  • The goal is to compare the means of these independent groups.
  • Example: Assigning participants to either a "pen" group or a "laptop" group for note-taking to study the effect on learning.

3.19 Difference Between Two Means

This analysis focuses on the difference between the mean scores of the two independent groups (M2−M1M_2 - M_1).

Design TypeComparison Focus
Independent Groups DesignDifference between the means of two separate groups
Paired DesignsDifference between related measurements within the same group or matched pairs

4. t-tests for Independent Groups and Paired Designs

4.1 Confidence Interval for the Difference Between Two Means

A confidence interval (CI) for the difference between two means provides a range of plausible values for the true difference between population means. This interval is calculated by taking the observed difference between sample means and adding or subtracting a margin of error (MoE).

The MoE incorporates variability within the groups and the sample sizes.

  • Calculation of the 95% CI for the difference:
  • The MoE is calculated as: MoEdiff = t_0.95(df) * S_pooled * (1/n1 + 1/n2)^0.5
  • The t_0.95(df) component is derived from the t-distribution, with degrees of freedom (df) typically calculated as N1 + N2 - 2 assuming homogeneity of variance.
  • The S_pooled component reflects the pooled variability across both groups, assuming equal variances in the populations.
  • The (1/n1 + 1/n2)^0.5 component represents the sample size component.
  • Example: For a study with M1=8.81M_1 = 8.81 and M2=14.52M_2 = 14.52, and a calculated MoEdiff of 3.02, the mean difference is 14.52−8.81=5.7114.52 - 8.81 = 5.71. The 95% CI for the difference is [5.71−3.02,5.71+3.02][5.71 - 3.02, 5.71 + 3.02], which is [2.69,8.73][2.69, 8.73].

4.2 The Independent Groups t-test

The independent groups t-test is used to determine if there is a statistically significant difference between the means of two independent groups. It tests the null hypothesis that the difference between population means is zero.

The test statistic, tobtt_{\text{obt}}, is compared to a critical value, tcritt_{\text{crit}}, or a p-value is calculated to assess significance.

  • Calculating the t-statistic for two independent groups:
  • The formula for the t-statistic is: t=(M2−M1)Spooled(1n1+1n2)t = \frac{(M_2 - M_1)}{ \sqrt{S_{\text{pooled}} (\frac{1}{n_1} + \frac{1}{n_2})} }
  • Where M1M_1 and M2M_2 are the sample means, SpooledS_{\text{pooled}} is the pooled standard deviation, and n1n_1 and n2n_2 are the sample sizes.
  • Interpretation: If the calculated tobtt_{\text{obt}} is greater than tcritt_{\text{crit}} (or if the p-value is less than the chosen alpha level, e.g., 0.05), the null hypothesis is rejected, suggesting a significant difference between the group means.
  • Example: In the PenLaptop example, the calculated t-statistic (tobtt_{\text{obt}}) was 3.78. With 63 degrees of freedom, the critical t-value (tcritt_{\text{crit}}) for a two-tailed test at α=0.05\alpha = 0.05 is approximately 1.99. Since 3.78>1.993.78 > 1.99, the null hypothesis is rejected.
  • Relationship with CI: A CI that does not include zero suggests a statistically significant difference, corresponding to a low p-value. The extent of overlap between CIs for individual group means is related to the p-value for the difference between those means.

4.3 Effect Size: Cohen's d

Cohen's d is a standardized measure of effect size that quantifies the difference between two means in terms of standard deviation units. It is useful for comparing the magnitude of effects across different studies or variables.

  • Calculation of Cohen's d:
  • d=Difference between meansStandardizer (a chosen standard deviation)d = \frac{\text{Difference between means}}{\text{Standardizer (a chosen standard deviation)}}
  • For independent groups, the standardizer is often the pooled standard deviation.
  • Interpretation:
  • Cohen's reference values for psychology: small = 0.2, medium = 0.5, large = 0.8.
  • In social psychology, an average dd is around 0.4.
  • In education, an average dd for learning influences is around 0.4.
  • In medicine, many treatments show small effects with dd between 0.05 and 0.2.
  • Example: The mean height difference between male and female humans is 14 cm, while for dogs it is 3 cm. To compare these, Cohen's d would standardize these differences by dividing by the respective standard deviations for human and dog heights.
HypothesisDecisionOutcome
H0 is trueFail to reject H0Correct Decision (1 - α)
H0 is trueReject H0Type I Error (α)
H0 is falseFail to reject H0Type II Error (β)
H0 is falseReject H0Correct Decision (1 - β, POWER)

4.4 Comparing Mean Differences Across Groups

Comparing mean differences across different groups requires standardization to account for varying scales of measurement. While raw differences are informative, standardized measures like Cohen's d allow for a more direct comparison of effect magnitudes.

GroupMean DifferenceStandardized Difference (Cohen's d)
Male lab (at shoulder)3 cmd_dogs
Female lab (at shoulder)3 cmd_dogs
Male human14 cmd_humans
Female human14 cmd_humans

© 2026 Maeve. All rights reserved. This content is protected by copyright.

See also