Certainly! Let’s consider a real-world scenario where we would use a two independent sample test:
Scenario: Energy Drinks and Reaction Times
Imagine you work at a research institution and you’re tasked with investigating whether two different brands of energy drinks (let’s call them Brand A and Brand B) have any effect on the reaction times of individuals.
You decide to set up an experiment where:
- 100 participants drink Brand A.
- Another 100 participants drink Brand B.
- After drinking, you measure their reaction times using a standard test.
Hypotheses:
- Null Hypothesis (): The mean reaction time of individuals drinking Brand A is equal to the mean reaction time of individuals drinking Brand B.
- Alternative Hypothesis (): The mean reaction time of individuals drinking Brand A is not equal to the mean reaction time of individuals drinking Brand B.
Data:
Let’s assume you’ve gathered the following data:
- Brand A:
- Sample Size (): 100
- Sample Mean (): 420 milliseconds (ms)
- Sample Standard Deviation (): 50 ms
- Brand B:
- Sample Size (): 100
- Sample Mean (): 430 ms
- Sample Standard Deviation (): 55 ms
Two Independent Sample Test:
We can use the formula for the test statistic for two independent samples:
Where:
- and are the sample means of the two groups.
- and are the standard deviations of the two groups.
- and are the sample sizes of the two groups.
Let’s calculate the test statistic using the data provided.
# Given data n1, n2 = 100, 100 # sample sizes x1_bar, x2_bar = 420, 430 # sample means (in milliseconds) s1, s2 = 50, 55 # sample standard deviations (in milliseconds) # Calculating the z test statistic z = (x1_bar - x2_bar) / ((s1**2 / n1 + s2**2 / n2) ** 0.5) z
RESULT