Comprehensive Study Notes on Hypothesis Testing and Comparing Means
Logic of Hypothesis Testing
Combining Probabilities:
Multiple non-significant findings, when taken together, can provide strong support for an effect.
Combining individual non-significant probability values (e.g., and ) using statistical probability combination methods results in a combined probability value of , which is statistically significant.
Confidence Intervals and Small Effects:
Statistical analyses can never provide a basis for concluding that an effect is exactly zero.
Confidence intervals can demonstrate that an effect is likely small. If all values within a confidence interval are small, the effect can be concluded to be small.
Example: In an insomnia treatment study comparing mean time to fall asleep between a treatment group and a control group, the treatment group fell asleep an average of faster, but the difference was non-significant. If the 95% confidence interval for the mean difference ranges from to , the benefit can be concluded to be or less. This does not justify concluding that the null hypothesis is true or supported.
Four Steps in Significance Testing:
Step 1: Specify the Null Hypothesis ():
For a two-tailed test, typically states that a parameter equals zero (, which is equivalent to ).
For a one-tailed test, states that a parameter is or . If predicting , the null hypothesis (the reverse of the prediction) is ().
Step 2: Specify the Significance Level (Alpha Level, ):
Typical significance levels are and .
Step 3: Compute the Probability Value (-value):
The -value is the probability of obtaining a sample statistic as extreme as or more extreme than the parameter specified in , assuming is true.
Step 4: Compare the Probability Value with the Alpha Level:
If the -value is less than , reject . Lower -values indicate higher confidence that is false.
If the -value is greater than , findings are considered inconclusive. Failure to reject does not constitute support for .
Significance Testing and Confidence Intervals:
If a statistic is significantly different from at the level, the 95% confidence interval will not contain .
All values inside a confidence interval represent plausible parameter values; values outside the interval are rejected as plausible parameter values.
In the Physicians' Reactions case study, the 95% confidence interval for the population mean difference ranges from to . Because is outside this interval (less than ), zero is rejected as a plausible value, resulting in a statistically significant test ().
Similarly, significance at the level implies the 99% confidence interval will not contain
A significant finding establishes the direction of an effect because all values in the confidence interval will share the same sign (all positive or all negative).
When a 95% confidence interval contains zero, the effect is non-significant at the level. Zero cannot be rejected, but an infinite number of other continuous parameter values in the interval also cannot be rejected, which is why non-significant results should never be interpreted as accepting .
Common Misconceptions:
Misconception 1: The probability value is the probability that the null hypothesis is false.
Correction: The probability value is the probability of obtaining data as extreme as or more extreme than observed, assuming is true ().
Misconception 2: A low probability value indicates a large effect.
Correction: A low probability value indicates that the sample outcome is unlikely under . Small effect sizes can produce very low -values if the sample size is large.
Misconception 3: A non-significant outcome means that the null hypothesis is probably true.
Correction: A non-significant outcome indicates that the data fail to conclusively demonstrate that is false.
Statistical Literacy Application (Higgs Boson Research):
Initial research in March 2012 found evidence for the Higgs Boson particle, but the result was not statistically significant. Investigators noted tantalizing evidence existed without being strong enough for definitive statements. Subsequent studies collected sufficient data to reach statistical significance.
Testing a Single Mean
Testing a Single Mean When Population Standard Deviation () is Known:
A subliminal message experiment presents subjects with picture pairs. The hypothesized population mean under no subliminal effect is . The sample score frequencies are:

Sample mean , representing a difference of from
Binomial variance for trials with :
Population standard deviation
The standard error of the mean () formula is:

One-Tailed Test Calculation:

* Under a normal distribution with and , the one-tailed probability of obtaining is . Because this outcome is not unlikely under , the effect is non-significant.
Two-Tailed Test Calculation:

* Calculating the probability of or yields , which is exactly double the one-tailed probability.
Standard Normal () Transformation:


* The area on a standard normal distribution (, ) above equals Testing a Single Mean When Population Standard Deviation () is Estimated (-Test):
In practical applications, is almost always unknown and estimated using sample standard deviation .
Data from the ADHD Treatment case study ( children tested on a Delay of Gratification task across dosage levels):

The difference column (Diff) represents performance in the condition (D60) minus the control condition (D0). Null hypothesis:
General formula for :

Single mean -test formula:

For the difference scores: sample mean , sample standard deviation , hypothesized
Estimated standard error of the mean ():

s_M = \frac{s}{\sqrt{N}} = \frac{7.5382}{\sqrt{24}} = 1.54
Test statistic calculation:
Degrees of freedom
Two-tailed probability for is . The null hypothesis is rejected, concluding that the drug condition yields higher scores than the placebo condition.
Assumptions of Single-Mean -Tests:
1. Each value is sampled independently from every other value.
2. Values are sampled from a normally distributed population.
Testing Differences Between Two Means (Independent Groups)
Experimental Setup and Research Question:
Evaluation of ratings (on a 7-point scale) of whether animal research is wrong from the Animal Research case study:

Females rated animal research as more wrong (, , ) than males (, , ). Mean difference =
Assumptions for Independent-Groups -Tests:
1. Homogeneity of Variance: The two populations have equal variance ().
2. Normality: Both populations are normally distributed.
3. Independence: Each value is sampled independently from every other value. Each subject must contribute exactly one score.
Note: Small-to-moderate violations of normality and homogeneity of variance do not severely invalidate the test, but independence must not be violated.
Computational Steps for Equal Sample Sizes:
Step 1: Compute the difference between sample means (
Step 2: Calculate Pooled Variance / Mean Square Error ():

Step 3: Compute the estimated standard error of the difference between means ():


s_{M_1 - M_2} = \sqrt{\frac{2 MSE}{n}} = \sqrt{\frac{2 \times 2.864}{17}} = 0.5805
Step 4: Compute :
t = \frac{1.4705}{0.5805} = 2.533
Step 5: Determine degrees of freedom and probability value:
df = (n_1 - 1) + (n_2 - 1) = 16 + 16 = 32
* Two-tailed ; one-tailed Formatting Data for Computer Analysis:
Statistical software requires data structure organized by grouping and dependent variables:


Computations for Unequal Sample Sizes (Optional):
When sample sizes differ, weights the larger group more via Sum of Squares Error ():

Group 1: (, ); Group 2: (, )
Degrees of freedom error:
Calculate :

Harmonic mean of sample sizes ():

n_h = \frac{2}{\frac{1}{n_1} + \frac{1}{n_2}} = \frac{2}{\frac{1}{3} + \frac{1}{2}} = 2.4
Standard error calculation using :


s_{M_1 - M_2} = \sqrt{\frac{2 MSE}{n_h}} = \sqrt{\frac{2 \times 1.333}{2.4}} = 1.054
Test statistic and probability:
t = \frac{4 - 3}{1.054} = 0.949
* Two-tailed All Pairwise Comparisons Among Means
Problem of Multiple Comparisons and Inflated Type I Error:
Performing individual -tests across all possible pairs of means inflates the familywise Type I error rate beyond
The number of pairwise comparisons for means is given by .


* For means: comparison.
* For means: comparisons.
Probability of Type I error increases dramatically with number of means:

* For means, the probability of at least one false positive among comparisons is approximately Tukey's Honestly Significant Difference (HSD) Test:
Maintains the familywise Type I error rate using the studentized range distribution.
Data from the Smiles and Leniency case study:


* Sample size per condition (Total ).
Compute (mean of group variances):
MSE = \frac{3.34 + 2.83 + 2.11 + 2.32}{4} = 2.65
Compute Tukey statistic for each pair:

Q = \frac{M_i - M_j}{\sqrt{\frac{MSE}{n}}}
* Standard error term denominator:
* Error degrees of freedom: Results of Six Pairwise Comparisons:


* False vs. Felt: , ,
* False vs. Miserable: , ,
* False vs. Neutral: , , (Statistically Significant)
* Felt vs. Miserable: , ,
* Felt vs. Neutral: , ,
* Miserable vs. Neutral: , , Interpretation of Pairwise Comparisons:
The apparent contradiction (False equals Miserable, Miserable equals Neutral, but False differs from Neutral) is resolved by avoiding accepting on non-significant tests. Failing to reject indicates insufficient evidence of a difference, not proof of equality. The false smile yields higher leniency than neutral control, while miserable smile is either equal to false smile, equal to control, or intermediate.
Assumptions and Computer Integration:
Assumptions: Normality, homogeneity of variance, and independent observations. Robust to normality violations, but sensitive to variance heterogeneity and non-independence.
ANOVA Summary Table for Smiles and Leniency Data:

* Mean Square Error () equals ().
Tukey's test does not require a prior significant ANOVA -test to be valid (Wilkinson et al., 1999).
Unequal Sample Sizes in Tukey Test (Optional):
Calculate and , obtain , and replace in the formula with the harmonic mean () for each specific pair being compared.
Specific Comparisons (Independent Groups)
Linear Combinations and Contrast Coefficients:
Planned comparisons test specific hypotheses formulated prior to data collection.
Data from a factorial experiment (, per cell) assessing attribution of outcome to self based on Self-Esteem (High=1, Low=2) and Task Outcome (Success=1, Failure=2):
Means: Success/High = , Success/Low = , Failure/High = , Failure/Low =
Main effect contrast for Outcome (Success vs. Failure):
Mean Success =
Mean Failure =
Mean Difference =
Coefficients (): Success/High (), Success/Low (), Failure/High (), Failure/Low (
Linear Combination ():
L = \sum c_i M_i = 0.5(7.333) + 0.5(5.500) - 0.5(4.833) - 0.5(7.833) = 0.083
Significance test formula for :
t = \frac{L}{\sqrt{\frac{\sum c_i^2 MSE}{n}}}
* Cell variances: Success/High = , Success/Low = , Failure/High = , Failure/Low =
* Pooled Variance () = \frac{1.867 + 1.100 + 2.167 + 1.367}{4} = 1.625\n * Sum of squared coefficients: \sum c_i^2 = (0.5)^2 + (0.5)^2 + (-0.5)^2 + (-0.5)^2 = 1.0\n * Standard error of L\sqrt{\frac{1.0 \times 1.625}{6}} = 0.5204\n * Test statistic: t = \frac{0.083}{0.5204} = 0.160\n * Degrees of freedom: df = N - k = 24 - 4 = 20\n * Two-tailed p = 0.874 (Non-significant main effect).\n\n* **Interaction Contrasts (Difference Between Differences):**\n * Evaluating whether the effect of outcome differs across self-esteem levels:\n * High self-esteem difference (Success - Failure): 7.333 - 4.833 = 2.500\n * Low self-esteem difference (Success - Failure): 5.500 - 7.833 = -2.333\n * Difference between differences: 2.500 - (-2.333) = 4.833\n * Coefficients (c_i+1-1-1+1\n * Linear combination: L = 1(7.333) - 1(4.833) - 1(5.500) + 1(7.833) = 4.833\n * Sum of squared coefficients: \sum c_i^2 = 1^2 + (-1)^2 + (-1)^2 + 1^2 = 4\n * Standard error of L\sqrt{\frac{4 \times 1.625}{6}} = 1.0408\n * Test statistic: t = \frac{4.833}{1.0408} = 4.64\n * Degrees of freedom df = 20\n * Two-tailed p = 0.0002 (Statistically significant interaction).\n\n* **Multiple Comparisons and Familywise Error Control:**\n * **Per-comparison Error Rate (\alpha):** Probability of Type I error for a single comparison.\n * **Familywise Error Rate (FW):** Probability of making one or more Type I errors across a family of comparisons.\n * **Bonferroni Inequality:**\n\nFW \le c \alpha\n\n * Where c is the number of comparisons.\n * **Bonferroni Correction:** Set per-comparison significance level to \alpha / c\alpha.\n * Controlling familywise error reduces statistical power. Familywise control is unnecessary when comparisons test independent hypotheses.\n\n* **Orthogonal Comparisons:**\n * Comparisons are independent (orthogonal) if the sum of the products of their coefficients equals zero:\n\n\sum c_{1i} c_{2i} = 0\n\n * Example of Orthogonal Contrasts:\n * C_1 = (0.5, 0.5, -0.5, -0.5)\n * C_2 = (1, -1, -1, 1)\n * Product sum: 0.5(1) + 0.5(-1) + (-0.5)(-1) + (-0.5)(1) = 0.5 - 0.5 + 0.5 - 0.5 = 0\n * Example of Non-Orthogonal Contrasts:\n * C_1 = (0.5, -0.5, 0.5, -0.5)\n * C_2 = (0.5, -0.5, 0.0, 0.0)\n * Product sum: 0.25 + 0.25 + 0.0 + 0.0 = 0.5
e 0\n\n\n# Difference Between Two Means (Correlated Pairs)\n\n* **Rationale for Repeated Measures / Correlated Pairs Designs:**\n * In within-subjects designs, scores across conditions originate from the same subjects, creating dependent observations.\n * ADHD Treatment case study (N = 240.6\,mg conditions):\n * High correlation between conditions (r = 0.80\n * An independent-groups tt = 1.42df = 46p = 0.15 (non-significant).\n * Analyzing as correlated pairs yields M_{Diff} = 4.96t = 3.22df = 23p = 0.0038 (significant).\n * Correlated t-tests possess greater statistical power because subject variance is removed, reducing standard error.\n\n* **Variance Sum Law and Standard Error Reduction:**\n * Variance of difference scores (\sigma_{X - Y}^2):\n\n\sigma_{X - Y}^2 = \sigma_X^2 + \sigma_Y^2 - 2 r \sigma_X \sigma_Y\n\n * For D0 (s^2 = 128.02s = 11.31s^2 = 151.78s = 12.32r = 0.80:\n\ns_{Diff}^2 = 128.02 + 151.78 - 2(0.80)(11.31)(12.32) = 56.82\n\n * Higher positive correlation rt.\n\n\n# Specific Comparisons (Correlated Observations)\n\n* **Experimental Framework (Weapons and Aggression Study):**\n * N = 32 subjects read aggressive or control words primed by weapon or non-weapon words:\n * `aw`: aggressive word, weapon prime\n * `an`: aggressive word, non-weapon prime\n * `cw`: control word, weapon prime\n * `cn`: control word, non-weapon prime\n * **Main Effect Comparison (L_1L_1 = (an + cn) - (aw + cw)).\n * Sample mean of L_1 = 5.875\,mss_M = 4.2646\n * Test statistic: t = \frac{5.875}{4.2646} = 1.378df = 31p = 0.178\n * **Interaction Comparison (L_2L_2 = (an - aw) - (cn - cw)).\n * Sample mean of L_2 = 8.4375\,mss_M = 3.9128\n * Test statistic: t = \frac{8.4375}{3.9128} = 2.156df = 31p = 0.039 (Statistically Significant).\n\n* **Orthogonal Comparisons in Correlated Designs:**\n * Correlation between contrast scores L_1L_2r = 0.24. True orthogonal comparisons with correlated observations are rare.\n\n\n# Pairwise Comparisons (Correlated Observations)\n\n* **Limitations of Tukey HSD for Correlated Observations:**\n * Tukey HSD assumes equal variance of difference scores across all pairwise condition pairs, an assumption usually violated in repeated measures.\n\n* **Methodology (Pairwise Correlated t-Tests with Bonferroni Correction):**\n * Stroop Interference study (N = 47 subjects across Words [W], Color [C], and Interference [I] conditions):\n\n| Comparison | Mean Difference | Standard Deviation (ss_Mtp |\n| :--- | :--- | :--- | :--- | :--- | :--- |\n| W - C | -4.152.990.44-9.53< 0.001 |\n| W - I | -20.517.841.14-17.93< 0.001 |\n| C - I | -16.367.471.09-15.02< 0.001 |\n\n * Bonferroni adjusted alpha threshold for 3\alpha / 3 = 0.05 / 3 = 0.0167.\n * All three pairwise differences are statistically significant (p < 0.001).\n\n\n# Review Exercises and Solutions Framework\n\n* **Question 5 (Sampling Distribution Visualization):**\n\n\n\n * For H_0: \mu = 50M = 60\pm 3.27\alpha = 0.05.\n\n* **Question 19 (Homogeneity of Variance Violation):**\n\n\n\n * Population 1 (variance \sigma^2 = 1.0\sigma^2 = 4.0$$) depict a clear violation of the equal variance assumption.