Two Sample Hypothesis Testing
Hypothesis Testing Machine
Set null and alternative hypotheses.
Select significance level and calculate the test statistic.
Compute the p-value.
Make a decision based on the p-value:
Reject the null hypothesis if the p-value is less than the significance level.
Do not reject the null hypothesis if the p-value is greater than the significance level.
One Sample Hypothesis Testing
Alternative hypothesis is the new claim or question.
Null hypothesis includes the null value .
\HA: \mu > \mu0 \H0: \mu <= \mu0
\HA: \mu < \mu0 \H0: \mu >= \mu0
\HA: \mu \neq \mu0
If population SD known, test statistic is
Excel uses NORM.DIST for P-value
If population SD unknown, test statistic is
Excel uses T.DIST, T.DIST.RT, T.DIST.2T
Comparing Two Groups
Z test when population SD is known.
t test when population SD is unknown.
Goal: Compare two samples representing two populations.
Independent Samples
Most test statistic formulas assume independent populations and samples.
Independent samples: Knowing values of one sample provides no information about the other.
Mathematically, for independent events A and B, .
No mathematical test exists to confirm independence; decision based on problem knowledge.
Matched Pairs
Observations in two samples can be placed in one-to-one correspondence.
Samples can be from the same participant (within-participant) or a between-participant study with a direct link.
Sample sizes must be equal.
A straightforward way to link one observation in sample 1 with exactly one in sample 2.
Working with Matched Pairs
Take the difference in each pair, resulting in a single variable D for n pairs.
If the CLT applies, perform a one-sample t hypothesis test.
Test statistic:
degrees of freedom.
is the hypothesized mean difference.
Hypotheses for Two Independent Groups
Compare the means of two groups (1 and 2).
Null hypothesis: The two group means are equal.
Alternative Hypotheses for Two Groups
One-tailed or two-tailed:
\mu1 > \mu2
\HA: \mu1 - \mu2 > d_0\mu1 < \mu2
\HA: \mu1 - \mu2 < d_0
\HA: \mu1 - \mu2 \neq d_0
Both samples must be random and independent.
CLT conditions: Populations approximately normal OR both samples have n >= 30
When We Know Population SDs
Observed value:
Null value:
Standard Error:
Test statistic:
The Sample SD Substitution
Substitute sample standard deviations when population standard deviations are unknown:
Welch’s Approximate t Test
Uses an approximate t distribution.
DF is rounded down to the next lower number.
Test statistic:
The Two-Sample Test Statistics
Dependent samples: Matched pairs t test.
Test statistic
degrees of freedom.
Independent samples, population SDs known: Two sample Z test.
Independent samples, population SDs unknown: Welch’s two sample t test with unequal variances.
Satterthwaite’s degrees of freedom.
P-Values Revisited
P-value: Probability of getting a sample statistic or a more extreme one, assuming the null hypothesis is true.
If P-value <= :
Null hypothesis is true and data was unusual.
Null hypothesis is false and should be rejected.
Decision to reject could be wrong.
Reminders About Statistical Significance
Statistical significance is a consequence of the data.
If the sample mean is unusual under the null hypothesis conditions, and thus rejected, based on a significance level defined in advance, we call the data result statistically significant.
Statistical significance has nothing to do with practical, real-world usefulness or importance.
Warnings about P-value
The P-value is NOT the probability that the null hypothesis is true given the data!
The P-value is NOT the probability that the alternative hypothesis is false!
The P-value is NOT the probability of Type I error!
A smaller P-value does NOT indicate a larger population effect!
A larger P-value does NOT prove the null hypothesis is true!