Statistics for Marketing and Consumer Research

Download Report

Transcript Statistics for Marketing and Consumer Research

Analysis of variance
Chapter 7
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
1
Tests on multiple hypotheses
• Consider the situation where the means for more than two
groups are compared, e.g. mean alcohol expenditure for:
(a) students; (b) unemployed; (c) employees
• One could run a set of two mean comparison tests (students
vs. unemployed, students vs. employed, employed vs.
unemployed)
• However, as seen in lecture 6, each of these tests is
subject to Type one error (the level of significance a), i.e.
the probability of rejecting the null hypothesis when it is
actually true
• Thus, the overall Type one error for the joint three tests is
larger than a because the probability of Type one error
increases with the number of tests
• This is the so-called problem of inflated family-wise (or
experiment-wise) Type one error
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
2
Analysis of Variance
• It is an alternative approach to mean comparison
for multiple groups
• It is a set of techniques for a variety of situations
• It is applicable to a sample of individuals that
differ for one or more given factors
• It allows tests where variability in a variable is
attributable to one (or more) factors
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
3
Example
EFS: Total
Alcoholic
Beverages,
Tobacco
Economic position of Household Reference Person
Unoc Ret unoc
SelfFulltime
Pt
under
Unempl. over min
employed employee employee
min ni
ni age
age






Mean
18.56
14.64
12.39
19.48




St. Dev.
19.0
18.5
15.0
19.7
7.34

14.6
TOTAL

11.99
12.67


19.1
17.8
Are there significant difference across the means of
these groups?
Or do the differences depend on the different levels of
variability across the groups?
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
4
Analysis of Variance
• Here the target variable is alcohol
expenditure, the factor is the economic
position of the HRP
• Basically we investigate the attribution of a
variation in the metric target variable to
variations in one on more categorical
explanatory variables (the factors)
• A treatment is a combination of different
factors in n-way analysis of variance
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
5
One-way ANOVA
• Only one categorical variable (a single factor)
• Several levels (categories) for that factor
• The typical hypothesis tested through ANOVA is
that the factor is irrelevant to explain differences
in the target variable (i.e. the means are equal, as
in bivariate mean comparisons/t-tests)
• Apart from the tested factor(s), the groups should
be safely considered homogeneous between each
other
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
6
Null and alternative hypothesis for
ANOVA
• Null hypothesis (H0): all the means are equal
• Alternative hypothesis (H1): at least two
means are different
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
7
Arranging data for ANOVA
Economic position of Household Reference Person
Group (g)
2
3
4
5
1
Selfemployed
Fulltime
Pt t
Unempl.
employee employee
x11
x21
x31
…
x21
x22
x32
…
Observations
x13
x14
x23
x24
x33
x34
…
…
Ret unoc
over min
ni age
6
Unoc under
min ni
age
x15
x25
x35
…
x16
x26
x36
…
n1
Number of observations (n)
n2
n3
n4
Means
n5
n6
x
x
x
x
1
Overall mean
2
x
3
x
4
5
6
x
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
8
The statistical distribution to carry out
ANOVA
1. Decompose the total variation (sum of
squares corrected for the mean)
2. Compute the F-test statistic
3. Choose the critical value
4. Interpret the result
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
9
One-way ANOVA: data
• Suppose that we have n observation within each group and g group
Group (factor level)
1
2
…
i
Obs.
…
n
Group mean
TOTAL MEAN
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
1
x11
x21
…
xi1
…
xn1
2
x12
x22
…
xi2
…
xn2
x1
x2
…
…
…
…
…
…
…
…
j
x1j
x2j
…
xij
…
xnj
xj
…
…
…
…
…
…
…
…
g
x1g
x2g
…
xig
…
xnn
xg
1 g
x   xj
g j 1
10
Measuring and decomposing the total
variation
• SUM OF SQUARES (corrected for the mean)
VARIATION BETWEEN THE GROUPS
+
VARIATION WITHIN EACH GROUP=
________________________________
TOTAL VARIATION
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
11
Variance decomposition
nc
g
sT2 
  xrc  x 
2
(TOTAL VARIANCE)
c 1 r 1
n 1
g
2
sBW

 x
c
c 1
 x  nc (VARIANCE BETWEEN GROUPS)
2
g 1
xrc  xc 

2
sW  
nc  1
c 1 r 1
g
nc
2
(VARIANCE WITHIN GROUPS)
g
nc
  xrc  x 
c 1 r 1
DEGREES OF FREEDOM
2
g
nr
g
   xrc  xc    xc  x  nc
2
c 1 r 1
2
c 1
g
n  1  g  1   (nc  1)  g  1  n  g
c 1
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
12
The basic principle of the ANOVA
• If the variation explained by the different
factor between the groups is significantly
more relevant than the variation within the
groups, then the factor is assumed to be
statistically relevant in explaining the
differences
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
13
The test statistic
• The test statistic is computed as:
sB2 Variance between groups
F 2 
sW
Variance within groups
• This test statistic compares the weight of
the variance explained by the factors to the
weight of the variance not explained by the
factors
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
14
Distribution of the
F-statistic (one-tailed test)
Rejection area
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
15
Characteristics of the
F-distribution
Fa (df1 , df 2 )
• Its shape (critical value) changes according to the
degrees of freedom (numbers of observation/
groups)
• It is a non-negative statistic (one-tailed test)
• For ANOVA testing:
df1=g-1
df2=n-g
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
16
ANOVA in SPSS
Target variable
Factor
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
17
SPSS output
ANOVA
Variance between
EFS: Total Alcoholic Beverages, Tobacco
Between Groups
Within Groups
Total
Sum of
Squares
6171.784
151535.3
157707.1
df
5
494
499
Mean Square
1234.357
306.752
F
4.024
Sig.
.001
p-value < 0.05
Variance within
Variation decomposition
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
Degrees of
freedom
The null is
rejected
18
Contrasts
• Allows to test hypotheses on specific sub-sets of the
treatments (factor combinations).
• They open the way to further explore the sources of
variability when the null hypothesis of mean equality is
rejected.
• Comparisons are usually based on a theory and planned
before the analysis, thus they are also called planned
comparisons.
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
19
Linear contrasts
• Linear contrasts are linear combinations of
the means, allowing one to test other
hypotheses than mean equality
• For example, one may want to test whether
the mean for group one is double the mean
for groups two and three, while the means
of groups two and three are equal
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
20
Linear contrasts
• Contrasts are also useful after rejection of
the null hypothesis of mean equality
• Rejection of the null hypothesis means that
at least two means differ, but it does not
say which ones actually differ
• Planned comparisons through linear
contrasts can help
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
21
Example
• Test whether chicken expenditures increases
linearly with household size
• Check whether there are significant differences:
• Between households with one or two components and
households with more components
• Considering the following groups
• Households with one component
• Households with two components
• Households with more than two components
• Considering the following comparison
• Households with four, five, six and seven components have
equal means
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
22
Household sizes and means
Descriptives
In a typical week how m uch do you spend on fresh or frozen chicken (Euro)?
N
0
1
2
3
4
5
6
7
Total
1
82
145
93
87
24
10
1
443
Mea n
4.8000
4.2470
5.0548
6.3231
6.7334
7.5613
6.2730
6.7500
5.6677
Std. Deviation
.
2.82338
3.41626
4.71695
3.87396
7.64258
3.25606
.
4.13383
95% Confidence Interval for
Mea n
Std. Error Lower Bound Upp er Bound
.
.
.
.3 1179
3.6266
4.8673
.2 8371
4.4941
5.6156
.4 8912
5.3517
7.2946
.4 1533
5.9078
7.5591
1.56003
4.3341
10.7884
1.02966
3.9438
8.6022
.
.
.
.1 9640
5.2817
6.0537
Minim um
4.80
.3 7
.0 0
.0 0
.0 0
.0 0
.0 0
6.75
.0 0
Maximum
4.80
15.00
20.00
30.00
18.00
30.00
10.49
6.75
30.00
7 GROUPS
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
23
Example
•
•
1 and 2 components versus 3, 4, 5, 6 and 7
Weights (they need to sum to 0)
1
2
3
4
5
6
7
=
=
=
=
=
=
=
-2.5
-2.5
1
1
1
1
1
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
24
Planned comparisons
• Helmert contrasts: the first treatment is compared with all of the
remaining treatments, the second treatment will all the remaining
treatments but the first, the third treatment will all of the remaining
ones but the first two, and so on.
• By looking at the results of this battery of tests, it becomes possible to
identify those groups whose difference from the others is most
relevant.
• polynomial contrasts: it is possible to tested whether the trend in
means follows a linear, quadratic or cubic sequence or any polynomial
relationship between the treatments,
• repeated contrasts: each treatment is compared with the one which
follows
• reverse Helmert contrasts (or difference contrasts): Helmert contrasts
going backwards
• simple contrasts where the user can choose the benchmark treatment
between the first and the last category .
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
25
Post-hoc comparisons
• Linear contrasts are carried out independently from each
other
• Post-hoc tests consist in a set of paired comparisons,
where the critical values are corrected to account for the
problem of inflating the Type I Error risk (rejecting the null
hypothesis when it is true) measured by the cumulative
Type I error or familiwise error.
• The approach to correcting the critical values determines
the Type of test being used. In SPSS:
– Scheffe’s test
– Bonferroni’s test
– Tukey’s test.
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
26
Some post-hoc tests
• Scheffe test: simultaneous comparisons for all potential
pair-wise and linear combinations of treatments using F
critical values corrected to account for the number of
treatment being compared
• Bonferroni post-hoc method: (1) run the usual pair-wise ttests; (2) to account for the inflated Type one error rate an
adjustment is provided by dividing the family-wise error by
the number of tests.
• Tukey’s test: also known as an Honestly Significant
Difference or HSD test, it can be used when samples are of
equal size, but statistical packages usually provide variants
for unequal sizes. With this test, significant differences are
identified through an adjusted Studentized range
distribution (an extension of the Student t statistic which
uses pooled estimate of the standard errors)
• More tests on the textbook
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
27
Effect size and power
• The experimental factor matters, but how much?
(effect size)
• Larger F statistics do not necessarily imply larger
effect sizes – because they also depend on sample
sizes
• A typical measure of effect size is h2 (the ratio
between variation between and total variation)
• The power of a test is 1-bwhere b is the
probability of non-rejecting the null hypothesis
when the alternative is true (Type II error)
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
28
Which post-hoc test?
• One should check the probabilities of Type I
error and power (Type II errors)
• There is a trade-off between power and
Type I error
• Conservative tests: low Type I error, low power
(Scheffé, Bonferroni)
• Tukeys test more appropriate for a large number
of means
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
29
ANOVA in SPSS
Target variable (scale)
Planned
comparisons
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
Factor (categorical)
Post-hoc
tests
30
Planned comparisons (contrasts)
w1L  w2 ML  w3MH  w4 H  0
The polynomial contrast assumes
that the mean follows a given
polynomial (linear, quadratic, etc.)
Note: the null hypothesis is that
the polynomial contrast does not
hold
Other contrasts
Insert a weight for each
subgroup
Note: the null
hypothesis is that the
contrast holds…
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
Click here to insert other sets of
weight (one set of weight per
comparison)
31
ANOVA output
Descriptives
EFS: Total Alcoholic Beverages, Tobacco
N
Low income
Medium-low income
Medium-high income
High income
Total
125
125
125
125
500
Mean
7.467
11.381
13.040
18.789
12.669
Std. Deviation
12.8693
17.9038
16.9137
20.8025
17.7777
Std. Error
1.1511
1.6014
1.5128
1.8606
.7950
95% Confidence Interval for
Mean
Lower Bound
Upper Bound
5.188
9.745
8.212
14.551
10.046
16.035
15.106
22.472
11.107
14.231
Minimum
.0
.0
.0
.0
.0
Maximum
70.0
93.9
79.4
92.5
93.9
ANOVA
Mean equality is rejected
EFS: Total Alcoholic Beverages, Tobacco
Between
Groups
Within Groups
Total
(Combined)
Linear Term
Contrast
Deviation
Sum of
Squares
8289.482
7932.717
3
1
Mean Square
2763.161
7932.717
F
9.172
26.333
Sig .
.000
.000
356.765
2
178.382
.592
.554
149417.6
157707.1
496
499
301.245
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
df
The means are
compatible with a
linear polynomial
And not compatible
with a non-linear one
32
Output
Contrast Coefficients
Contrast
1
2
Anonymised hhold inc + allowances (Banded)
Medium-low
Medium-high
Low income
income
income
High income
0
1
-1
0
1
0
0
-1
Contrast Tests
EFS: Total Alcoholic
Beverages, Tobacco
Assume equal variances
Does not assume equal
variances
Contrast
1
2
1
2
Value of
Contrast
-1.659
-11.322
-1.659
Std. Error
2.1954
2.1954
2.2029
t
-.756
-5.157
-.753
496
496
247.202
Sig. (2-tailed)
.450
.000
.452
-11.322
2.1879
-5.175
206.788
.000
df
The first contrast (0, 1, -1, 0) holds (not rejected)
The second contrast (1, 0, 0, -1) (rejected)
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
33
SPSS Post-hoc tests
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
34
SPSS output (post-hoc tests)
Multiple Comparisons
Dependent Variable: EFS: Total Alcoholic Beverages, Tobacco
Tukey HSD
(I) Anonymised hhold inc
+ allowances (Banded)
Low income
Medium-low income
Medium-high income
High income
Bonferroni
Low income
Medium-low income
Medium-high income
High income
(J) Anonymised hhold inc
+ allowances (Banded)
Medium-low income
Medium-high income
High income
Low income
Medium-high income
High income
Low income
Medium-low income
High income
Low income
Medium-low income
Medium-high income
Medium-low income
Medium-high income
High income
Low income
Medium-high income
High income
Low income
Medium-low income
High income
Low income
Medium-low income
Medium-high income
Mean
Difference
(I-J)
-3.9147
-5.5737
-11.3224*
3.9147
-1.6590
-7.4077*
5.5737
1.6590
-5.7487*
11.3224*
7.4077*
5.7487*
-3.9147
-5.5737
-11.3224*
3.9147
-1.6590
-7.4077*
5.5737
1.6590
-5.7487
11.3224*
7.4077*
5.7487
Std. Error
2.1954
2.1954
2.1954
2.1954
2.1954
2.1954
2.1954
2.1954
2.1954
2.1954
2.1954
2.1954
2.1954
2.1954
2.1954
2.1954
2.1954
2.1954
2.1954
2.1954
2.1954
2.1954
2.1954
2.1954
Sig.
.283
.055
.000
.283
.874
.004
.055
.874
.045
.000
.004
.045
.451
.069
.000
.451
1.000
.005
.069
1.000
.055
.000
.005
.055
95% Confidence Interval
Lower Bound
Upper Bound
-9.574
1.745
-11.233
.086
-16.982
-5.663
-1.745
9.574
-7.318
4.000
-13.067
-1.748
-.086
11.233
-4.000
7.318
-11.408
-.089
5.663
16.982
1.748
13.067
.089
11.408
-9.730
1.901
-11.389
.242
-17.138
-5.507
-1.901
9.730
-7.474
4.156
-13.223
-1.592
-.242
11.389
-4.156
7.474
-11.564
.067
5.507
17.138
1.592
13.223
-.067
11.564
Results for
each paired
comparison are
reported and
significance
level adjusted
*. The mean difference is significant at the .05 level.
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
35
ANOVA: Fixed versus random effects
1. Explore differences in monthly food expenditure
for different geographical regions
2. Explore differences in monthly food expenditure
according to the point of purchase for the last
food shopping
• 1. is a fixed effect which implies that the
researcher can fully control the factor (treatment)
• 2. is a random effect where the factor (treatment)
cannot be fully controlled and is subject to a
(random) measurement error
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
36
ANOVA assumptions
Two key assumptions are needed for running analysis
of variance without risks
1) that the sub-samples defined by the treatment are
independent
2) that no big discrepancies exist in the variances of the
different sub-samples
• Normality within the sub-sample: within limits, departure
from normality is not a serious issue
• Different variances: results are still reliable if the sizes of
sub-samples are equal
• Both variances and sample sizes differ: high risk of biased
results
• Adjustments: Brown-Forsythe test and/or the Welch test
instead of the usual F test
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
37
Adjustments for violated assumptions in
SPSS
Click on OPTIONS to request descriptive stats for a
random effect model , Brown-Forsythe and Welch
tests (plus more plots and descriptive statistics)
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
38
Non-parametric ANOVA tests
• Exclusive samples extracted from the same
population
• Kruskal–Wallis test: extends the Mann-Whitney test to the
case of a higher number of sub-samples. It tests the null
hypothesis that all the sub-populations have the same
distribution function.
• Jonckheere-Terpstra test: the same null hypothesis, but
against the alternative that an increase in treatment leads
to an increase in the (median of the) dependent variable.
• Related samples (the same respondent may appear in
several treatment sub-samples)
• Friedman test, Kendall test or Cochran Q test, extend to
the multiple sample case some of the non-parametric tests
for mean comparisons
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
39
Non-parametric ANOVA in SPSSExhaustive sub-samples
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
Related samples
40
The class of ANOVA techniques
Number of target
variables
1
1
2 or more
1
Number of factors
1
2 or more
1 or more
2 or more
2 or more
2 or more
1
1
1
1
1 or more
1 or more
1 or more
1
1
1
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
Measurement of factors
nominal / ordinal independent samples
nominal / ordinal independent samples
nominal / ordinal independent samples
nominal / ordinal and continuous, independent
samples
nominal / ordinal and continuous, independent
samples
nominal / ordinal repeated samples
nominal / ordinal mixed samples
Nominal / ordinal random effects
nominal / ordinal independent samples, nonnormal data and/or non-homogeneous
independent samples
nominal / ordinal independent samples, nonnormal data and/or non-homogeneous related
samples
Technique
One-way ANOVA
Factorial ANOVA
MANOVA
ANCOVA
MANCOVA
Repeated ANOVA
Mixed ANOVA
Variance Component Model
Non-parametric tests: Kruskal–Wallis test or
Jonckheree-Terpstra test
Non-parametric tests: Friedman, Cochran Q
or Kendall's test
41
Other ANOVA designs
• Multi-way (factorial) ANOVA
• Multivariate ANOVA (MANOVA)
• (Multivariate) Analysis of Covariance
(MANCOVA)
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
42
General linear model
• One-way ANOVA is equivalent to a linear
model, where the target variable is the
dependent variable and then each of the
treatments is transformed into a dummy
variable which assumes a value of one if
respondents are subject to that treatment.
This means that they belong to that
economic condition and are zero otherwise.
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
43
GLM example
Target variable: Alcohol and tobacco expenditure
Factor: employment status
yi  b0  b1SEi  b2 FTi  b3 PTi  b4UNi  b5 REi  b6UAi   i
• yi is the amount spent in alcohol and tobacco by the i-th
respondent
• SEi=1 if the respondent is self-employed
• FTi=1 for full-time employees
• PTi=1 for part-time employees
• UNi=1 for unemployed resepondents
• REi=1 for retired or inactive respondents and
• UAi=1 for those under working age
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
44
Tests on the GLM coefficients
• T-test on each coefficient: bivariate mean
comparison
• F-test: one-way ANOVA
Other analyses of variance
Multi-way (Factorial) ANOVA: More than one factor
(interactions)
MANOVA: More than one target variable: allows one
to test whether the factors lead to significant
differences in a set of variables.
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
45
ANCOVA
• A final generalization which is quite
interesting for consumer research is the
Analysis of Covariance (ANCOVA), which is
the appropriate technique when some of the
factors are continuous quantitative variables
instead of being measured on a nominal or
ordinal scale
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
46
GLM and ANOVA techniques in SPSS
Univariate GLM: ANOVA, n-way
ANOVA, ANCOVA
Multivariate GLM: MANOVA,
MANCOVA
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
47
Univariate
GLM
Target variable
Factors (more than one for
n-way ANOVA, random
factors are allowed)
Scale variables for
ANCOVA
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
48
Multivariate GLM
More than one target
variable for MANOVA
or MANCOVA
Statistics for Marketing & Consumer Research
Copyright © 2008 - Mario Mazzocchi
49