Biostatistics Study NotesFrom concepts and derivations to interpretation

CHAPTER 04 · TOPIC 02

t-Test Concepts

Understand why estimating an unknown population standard deviation leads to the t distribution and the shared structure of three t tests.

On this page
  1. Starting from the Z Test
  2. In Practice, the Population Standard Deviation σ Is Usually Unknown
  3. From the Z Statistic to the t Statistic
  4. Why we need degrees of freedom
  5. Comparing the Z Test and t Test
  6. Types of t Tests
  7. Basic Assumptions of t Tests

The t-test tests the population mean or mean difference. Like the Z-test, it standardizes the observed difference by its standard error. The essential difference is not the form of the equation, but whether the population standard deviation σ is known.

Starting from the Z Test#

The Z-score of an individual observation indicates how many population standard deviations it is from the population mean. The standard error σ/√n is used for the sample mean.

Z-score of individual observationZi=XiμσZ_i=\frac{X_i-\mu}{\sigma}
center of sample meanE(Xˉ)=μE(\bar X)=\mu
standard error of the sample meanSE(Xˉ)=σn\operatorname{SE}(\bar X)=\frac{\sigma}{\sqrt n}
Z-statistic of the meanZ=Xˉμ0σ/nZ=\frac{\bar X-\mu_0}{\sigma/\sqrt n}

In Practice, the Population Standard Deviation σ Is Usually Unknown#

Since the complete population cannot be observed, not only μ but also σ are usually unknown. Estimate σ by calculating the sample standard deviation s from the same sample.

sample variances2=1n1i=1n(XiXˉ)2s^2=\frac{1}{n-1}\sum_{i=1}^{n}(X_i-\bar X)^2
sample standard deviations=i=1n(XiXˉ)2n1s=\sqrt{\frac{\sum_{i=1}^{n}(X_i-\bar X)^2}{n-1}}
Estimated standard errorSE^(Xˉ)=sn\widehat{\operatorname{SE}}(\bar X)=\frac{s}{\sqrt n}

From the Z Statistic to the t Statistic#

σ is a fixed parameter, but s is a random variable. In an independent sample from a normal population, the chi-square variable U created from the standardized mean Z and sample variance is independent.

Standardization of the meanZ=Xˉμσ/nN(0,1)Z=\frac{\bar X-\mu}{\sigma/\sqrt n}\sim N(0,1)
Chi-square variable with sample varianceU=(n1)s2σ2χn12U=\frac{(n-1)s^2}{\sigma^2}\sim\chi^2_{n-1}
independenceZUZ\perp U
Construction of t-distributionT=ZU/(n1)tn1T=\frac{Z}{\sqrt{U/(n-1)}}\sim t_{n-1}
1-sample t-statistict=Xˉμ0s/n,ν=n1t=\frac{\bar X-\mu_0}{s/\sqrt n},\qquad \nu=n-1

Why we need degrees of freedom#

The lower the degrees of freedom, the greater the variation in s, and the t-distribution puts more probability in the tails. As the degrees of freedom increase, s becomes more stable and approaches the standard normal distribution.

tννdN(0,1)t_\nu\xrightarrow[\nu\to\infty]{d}N(0,1)

Comparing the Z Test and t Test#

ItemZ testt test
population standard deviationσ knownσ unknown, estimated by s
standard errorσ/√ns/√n
reference distributionN(0,1)t distribution
degree of freedomNot applicableRequired
tailslighterheavier at low degrees of freedom

Types of t Tests#

methodquestionDifference to analyze
one sample t testIs the population mean equal to μ₀?X̄−μ₀
paired t-testIs the population mean of the correspondence difference 0?Create each difference dᵢ and analyze d̄
Independent two-sample t-testAre two independent population means the same?X̄₁−X̄₂

Basic Assumptions of t Tests#

  • Random sampling or appropriate randomization and independence in line with the research design
  • Quantitative data for which averages and differences can be reasonably calculated
  • Check the observed value in one sample, the difference in paired cases, and the distribution of each group and model error in two independent samples.
  • Beware of strong distortions and outliers in small samples
  • For two independent samples, distinguish between pooled t with equal variance and Welch t, ​​which corresponds to unequal variance.