🎯 Learning Objectives

By the end of this practice session, you will be able to:

  • Select the appropriate t-test for different pharmaceutical scenarios
  • Perform step-by-step calculations for one-sample and two-sample t-tests
  • Interpret t-test results in the context of formulation development
  • Apply Excel functions for t-test calculations
  • Make regulatory-compliant conclusions from statistical tests

🧭 T-Test Selection Framework

1

Ask: "What am I comparing?"

One group vs. standard → One-sample t-test

Two independent groups → Two-sample t-test

Same subjects, two conditions → Paired t-test

2

Check Assumptions

✓ Data should be approximately normal

✓ Observations should be independent

✓ For two-sample: check if variances are equal

3

Choose Significance Level

α = 0.05 (most common in pharmaceuticals)

α = 0.01 (more stringent for critical decisions)

📊 One-Sample T-Test

When to Use

Compare a sample mean against a known value (e.g., label claim, specification limit, target value).

t = (x̄ - μ₀) / (s / √n)
Where: x̄ = sample mean, μ₀ = hypothesized mean, s = sample SD, n = sample size
🧪 Pharmaceutical Example: Tablet Weight Testing

Scenario: A pharmaceutical company produces tablets with a label claim of 250 mg. Quality control tests 12 tablets to verify the average weight meets the specification.

Tablet weights (mg): 248.2, 251.1, 249.8, 252.3, 247.9, 250.7, 249.3, 251.8, 248.5, 250.2, 249.6, 251.4

Step-by-Step Solution:

1

State Hypotheses

H₀: μ = 250 mg (tablets meet label claim)

H₁: μ ≠ 250 mg (tablets do not meet label claim)

α = 0.05 (two-tailed test)

2

Calculate Sample Statistics

Let's think step-by-step:

Sample mean (x̄):

Sum = 248.2 + 251.1 + 249.8 + ... + 251.4 = 3000.8 mg

x̄ = 3000.8 ÷ 12 = 250.07 mg

Sample standard deviation (s):

Using the formula: s = √[Σ(x - x̄)² / (n-1)]

s = 1.52 mg

Sample size: n = 12

3

Calculate t-statistic

t = (x̄ - μ₀) / (s / √n)

t = (250.07 - 250) / (1.52 / √12)

t = 0.07 / (1.52 / 3.464)

t = 0.07 / 0.439

t = 0.159

4

Find Critical Value and p-value

Degrees of freedom: df = n - 1 = 11

Critical value: t₀.₀₂₅,₁₁ = ±2.201 (two-tailed)

p-value: p ≈ 0.876 (using t-distribution)

5

Make Decision

Since |t| = 0.159 < 2.201 and p = 0.876 > 0.05:

Decision: Fail to reject H₀

Conclusion: There is insufficient evidence to conclude that the tablet weights differ significantly from the 250 mg label claim.

💻 Excel Implementation

Function: =T.TEST(array, μ₀, tails, type)

For one-sample t-test: =T.TEST(A1:A12, 250, 2, 1)

Alternative functions:

  • =AVERAGE(A1:A12) → Calculate sample mean
  • =STDEV.S(A1:A12) → Calculate sample standard deviation
  • =T.INV.2T(0.05, 11) → Get critical t-value

📈 Two-Sample Independent T-Test

When to Use

Compare means of two independent groups (e.g., different formulations, different batches, treatment vs. control).

Equal Variances (Pooled):
t = (x̄₁ - x̄₂) / (s_pooled × √(1/n₁ + 1/n₂))
s_pooled = √[(s₁²(n₁-1) + s₂²(n₂-1)) / (n₁+n₂-2)]
🧪 Pharmaceutical Example: Formulation Comparison

Scenario: A pharmaceutical company wants to compare the dissolution rate of two tablet formulations (A and B) at 30 minutes.

Formulation A (% dissolved) Formulation B (% dissolved)
78.282.1
79.883.4
77.581.8
80.184.2
78.982.7
79.383.1
78.682.5
79.783.8

Step-by-Step Solution:

1

State Hypotheses

H₀: μ₁ = μ₂ (no difference between formulations)

H₁: μ₁ ≠ μ₂ (formulations have different dissolution rates)

α = 0.05 (two-tailed test)

2

Calculate Sample Statistics

Formulation A:

x̄₁ = 79.01%, s₁ = 0.91%, n₁ = 8

Formulation B:

x̄₂ = 82.95%, s₂ = 0.86%, n₂ = 8

3

Check Equal Variances (F-test)

F = s₁²/s₂² = 0.91²/0.86² = 0.828/0.740 = 1.12

F_critical(7,7,0.05) = 3.79

Since F < F_critical, assume equal variances

4

Calculate Pooled Standard Deviation

s_pooled = √[(s₁²(n₁-1) + s₂²(n₂-1)) / (n₁+n₂-2)]

s_pooled = √[(0.91²×7 + 0.86²×7) / (8+8-2)]

s_pooled = √[(5.80 + 5.18) / 14]

s_pooled = √[10.98 / 14] = 0.885%

5

Calculate t-statistic

t = (x̄₁ - x̄₂) / (s_pooled × √(1/n₁ + 1/n₂))

t = (79.01 - 82.95) / (0.885 × √(1/8 + 1/8))

t = -3.94 / (0.885 × √0.25)

t = -3.94 / (0.885 × 0.5)

t = -8.90

6

Find Critical Value and p-value

Degrees of freedom: df = n₁ + n₂ - 2 = 14

Critical value: t₀.₀₂₅,₁₄ = ±2.145

p-value: p < 0.001 (highly significant)

7

Make Decision

Since |t| = 8.90 > 2.145 and p < 0.001 < 0.05:

Decision: Reject H₀

Conclusion: There is strong evidence that Formulation B has significantly higher dissolution rate than Formulation A (82.95% vs 79.01%, p < 0.001).

💻 Excel Implementation

Equal variances: =T.TEST(array1, array2, 2, 2)

Unequal variances: =T.TEST(array1, array2, 2, 3)

F-test for variances: =F.TEST(array1, array2)

🔗 Paired T-Test

When to Use

Compare two measurements on the same subjects (e.g., before/after treatment, crossover studies, matched pairs).

t = d̄ / (s_d / √n)
Where: d̄ = mean difference, s_d = standard deviation of differences
🧪 Pharmaceutical Example: Bioavailability Study

Scenario: A crossover bioavailability study compares AUC values for test and reference formulations in 10 healthy volunteers.

Subject Test AUC (ng·h/mL) Reference AUC (ng·h/mL) Difference (T-R)
1125.3128.7-3.4
2134.8132.12.7
3118.2121.5-3.3
4142.6139.82.8
5127.9125.32.6
6136.4134.71.7
7129.1131.8-2.7
8145.2143.91.3
9122.8126.2-3.4
10138.7136.52.2

Step-by-Step Solution:

1

State Hypotheses

H₀: μ_d = 0 (no difference between formulations)

H₁: μ_d ≠ 0 (formulations have different bioavailability)

α = 0.05 (two-tailed test)

2

Calculate Difference Statistics

Differences: -3.4, 2.7, -3.3, 2.8, 2.6, 1.7, -2.7, 1.3, -3.4, 2.2

Mean difference (d̄):

d̄ = (-3.4 + 2.7 + ... + 2.2) ÷ 10 = -0.15 ng·h/mL

Standard deviation of differences (s_d):

s_d = 2.84 ng·h/mL

3

Calculate t-statistic

t = d̄ / (s_d / √n)

t = -0.15 / (2.84 / √10)

t = -0.15 / (2.84 / 3.162)

t = -0.15 / 0.898

t = -0.167

4

Find Critical Value and p-value

Degrees of freedom: df = n - 1 = 9

Critical value: t₀.₀₂₅,₉ = ±2.262

p-value: p ≈ 0.871

5

Make Decision

Since |t| = 0.167 < 2.262 and p = 0.871 > 0.05:

Decision: Fail to reject H₀

Conclusion: There is no significant difference in bioavailability between the test and reference formulations (mean difference = -0.15 ng·h/mL, p = 0.871).

💻 Excel Implementation

Function: =T.TEST(array1, array2, 2, 1)

Alternative approach:

  1. Create difference column: =B2-C2
  2. Calculate mean difference: =AVERAGE(difference_range)
  3. Calculate SD of differences: =STDEV.S(difference_range)
  4. Calculate t: =mean_diff/(sd_diff/SQRT(COUNT(difference_range)))

🏋️‍♂️ Practice Exercises

Exercise 1: Content Uniformity Testing

Scenario: A batch of tablets should contain 25 mg of active ingredient. Test the following sample:

Content values (mg): 24.8, 25.3, 24.9, 25.1, 24.7, 25.4, 24.6, 25.2, 24.9, 25.0

Tasks:

  1. Perform a one-sample t-test (α = 0.05)
  2. Calculate 95% confidence interval for the mean
  3. Interpret results for regulatory compliance
Exercise 2: Batch Comparison

Scenario: Compare dissolution rates between two production batches:

Batch A (%): 85.2, 87.1, 86.3, 84.9, 86.8, 85.7 Batch B (%): 88.1, 89.4, 87.8, 88.9, 89.2, 88.5

Tasks:

  1. Test for equal variances
  2. Perform appropriate two-sample t-test
  3. Draw conclusions about batch differences
Exercise 3: Stability Study

Scenario: Test the stability of tablets stored under two different conditions using paired design:

Room Temp (%): 98.2, 97.8, 98.5, 97.9, 98.1, 98.3, 97.7, 98.0 Accelerated (%): 96.1, 95.8, 96.4, 95.9, 96.2, 96.0, 95.7, 96.3

Tasks:

  1. Perform paired t-test
  2. Calculate the effect size
  3. Recommend storage conditions

📋 Interpretation Guidelines

🎯 Making Regulatory-Compliant Conclusions

p-value Interpretation:

  • p ≤ 0.001: Highly significant evidence
  • 0.001 < p ≤ 0.01: Strong evidence
  • 0.01 < p ≤ 0.05: Moderate evidence
  • p > 0.05: Insufficient evidence

Effect Size Considerations:

Cohen's d = (x̄₁ - x̄₂) / s_pooled

  • d = 0.2: Small effect
  • d = 0.5: Medium effect
  • d = 0.8: Large effect

Pharmaceutical Context:

  • Consider clinical significance, not just statistical significance
  • Report confidence intervals for practical meaning
  • Consider regulatory requirements (e.g., ±10% for content uniformity)
  • Account for measurement uncertainty and method validation