Two-sample t-test

Last updated: June 19, 2025

Two-sample t-test

Year 1

Year 1

Skin histology
Introduction to pharmacology
Skin anatomy and physiology
Wound healing
Introduction to biostatistics
Types of data
Vaccinations
Inflammation
Nuclear structure
Pharmacodynamics: Agonist, partial agonist and antagonist
DNA structure
Anemia: Clinical
Anatomy of the heart
Hypertension
Hypertension: Clinical
Myocardial infarction
Clinical trials
Mitosis and meiosis
Calcium channel blockers
Class III antiarrhythmics: Potassium channel blockers
Pharmacokinetics: Drug elimination and clearance
Pharmacokinetics: Drug metabolism
Pharmacokinetics: Drug absorption and distribution
Acetaminophen (Paracetamol)
Non-steroidal anti-inflammatory drugs
Opioid agonists, mixed agonist-antagonists and partial agonists
Cardiac muscle histology
Blood histology
Artery and vein histology
Arteriole, venule and capillary histology
Loop diuretics
Thiazide and thiazide-like diuretics
Potassium sparing diuretics
Osmotic diuretics
Carbonic anhydrase inhibitors
Bone histology
Cartilage histology
Skeletal muscle histology
Central nervous system histology
Peripheral nervous system histology
Diabetes mellitus
Phenylketonuria (NORD)
Homocystinuria
Familial hypercholesterolemia
Fats and lipids
Cholesterol metabolism
Carbohydrates and sugars
Proteins
Extracellular matrix
Cytoskeleton and intracellular motility
Cell signaling pathways
Citric acid cycle
Electron transport chain and oxidative phosphorylation
Amino acid metabolism
Nitrogen and urea cycle
Nucleotide metabolism
Introduction to biostatistics
Types of data
Probability
Mean, median, and mode
Range, variance, and standard deviation
Standard error of the mean (Central limit theorem)
Normal distribution and z-scores
Type I and type II errors
Study designs
Ecologic study
Cross sectional study
Case-control study
Cohort study
Randomized control trial
Sensitivity and specificity
Positive and negative predictive value
Test precision and accuracy
Atrophy, aplasia, and hypoplasia
Hyperplasia and hypertrophy
Metaplasia and dysplasia
Bone tumors
Osteomyelitis
Osteoporosis
Osteomalacia and rickets
Septic arthritis
Cauda equina syndrome
The Oral Microbiota and Systemic Health
Bacterial structure and functions
Nasal cavity and larynx histology
Trachea and bronchi histology
Bronchioles and alveoli histology
Inheritance patterns
Mendelian genetics and punnett squares
Hardy-Weinberg equilibrium
DNA mutations
Neuromuscular junction and motor unit
Pharmacodynamics: Drug-receptor interactions
Cholinergic receptors
Adrenergic receptors
Blood products and transfusion: Clinical
Muscle contraction
Sliding filament model of muscle contraction
Nervous system anatomy and physiology
Parasympathetic nervous system
Slow twitch and fast twitch muscle fibers
Enteric nervous system
Sympathetic nervous system
Resting membrane potential
Neuron action potential
Cell membrane
Selective permeability of the cell membrane
Blood groups and transfusions
Blood components
Oxygen binding capacity and oxygen content
Oxygen-hemoglobin dissociation curve
Body fluid compartments
Movement of water between body compartments
Platelet plug formation (primary hemostasis)
Coagulation (secondary hemostasis)
Clot retraction and fibrinolysis
Carbon dioxide transport in blood
Bones of the vertebral column
Bones of the vertebral column
Joints of the vertebral column
Joints of the vertebral column
Joints of the wrist and hand
Bones of the upper limb
Fascia, vessels and nerves of the upper limb
Anatomy of the brachial plexus
Anatomy of the arm
Muscles of the forearm
Vessels and nerves of the forearm
Muscles of the hand
Anatomy of the sternoclavicular and acromioclavicular joints
Anatomy of the glenohumeral joint
Anatomy of the elbow joint
Anatomy of the radioulnar joints
Paired t-test
Two-sample t-test
Hypothesis testing: One-tailed and two-tailed tests
Methods of regression analysis
Spearman's rank correlation coefficient
Mann-Whitney U test
Chi-squared test
Kaplan-Meier survival analysis
Incidence and prevalence
Relative and absolute risk
Odds ratio
Attributable risk (AR)
Direct standardization
Indirect standardization
Disease causality
Selection bias
Information bias
Confounding
Innate immune system
Complement system
T-cell activation
B-cell activation, differentiation, and contraction
Cell-mediated immunity of natural killer and CD8 cells
Antibody classes
Upper respiratory tract infection
Heart failure
Lipid-lowering medications: Statins
Lipid-lowering medications: Fibrates
Miscellaneous lipid-lowering medications
Dyslipidemias: Pathology review
Atherosclerosis and arteriosclerosis: Pathology review
Familial hypercholesterolemia
Deep vein thrombosis and pulmonary embolism: Pathology review
Chronic venous insufficiency
Ischemia
ECG cardiac infarction and ischemia
Angina pectoris
Aneurysms
Asthma: Clinical
Chronic bronchitis
Emphysema
Pulmonary hypertension
Idiopathic pulmonary fibrosis
Bronchiectasis
Lung cancer
Chronic obstructive pulmonary disease (COPD): Clinical
Respiratory distress syndrome: Pathology review
Myocardial infarction
Vasculitis
ACE inhibitors, ARBs and direct renin inhibitors
Adrenergic receptors
Adrenergic antagonists: Alpha blockers
Class II antiarrhythmics: Beta blockers
Adrenergic antagonists: Beta blockers
Antiplatelet medications
Anticoagulants: Heparin
Anticoagulants: Warfarin
Anticoagulants: Direct factor inhibitors
Calcium channel blockers
cGMP mediated smooth muscle vasodilators
Bronchodilators: Beta 2-agonists and muscarinic antagonists
Bronchodilators: Leukotriene antagonists and methylxanthines
Pulmonary corticosteroids and mast cell inhibitors
Arteriole, venule and capillary histology
Microcirculation and Starling forces
Blood pressure, blood flow, and resistance
Resistance to blood flow
Lymphatic system anatomy and physiology
Laminar flow and Reynolds number
Compliance of blood vessels
Pressures in the cardiovascular system
Physiological changes during exercise
Measuring cardiac output (Fick principle)
Stroke volume, ejection fraction, and cardiac output
Frank-Starling relationship
Pressure-volume loops
Changes in pressure-volume loops
Cardiac work
Cardiac preload
Cardiac afterload
Law of Laplace
Baroreceptors
Renin-angiotensin-aldosterone system
Chemoreceptors
Cardiac conduction system
Action potentials in pacemaker cells
Action potentials in myocytes
Cardiac excitation-contraction coupling
Cardiac contractility
ECG basics
Cerebral circulation
Coronary circulation
Respiratory system anatomy and physiology
Reading a chest X-ray
Lung volumes and capacities
Anatomic and physiologic dead space
Alveolar surface tension and surfactant
Ventilation
Regulation of pulmonary blood flow
Zones of pulmonary blood flow
Pulmonary shunts
Ventilation-perfusion ratios and V/Q mismatch
Airflow, pressure, and resistance
Diffusion-limited and perfusion-limited gas exchange
Gas exchange in the lungs, blood and tissues
Oxygen binding capacity and oxygen content
Oxygen-hemoglobin dissociation curve
Carbon dioxide transport in blood
Carpal tunnel syndrome

Transcript

Watch video only

Content Reviewers

Contributors

The Student’s t-test or simply, the t-test, is a type of parametric statistical test used to determine if there’s a significant difference between the means or averages of two groups.

And significance is normally defined by a p-value of less than 0.05 or 5%.

Now when doing any parametric test, there are three key assumptions that we have to make about the population.

First, the sample population must have been recruited randomly.

Choosing names randomly ensures that the people included in the study will have similar characteristics to the target population.

This is important because that ensures that the results of the t-test can be applied to the target population - meaning it has good external validity!

The second assumption is that each individual in the sample was recruited independently from other individuals in the sample.

In other words, no individuals influenced whether or not any other individual was included in the study.

For example, if two friends decided to get their blood pressures measured on the same day, and they were both included in the study, these two individuals would not be independent of each other and the second assumption would not be met.

Like random sampling, independent recruitment of individuals is important because it ensures that the sample population approximates the target population.

The third assumption is that the sample size is large enough to approximate the target population, which usually means having more than 20 people.

If it’s impossible to get a large sample size, then the sample population must follow a normal bell-shaped distribution for the characteristic being studied because that’s what we would expect to see in the target population.

Okay, now let’s say you want to figure out if a certain medication lowers systolic blood pressure.

So you find 25 people who have been on the medication for 6 weeks, and figure out that the mean systolic blood pressure for the whole group is 130 mmHg. Then, you find another 30 people who have not been taking that medication, and find out the mean systolic blood pressure for that group is 138 mmHg.

Now, to figure out if a difference in systolic blood pressure from 130 to 138 is significant, we could perform a t-test.

Specifically, since the two means were measured in two different populations, we would use an unpaired or two-sample t-test.

This is different than a paired t-test, which is used to compare the same population before and after the treatment.

For example, a paired t-test could compare the systolic blood pressure measurements of a group of 25 people before using the medication to the systolic blood pressure measurements of the same people after using the medication for six weeks.

Typically, an unpaired t-test starts with two hypotheses.

The first hypothesis is the null hypothesis, and it basically says that the difference in means between the two groups is equal to zero.

In other words, the null hypothesis is that taking the medication results in no difference in systolic blood pressure.

The second hypothesis is the alternate hypothesis, and since a t-test can be either one-sided or two-sided, there are two versions of the alternative hypothesis.

The alternate hypothesis for a one-sided t-test would either state that the difference in means is a positive number or that the difference in means is a negative number.

The alternate hypothesis for a two-sided t-test would state that the difference in means for both groups is not equal to zero, but it wouldn’t specify if it was positive or negative.

Typically, researchers choose to use two-sided t-tests, since they usually don’t know how the medication will affect people who take it.

So, the two-sided alternative hypothesis for our study would state that the difference in means in systolic blood pressure for people that take the medication compared to people who don’t take the medication is not equal to zero.

To test these hypotheses, we need to calculate a t-score, which is a ratio of the difference in means between the two groups to the standard error of the difference in means between the two groups.

Now, for an unpaired t-test, the t-score depends on whether the variance between the two groups is equal or unequal.

Variance is a measure of how spread out each individual blood pressure reading is from the group mean.

A large variance means that the numbers are very spread out from the mean, like if the mean blood pressure was 130 and the individual measurements included numbers like 112, 142, and 155.

A small variance means that the numbers are very close to the mean, like if the mean blood pressure was 130 and the individual measurements included numbers like 129, 131, and 135.

The variance is the square of the standard deviation - which is another measure of how spread out individual values are from the group mean.

As a general rule, if one group has a variance that’s more than double the other group’s variance, then the variance is unequal.

So, if the standard deviation for the no medication group is 12, then the variance would be 12 squared, or 144.

And if the standard deviation for the no medication group is 5, then the variance would be 5 squared, or 25.

Since the variance of the no medication group is more than double the variance of the medication group, the variance is unequal.

Now to calculate the t-score, let’s start with the first part - the difference in means between the two groups.

In our case, that’s the difference in the mean systolic blood pressure for individuals who took the medication and who didn’t take the medication, and it’s represented by the symbol d-bar.

The mean systolic blood pressure for the no medication group is 138 and the mean systolic blood pressure for the medication group is 130, so the difference in means is 8.

Key Takeaways

The two-sample t-test is a statistical method used to compare the means of two independent samples of continuous data. It is used to determine whether the means of the two samples are significantly different from each other, taking into account the variability of the data within each sample.

The t-test calculates a t-value, which is then compared to a critical value from a t-distribution with degrees of freedom equal to the sum of the sample sizes minus two. If the calculated t-value is greater than the critical value, the null hypothesis of no difference between the means is rejected, indicating that there is a significant difference between the means of the two samples. The two-sample t-test is commonly used in a variety of research fields, including medicine, psychology, and engineering, to compare two groups or treatments.