Topic4 1
Topic4 1
Topic 4:
One-Way ANOVA:
Post-hoc Comparisons
Prior Requirements
Mohammad Darainy
One-Way ANOVA
§ For example,
§ μ1 ≠ μ2 ≠ μ3
§ μ1 = μ2 ≠ μ3 ?
§ μ1 ≠ μ2 = μ3
One-Way ANOVA
§ F-test gives a global effect of the
independent variable (factor) on the
dependent variable.
§ doesn’t tell which pairs of means are different.
§ We need to perform post hoc comparison
tests to determine this.
§ Post hoc (a posteriori/unplanned) comparisons
§ Decided upon after the experiment
§ Used if three or more means were compared
Post hoc comparisons
VW
X j - X j ' ³ CQ
n
§ HSD = minimum absolute difference
between two means required for a
statistically significant difference.
Tukey’s HSD Test
CQ æ 1 1 ö
X j - X j' ³ VW ç + ÷
2 çN N ÷
è j j ' ø
VW
CQ = 3.81 21.175 = 5.54
n 10
Example: Tukey’s HSD Test
Pricepromotion_1.sav
Number of Expected price (USD)
promotions
1 3.78, 3.82, 4.18, …., 4.00
3 4.12, 3.91, 3.96, …., 4.11
5 3.32, 3.86, 3.96, …., 3.69
7 3.45, 3.64, 3.37, …., 3.94
§ DV = Expected price
§ Factor (IV) = Number of promotions (during the
past 10 weeks)
§ N = 160
One-Way ANOVA with JASP
§ H0 : μ1 = μ2 = μ3 = μ4
§ H1 : Not all μ’s are equal
Descriptive Statistics
exp_price
1 3 5 7
Valid 40 40 40 40
Missing 0 0 0 0
Mean 4.224 4.063 3.759 3.549
Std. Error
0.043 0.028 0.040 0.043
of Mean
Std.
0.273 0.174 0.253 0.275
Deviation
Minimum 3.620 3.600 3.250 2.970
Maximum 4.790 4.420 4.410 4.010
One-Way ANOVA with JASP
ANOVA - exp_price
Sum of
Cases df Mean Square F p ω²
Squares
nprom 10.989 3 3.663 59.903 < .001 0.525
Residua
9.539 156 0.061
ls
Means plots
Post hoc comparisons with JASP for Windows
§ Prior Requirements/Assumptions:
§ The distribution of observations on the
dependent variable is normal within each
group.
§ The variances of observations are equal
(homogeneity of variance).
§ Independence of observations
Assessing Normality
Skewness statistic
® t Skewness
SE Skewness
§ |tSkewnss|>3.2 violation of zero skewness
assumption.
Assessing Normality
§ Construct histograms
§ separate histograms for each
group to assess normality
§ It doesn’t have to be perfect,
just roughly symmetric. -3 -2 -1 0 1 2 3
Assessing Normality
§ Evaluate a normal quantile plot (or normal
probability plot).
§ Sort observations from smallest to largest.
§ Calculate the z-scores of the sorted
observations.
§ Plot the observations against the
corresponding z-scores.
§ If the data are close to normal, then the
points will lie close to some straight line.
Histogram & Normal quantile plot –
Price promotion data
Pricepromotion_1.sav
Number of Expected price (USD)
promotions
1 3.78, 3.82, 4.18, …., 4.00
3 4.12, 3.91, 3.96, …., 4.11
5 3.32, 3.86, 3.96, …., 3.69
7 3.45, 3.64, 3.37, …., 3.94
§ DV = Expected price
§ Factor (IV) = Number of promotions (during the
past 10 weeks)
§ N = 160
Histogram & Normal quantile plot –
Price promotion data
Group 1 (nprom = 1)
Histogram & Normal quantile plot –
Price promotion data
Group 2 (nprom = 3)
Assessing Normality
§ Independent observations:
§ knowing the value of one observation gives no
clue as to that of other observation.
§ This is perhaps the most crucial assumption
for the F test.
§ It is difficult to predict how bad the F test will be.
§ There is no easy way to fix the F test when this
assumption is violated.
Assessing independence of observations
Öy weak
log(y) mild
1/y strong
If these assumptions are not met…
Pricepromotion_1.sav
Number of Expected price (USD)
promotions
1 3.78, 3.82, 4.18, …., 4.00
3 4.12, 3.91, 3.96, …., 4.11
5 3.32, 3.86, 3.96, …., 3.69
7 3.45, 3.64, 3.37, …., 3.94
§ DV = Expected price
§ Factor (IV) = Number of promotions (during the
past 10 weeks)
§ N = 160
Steps for conducting one-way ANOVA
Descriptive Statistics
exp_price
1 3 5 7
Valid 40 40 40 40
Missing 0 0 0 0
Mean 4.224 4.063 3.759 3.549
Std. 0.273 0.174 0.253 0.275
Deviation
Skewness -0.066 -0.052 0.575 -0.366
Std. Error
of 0.374 0.374 0.374 0.374
Skewness
Minimum 3.620 3.600 3.250 2.970
Maximum 4.790 4.420 4.410 4.010
Example with JASP for Windows:
Histogram & Normal quantile plot
Group 1 (nprom = 1)
Example with JASP for Windows:
Shapiro-Wilk test
Descriptive Statistics
exp_price
1 3 5 7
Valid 40 40 40 40
Missing 0 0 0 0
Mean 4.224 4.063 3.759 3.549
Std.
0.273 0.174 0.253 0.275
Deviation
Skewness -0.066 -0.052 0.575 -0.366
Std. Error of
0.374 0.374 0.374 0.374
Skewness
Shapiro- 0.986 0.977 0.965 0.963
Wilk
P-value of
Shapiro- 0.880 0.588 0.240 0.220
Wilk
Minimum 3.620 3.600 3.250 2.970
Maximum 4.790 4.420 4.410 4.010
Example with JASP for Windows: Test
of Homogeneity of Variance
F df1 df2 p
3.014 3.000 156.000 0.032