SLIDE 1
Business Statistics CONTENTS Comparing two s Comparing more than - - PowerPoint PPT Presentation
Business Statistics CONTENTS Comparing two s Comparing more than - - PowerPoint PPT Presentation
SEVERAL S: COMPARISON Business Statistics CONTENTS Comparing two s Comparing more than two s Analysis of variance Testing significance of ANOVA Performing ANOVA The statistical model Equal variances Old exam question Further
SLIDE 2
SLIDE 3
Recall the comparison of the means of two independent samples (๐
1 and ๐ 2) with the ๐ข-test:
โช ๐ผ0: ๐1 = ๐2 โช under ๐ผ0:
๐
1โ๐ 2
๐ก๐1โ๐2
~๐ขdf, where df is the number of degrees
- f freedom, depending on the assumption of the variances
โช reject when ๐ขcalc =
๐ง1โ๐ง2 ๐ก๐1โ๐2
> ๐ขcrit Can we do this for three samples as well? โช ๐ผ0: ๐1 = ๐2 = ๐3 COMPARING TWO ๐S
We earlier wrote ๐1 and ๐2 or ๐ and ๐, so why not ๐
1 and ๐ 2?
SLIDE 4
A first attempt: โช think about how ๐ผ0: ๐1 = ๐2 leads to
๐
1โ๐ 2
๐diff ~๐ขdf
โช try if ๐ผ0: ๐1 = ๐2 = ๐3 leads to
๐
1โ๐ 2โ๐ 3
๐diff
~๐ขdf Very wrong! โช every year a few students try to do this at their exam, but this is a dead end road to take! COMPARING MORE THAN TWO ๐S
SLIDE 5
A second attempt: โช pairwise comparisons: ๐
1 vs. ๐ 2 and ๐ 2 vs ๐ 3
โช ๐
1 vs. ๐ 3 not needed
โช that implies doing two tests
โช not one
For each test the probability of incorrectly rejecting ๐ผ0 is ๐ฝ โช so with 2 tests, it becomes 1 โ 1 โ ๐ฝ 2 โช example: ๐ฝ = 0.05 gives 0.0975, so almost double So that will not work โช think about testing 10 means (45 comparisons), the probability of a wrong decision becomes 90% COMPARING MORE THAN TWO ๐S
SLIDE 6
A third attempt: โช We can partition the sum of squares into two parts:
โช between the three groups โช within each group
โช Try to identify sources of variation in a numerical dependent variable ๐ (the response variable) โช Variation in ๐ about its mean is partly explained by a categorical independent variable (the factor, with different levels)
โช and partly unexplained (random error)
COMPARING MORE THAN TWO ๐S
SLIDE 7
Example โช Chips defect rates are different in every batch, but are there systematic differences between manufacturers?
โช numerical dependent variable: chip defect rate (๐) โช categorical independent variable (one factor with four levels): manufacturer (1-4)
COMPARING MORE THAN TWO ๐S
SLIDE 8
Statistical model (formulation 1): โช manufaturer 1: ๐
๐1 = ๐1 + ๐๐1
โช ... โช manufaturer 4: ๐
๐4 = ๐4 + ๐๐4
Where: โช ๐ is the defect rate โช ๐1 is the mean for manufacturer 1 โช ... โช ๐4 is the mean for manufacturer 4 โช ๐ is the random, unexplained, part Null hypothesis: โช ๐1 = ๐2 = ๐3 = ๐4
COMPARING MORE THAN TWO ๐S
๐1 = ๐2 = ๐3 = ๐4
SLIDE 9
Statistical model (formulation 2): โช manufaturer 1: ๐
๐1 = ๐ + ๐ฝ1 + ๐๐1
โช ... โช manufaturer 4: ๐
๐4 = ๐ + ๐ฝ4 + ๐๐4
Where โช ๐ is the defect rate โช ๐ is the overall mean defect rate โช ๐ฝ1 is manufacturer 1โs mean deviation from ๐ โช ... โช ๐ฝ4 is manufacturer 4โs mean deviation from ๐ โช ๐ is the random, unexplained, part Null hypothesis: โช ๐ฝ1 = ๐ฝ2 = ๐ฝ3 = ๐ฝ4 = 0
COMPARING MORE THAN TWO ๐S
๐ + ๐ฝ1 = โฏ = ๐ + ๐ฝ4
This โgroup effectโ ๐ฝ has nothing to do with the significance level ๐ฝ!
SLIDE 10
โช What is the alternative hypothesis ๐ผ1?
โช when ๐ผ0: ๐1 = ๐2 = ๐3 = ๐4
โช Formulation 1:
โช wrong: ๐ผ1: ๐1 โ ๐2 โ ๐3 โ ๐4 โช correct: ๐ผ1: ๐๐๐ข ๐1 = ๐2 = ๐3 = ๐4 โช or: at least one of the ๐s differs from the other ๐s
COMPARING MORE THAN TWO ๐S
๐1 โ ๐2 โ ๐3 โ ๐4 ๐1 = ๐2 = ๐3 โ ๐4
SLIDE 11
โช What is the alternative hypothesis ๐ผ1?
โช when ๐ผ0: ๐ฝ1 = ๐ฝ2 = ๐ฝ3 = ๐ฝ4 = 0
โช Formulation 2:
โช wrong: ๐ผ1: ๐ฝ1 โ ๐ฝ2 โ ๐ฝ3 โ ๐ฝ4 โ 0 โช correct: ๐ผ1: ๐๐๐ข ๐ฝ1 = ๐ฝ2 = ๐ฝ3 = ๐ฝ4 = 0 โช or: at least one of the ๐ฝs differs from 0
COMPARING MORE THAN TWO ๐S
๐ฝ1 โ ๐ฝ2 โ ๐ฝ3 โ ๐ฝ4 ๐ฝ1 = ๐ฝ2 = ๐ฝ3 โ ๐ฝ4
SLIDE 12
We want to investigate possible differences in mean income in Atlanta, Boston, Chicago and Detroit.
- a. What is the null hypothesis?
- b. Suppose the null hypothesis is rejected. What can you
conclude? EXERCISE 1
SLIDE 13
โช Define notation:
โช ๐ง is the numerical value (e.g., chip defect rate) โช ๐ง๐๐ is the value for observation #๐ within treatment #๐ (e.g., machine #๐) โช เดค ๐งโ๐ is the average over all observations (๐ = 1, โฆ , ๐๐) within treatment #๐ โช เดค เดค ๐งโโ is the average over all observations within all treatments (๐ = 1, โฆ , ๐)
โช Analysis of variance (ANOVA) model ๐
๐๐ = ๐๐ + ๐๐๐
- r ๐
๐๐ = ๐ + ๐ฝ๐ + ๐๐๐
ANALYSIS OF VARIANCE
Observe the position of the
- dots. A dot tells that index
has been averaged over
SLIDE 14
Compare variation within groups to variation between groups โช variation within group #๐:
โช ๐๐๐
๐ = ฯ๐=1 ๐๐
๐ง๐๐ โ เดค ๐งโ๐
2
โช variation within all groups ๐ = 1, โฆ , ๐:
โช ๐๐๐ = ฯ๐=1
๐
๐๐๐
๐ =
โช ฯ๐=1
๐
ฯ๐=1
๐๐
๐ง๐๐ โ เดค ๐งโ๐
2
โช variation between the ๐ groups
โช so due to the ๐ฝs: โช ๐๐๐ต = ฯ๐=1
๐
๐๐ เดค ๐งโ๐ โ เดค เดค ๐งโโ
2
ANALYSIS OF VARIANCE
So ๐๐๐ต is the variation around the mean เดค ๐งโโ that is explained by the model, by factor โAโ
SLIDE 15
Together, ๐๐๐ต and ๐๐๐ make up the total variation โช variation in entire data set:
โช ๐๐๐ = ฯ๐=1
๐
ฯ๐=1
๐๐
๐ง๐๐ โ เดค เดค ๐งโโ
2
โช so
โช ๐๐๐ = ๐๐๐ต + ๐๐๐
โช Think about the logic: we are comparing several means by comparing two variances
โช analysis of variance is used to compare ๐1, ๐2, โฆ , ๐๐
ANALYSIS OF VARIANCE
So ๐๐๐ is the total variation around the grand mean เดฅ ๐งโโ ๐๐๐ ๐๐๐ต ๐๐๐น
SLIDE 16
ANALYSIS OF VARIANCE
SLIDE 17
Source of variation ๐ป๐ป ๐๐ ๐ต๐ป ๐ฎโratio between groups (due to factor โAโ) ๐๐๐ต ๐ โ 1 ๐๐๐ต = ๐๐๐ต ๐ โ 1 ๐บ = ๐๐๐ต ๐๐๐ within groups ๐๐๐ ๐ โ ๐ ๐๐๐ = ๐๐๐ ๐ โ ๐ total ๐๐๐ ๐ โ 1
ANALYSIS OF VARIANCE
SLIDE 18
We sample from the four cities incomes from 100 persons (30 from Atlanta, 20 from Boston, 25 from Chicago and Detroit).
- a. What is ๐ and ๐ in the previous scheme?
- b. Specify ๐
๐๐ = ๐๐ + ๐๐๐ for the case of the 8th respondent
from Chicago. EXERCISE 2
SLIDE 19
What do we test? โช ๐ผ0: ๐1 = ๐2 = โฏ = ๐๐ โช or equivalently ๐ผ0: ๐ฝ1 = ๐ฝ2 = โฏ = ๐ฝ๐ = 0 How do we test? โช by comparing ๐๐๐ต and ๐๐๐ โช or equivalently ๐๐๐ต and ๐๐๐ (which are variances!) โช if ๐ผ0 is true, ๐๐๐ต and ๐๐๐ are expected to be equal โช their ratio is the test statistic: ๐บ = ๐๐๐ต ๐๐๐ TESTING SIGNIFICANCE OF ANOVA
if this ratio is large, the group averages are likely to differ
SLIDE 20
The test statistic ๐บ โช is likely to be around 1 if ๐ผ0 is true โช is likely to be much larger than 1 if ๐ผ1 is true โช has a sampling distribution ๐บ๐โ1,๐โ๐ under ๐ผ0 Here ๐บdf1,df2 is the ๐บ-distribution with df1 and df2 degrees
- f freedom
Reject for large values of ๐บ =
๐๐๐ต ๐๐๐ only
TESTING SIGNIFICANCE OF ANOVA
because we only reject ๐ผ0 if variations between groups are larger than expected under ๐ผ0
SLIDE 21
So step 3 becomes: โช under ๐ผ0, ๐บ =
๐๐๐ต ๐๐๐ โผ ๐บ๐โ1,๐โ๐
โช under the assumption: ๐๐๐ โผ ๐ 0, ๐2 In other words, the assumptions of ANOVA are: โช the observations ๐ง๐๐ should be independent โช the sub-populations should be normally distributed โช the sub-populations should have equal variances Fortunately, ANOVA is somewhat robust to โช departures from normality and โช the equal variance assumptions TESTING SIGNIFICANCE OF ANOVA
SLIDE 22
Five step procedure for ANOVA โช Step 1:
โช ๐ผ0: ๐ฝ1 = ๐ฝ2 = โฏ = ๐ฝ๐ = 0 ; ๐ผ1: not ๐ผ0 ; ๐ฝ = 0.05
โช Step 2:
โช sample statistic: ๐บ =
๐๐๐ต ๐๐๐ ; reject for large values
โช Step 3:
โช under ๐ผ0: ๐บ =
๐๐๐ต ๐๐๐ โผ ๐บ๐โ1,๐โ๐
โช requirement: normal populations with equal variance
โช Step 4:
โช calculate ๐บcrit = ๐บupper;df1,df2,๐ฝ โช
- r calculate ๐โvalue = ๐ ๐บ โฅ ๐บcalc
โช Step 5
โช reject ๐ผ0 if ๐บcalc > ๐บcrit โช
- r reject ๐ผ0 if ๐โvalue < ๐ฝ
TESTING SIGNIFICANCE OF ANOVA
SLIDE 23
Rejecting ๐ผ0: ๐ฝ1 = ๐ฝ2 = โฏ = ๐ฝ๐ = 0 โช is equivalent to rejecting ๐ผ0: ๐1 = ๐2 = โฏ = ๐๐ โช means that at least one of the ๐ฝs is not 0 โช means that at least one of the ๐s differs from another ๐ โช means that there is a โfactor effectโ or โtreatment effectโ โช that we donโt know (yet) which of the groups is or are significantly different โช that we donโt know (yet) if the differing group are significanctly lower of higher
โช we need a โpost-hocโ test to find out which groups are different and in which direction
TESTING SIGNIFICANCE OF ANOVA
SLIDE 24
Example โช Context:
โช you want to see if three different golf clubs yield different distances โช you randomly select five measurements from trials on an automated driving machine for each club โช at the 0.05 significance level, is there a difference in mean distance?
PERFORMING ANOVA
SLIDE 25
The three means are different But are they statistically (significanty) different? Here: โช เดค เดค ๐
โโ = 232.1
โช เดค ๐
โ1 = 249.2
โช เดค ๐
โ2 = 226.0
โช เดค ๐
โ3 = 221.0
PERFORMING ANOVA
SLIDE 26
Organizing the data in SPSS โช independent samples, so not โช but rather โช and then PERFORMING ANOVA
SLIDE 27
PERFORMING ANOVA
๐๐๐ต ๐๐๐ ๐๐๐ = ๐๐๐ต + ๐๐๐ ๐๐ = ๐๐ ๐๐ ๐บ = ๐๐๐ต ๐๐๐ ๐-value (one-tailed)
SLIDE 28
In the 5-step procedure the underlying model is not mentioned But it can be useful to mention it โช โStep 0โ: ๐
๐๐ = ๐ + ๐ฝ๐ + ๐๐๐ with ๐๐๐ โผ ๐ 0, ๐2
In fact, we could also do that in our previous tests: โช one-sample ๐: ๐๐ = ๐ + ๐๐ with ๐๐ โผ ๐ 0, ๐2 โช two-sample ๐: ๐
๐1 = ๐1 + ๐๐ and ๐ ๐2 = ๐2 + ๐๐ with
๐๐ โผ ๐ 0, ๐2 โช etc. In ANOVA and regression analysis, the statistical model must be stated as a โstep 0โ โช in other cases, you may leave it out THE STATISTICAL MODEL
SLIDE 29
23 March 2015, Q1i-k OLD EXAM QUESTION
SLIDE 30