Sei sulla pagina 1di 35

_

2
andF Distributions
Lecture 9 Lecture9
Barrow, Statistics for Economics, Accounting and Business Studies, 4
th
edition Pearson Education Limited 2006
_
2
Distribution
The_
2
distributionisusedto:
constructconfidenceintervalsforavariance
compare a set of actual frequencies with expected compareasetofactual frequencieswithexpected
frequencies
test for association between variables in a contingency testforassociationbetweenvariablesinacontingency
table
It is asymmetric and depends on the degrees of Itisasymmetricanddependsonthedegreesof
freedom
Barrow, Statistics for Economics, Accounting and Business Studies, 4
th
edition Pearson Education Limited 2006
F Distribution
TheF distributionisusedto
testthehypothesisofequalityoftwovariances
d l i f i ( ) i conductananalysisofvariance (ANOVA),comparingmeans
acrossseveralsamples
It is as mmetric and depends on the degrees of freedom Itisasymmetricanddependsonthedegreesoffreedom
Barrow, Statistics for Economics, Accounting and Business Studies, 4
th
edition Pearson Education Limited 2006
Tailsofthe_
2
19
Distribution
2.5%
2.5%
0 10 20 30 40 50
8.91
32.85
Barrow, Statistics for Economics, Accounting and Business Studies, 4
th
edition Pearson Education Limited 2006
l l f h h d CriticalValuesoftheChisquared
Distribution
NBchisquaredisnotsymmetricsotablewillgivedifferentvaluesfor
the lower and upper tails theloweranduppertails
ExcerptfromTableA4:
v
0.990 0.975 0.050 0.025 0.010
1 0.000 0.001 3.841 5.024 6.635
2 0.020 0.051 5.991 7.378 9.210
3 0.115 0.216 7.815 9.348 11.345
: : : : : :
18 7 015 8 231 28 869 31 526 34 805 18 7.015 8.231 28.869 31.526 34.805
19 7.633 8.907 30.144 32.852 36.191
20 8.260 9.591 31.410 34.170 37.566
Barrow, Statistics for Economics, Accounting and Business Studies, 4
th
edition Pearson Education Limited 2006
Case1:EstimatingaVariance
Arandomsampleofsizen =20yieldsastandarddeviationofs
25 How do we estimate the population variance? =25.Howdoweestimatethepopulationvariance?
Pointestimate:uses
2
=25
2
=625whichisunbiased(E(s
2
)=o
2
)
Intervalestimate:weneedthesamplingdistributionofs
2
...
Barrow, Statistics for Economics, Accounting and Business Studies, 4
th
edition Pearson Education Limited 2006
TheSamplingDistributionofs
2
( )
2
1
2
2
~
1

n
s n
_
oo
n-1 gives the degrees of freedom for the _
2
distribution,
19 in this example 19 in this example.
_
2
Barrow, Statistics for Economics, Accounting and Business Studies, 4
th
edition Pearson Education Limited 2006
_
2
LimitstotheConfidenceInterval
h d h
2
l ff h Forthe95%CI,weneedthe_
2
valuescuttingoff2.5%ineach
tailofthedistribution
ExcerptfromTableA4:
v
0.990 0.975 0.050 0.025 0.010
v
1 0.000 0.001 3.841 5.024 6.635
2 0.020 0.051 5.991 7.378 9.210
3 0 115 0 216 7 815 9 348 11 345 3 0.115 0.216 7.815 9.348 11.345
: : : : : :
18 7.015 8.231 28.869 31.526 34.805
19 7 633 8 907 30 144 32 852 36 191 19 7.633 8.907 30.144 32.852 36.191
20 8.260 9.591 31.410 34.170 37.566
Barrow, Statistics for Economics, Accounting and Business Studies, 4
th
edition Pearson Education Limited 2006
Tailsofthe_
2
19
Distribution(cont.)
Wecanbe95%confidentthat(n1)s
2
/o
2
liesbetween8.91and32.85
(f 20) (forn =20)
Rearranging:
( )
85 . 32
1
91 . 8
2
2
s

s
o
s n
Rearranging:
( ) ( )
91 8
1
85 32
1
2
2
2
s n s n
s s

o
Substitutings
2
=625andn =20:
91 . 8 85 . 32
gives the 95% CI estimate
8 . 332 , 1 5 . 361
2
s so
Barrow, Statistics for Economics, Accounting and Business Studies, 4
th
edition Pearson Education Limited 2006
givesthe95%CIestimate
Case2:ComparingActualvs
Expected Frequencies ExpectedFrequencies
ll f d ld 72rollsofadiceyield:
Score on dice 1 2 3 4 5 6
From a fair dice one would expect each number to come up 12
Frequency 6 15 15 7 15 14
Fromafairdiceonewouldexpecteachnumbertocomeup12
times.
Is this evidence of a biased dice? Isthisevidenceofabiaseddice?
Barrow, Statistics for Economics, Accounting and Business Studies, 4
th
edition Pearson Education Limited 2006
TestStatistic
H h di i f i H
0
:thediceisfair
H
1
:thediceisbiased
Thiscanbetestedusing
( )

E O
2
2
which has a _
2
distribution with k1 degrees of freedom k = 6
( )

=
E
2
_
whichhasa_ distributionwithk1degreesoffreedom,k =6
inthiscasebecausewehave6outcomes.
Barrow, Statistics for Economics, Accounting and Business Studies, 4
th
edition Pearson Education Limited 2006
CalculatingtheTestStatistic
Score Observed Expected O E (O E)
2
(O E)
2

frequency (O) frequency (E) E
1 6 12 6 36 3.00
2 15 12 3 9 0.75
3 15 12 3 9 0.75
4 7 12 5 25 2 08 4 7 12 5 25 2.08
5 15 12 3 9 0.75
6 14 12 2 4 0 33 6 14 12 2 4 0.33
Totals 72 72 0 7.66
Barrow, Statistics for Economics, Accounting and Business Studies, 4
th
edition Pearson Education Limited 2006
CalculatingtheTestStatistic(cont.)
Theteststatistic,7.66,islessthanthecriticalvalueof_
2
withv
=5,11.1
Hence the null is not rejected, the difference between Hencethenullisnotrejected,thedifferencebetween
observedandexpectedoutcomesisrandom
Note the critical value cuts off 5% (not 2 5%) in the upper tail of Notethecriticalvaluecutsoff5%(not2.5%)intheuppertailof
thedistribution.OnlylargevaluesoftheteststatisticrejectH
0
Barrow, Statistics for Economics, Accounting and Business Studies, 4
th
edition Pearson Education Limited 2006
Case3:ContingencyTables
Theassociationbetweentwovariablescanalsobeanalysedvia
the_
2
distribution
Votingbehaviourbasedonasampleof200:
So c i al c l as s L ab o u r Co n s er v at i v e L i b er al
Dem o c r at
To t al
A 10 15 15 40 A 10 15 15 40
B 40 35 25 100
C 30 20 10 60
Total 80 70 50 200
Barrow, Statistics for Economics, Accounting and Business Studies, 4
th
edition Pearson Education Limited 2006
AreSocialClassandVoting
Behaviour Related? BehaviourRelated?
H
0
:noassociationbetweensocialclassandvotingbehaviour
H
1
:someassociation
Expectedvalues arecalculated,basedonthenullofno
association
E.g.ifthereisnoassociation:
40%(80/200)ofeverysocialclassshouldvoteLabour,i.e.16from
classA,40fromBand24fromC
Barrow, Statistics for Economics, Accounting and Business Studies, 4
th
edition Pearson Education Limited 2006
Observed(andExpected)Values
Social class Labour Conservati ve Liberal Democrat Total
A 10(16) 15(14) 15(10) 40
B 40(40) 35(35) 25(25) 100 B 40(40) 35(35) 25(25) 100
C 30(24) 20(21) 10(15) 60
Total 80 70 50 200
Barrow, Statistics for Economics, Accounting and Business Studies, 4
th
edition Pearson Education Limited 2006
CalculatingtheTestStatistic
( ) ( ) ( )
10
10 15
14
14 15
16
16 10
2 2 2
+

( ) ( ) ( )
25
25 25
35
35 35
40
40 40
10 14 16
2 2 2
+

( ) ( ) ( )
04 . 8
15
15 10
21
21 20
24
24 30
25 35 40
2 2 2
=

Forv =(rows1) (columns1)=4,thecriticalvalueofthe_


2
15 21 24
distributionis9.50,sothenullofnoassociationisnotrejected
atthe5%significancelevel.
Barrow, Statistics for Economics, Accounting and Business Studies, 4
th
edition Pearson Education Limited 2006
Testing Two Variances the F TestingTwoVariances theF
Distribution
Dotwosampleshaveequalvariances (i.e.comefrom p q (
populationswiththesamevariance)?
Data: Data:
n
1
=30 s
1
=25
n
2
=30 s
2
=20
2 2
Barrow, Statistics for Economics, Accounting and Business Studies, 4
th
edition Pearson Education Limited 2006
h TestingTwoVariances theF
Distribution (cont ) Distribution(cont.)
2 2
H
0
:o
1
2
=o
2
2
H
1
:o
1
2
=o
2
2
or,equivalently
H
0
:o
1
2
/o
2
2
=1
H : o
2
/o
2
=1 H
1
:o
1
2
/o
2
2
=1
Barrow, Statistics for Economics, Accounting and Business Studies, 4
th
edition Pearson Education Limited 2006
TheTestStatistic
h Theteststatisticis
s
F
1
2
1 1
~
Evaluatingthis:
s
F
n n
2
2
1 1
1 2
,
25
2
5625 . 1
20
25
2
2
= = F
F*
29,29
=2.09>1.5625,sothenullisnotrejected.Thevariances
maybeconsideredequal
Barrow, Statistics for Economics, Accounting and Business Studies, 4
th
edition Pearson Education Limited 2006
E t F T bl A5(b) ExcerptFromTableA5(b):
the F Distribution theF Distribution
v
1
1 2 24 30 40
1
v
2
1 647.79 799.48 997.27 1001.40 1005.60
2 38 51 39 00 39 46 39 46 39 47 2 38.51 39.00 39.46 39.46 39.47
: : : : : :
28 5.61 4.22 2.17 2.11 2.05
29 5.59 4.20 2.15 2.09 2.03
30 5.57 4.18 2.14 2.07 2.01
(Using v
1
= 30 (rather than 29) makes little practical
difference.)
Barrow, Statistics for Economics, Accounting and Business Studies, 4
th
edition Pearson Education Limited 2006
OneorTwoTailedTest?
Aslongasthelargervarianceismadethenumeratorofthetest
statistic only large values of F reject the null statistic,only large valuesofF rejectthenull.
ThesmallestpossiblevalueofF is1,whichoccursifthesample
i l H h ld t b j t d i thi variancesareequal.H
0
shouldnotberejectedinthiscase.
So,despitethe=inH
1
,thisisaonetailedtest.
Barrow, Statistics for Economics, Accounting and Business Studies, 4
th
edition Pearson Education Limited 2006
Case5:AnalysisofVariance(ANOVA)
Atestfortheequalityofseveralmeans,notjusttwo
b f asbefore
Inourexamplewetestfortheequalityofoutputof
threefactories,i.e.aretheyequallyproductive,on
average,ornot?
Barrow, Statistics for Economics, Accounting and Business Studies, 4
th
edition Pearson Education Limited 2006
Example:DailyOutputofThreeFactories
Observation Factory 1 Factory 2 Factory 3
1 415 385 408
2 430 410 415
3 395 409 418 3 395 409 418
4 399 403 440
5 408 405 425
6 418 400
7 399
Barrow, Statistics for Economics, Accounting and Business Studies, 4
th
edition Pearson Education Limited 2006
ChartofOutput
Factory 1
Factory 2
Factory 3
380 390 400 410 420 430 440 450
Barrow, Statistics for Economics, Accounting and Business Studies, 4
th
edition Pearson Education Limited 2006
HypothesisTest
H
0
:
1
=
2
=
3
H
1
:
1
=
2
=
3 1

1

2

3
Principleofthetest:breakdownthetotalvarianceofall
b ti i t th ithi f t i d th b t observationsintothewithinfactory varianceandthebetween
factory variance
Ifthebetweenvariancecomponentislargerelativetothe
withinvariancecomponent,rejectH
00
Barrow, Statistics for Economics, Accounting and Business Studies, 4
th
edition Pearson Education Limited 2006
SumsofSquares
R h h i k i h f Ratherthanvariances,workwithsumsofsquares
( )
2
2

x x
Sum of squares
( )
1
2

n
s
Variance
Barrow, Statistics for Economics, Accounting and Business Studies, 4
th
edition Pearson Education Limited 2006
ThreeSumsofSquares
Total sumofsquares(TSS)
Sumofsquaresofalldeviationsfromtheoverallaverage
Between sumofsquares(BSS)
Sumofsquaresofdeviationsoffactorymeansfromoverall
average
Within sumofsquares(WSS)
Sumofsquaresofdeviationswithineachfactory,from
factoryaverage
Barrow, Statistics for Economics, Accounting and Business Studies, 4
th
edition Pearson Education Limited 2006
TestStatistic
( )
( ) k n WSS
k BSS
F

=
1
TheF statisticistheratioofBSStoWSS,eachadjustedbytheir
( ) k n WSS
The F statistic is the ratio of SS to WSS, each adjusted by their
degreesoffreedom(k1andnk)
Large values of F BSS large relative to WSS between LargevaluesofF BSSlargerelativetoWSS between
factoriesdeviationslarge rejectH
0
Barrow, Statistics for Economics, Accounting and Business Studies, 4
th
edition Pearson Education Limited 2006
Calculations
TSS=
( )
2


ij
x x
(j indexesfactories,iindexesobservations)
( )

j i
j
=(415 410.11)
2
+(430 410.11)
2
++(440 410.11)
2
+(425 410.11)
2
=2,977.778
410.11istheoverall,orgrand,average
Barrow, Statistics for Economics, Accounting and Business Studies, 4
th
edition Pearson Education Limited 2006
Calculations(cont.)
2
BSS=
( )
2


j i
i
x x
whereistheaverageoutputoffactoryi
=6 (410.83 410.11)
2
+7 (401.57 410.11)
2
+5 (421.2
410 11)
2
1 128 43
i
x
410.11)
2
=1,128.43
410.83,401.57,421.11arethethreeaverages,respectively.
Barrow, Statistics for Economics, Accounting and Business Studies, 4
th
edition Pearson Education Limited 2006
Calculations(cont.)
WSS=TSS BSS=2,977.778 1,128.430
1 849 348 =1,849.348
Alt ti l WSS
( )

x x
2
Alternatively,WSS=
( )


j i
i ij
x x
=(415 410 83)
2
+ +(418 410 83)
2
+(385 = (415-410.83)
2
+ + (418-410.83)
2
+ (385-
401.57)
2
+ + (399-401.57)
2
+ (408-421.2)
2
+
+(425-421 2)
2
+ (425 421.2)
= 1,849.348
Barrow, Statistics for Economics, Accounting and Business Studies, 4
th
edition Pearson Education Limited 2006
ResultoftheTest
( ) ( )
576 4
1 3 43 . 1128 1 k BSS
F
( )
( )
( )
( )
576 . 4
3 18 348 . 1849
=

=
k n WSS
F
F*
2,15
=3.682(5%significancelevel)
F >F*hencewerejectH
0
.Therearesignificantdifferences
betweenthefactories.
EasiesttodoinEXCEL.....
Barrow, Statistics for Economics, Accounting and Business Studies, 4
th
edition Pearson Education Limited 2006
ANOVATable(ExcelFormat)
SUMMARY
Groups Count Sum Average Variance
Factory 1 6 2465 410.833 166.967
Factory 2 7 2811 401.571 70.6191
Factory 3 5 2106 421 2 147 7 Factory 3 5 2106 421.2 147.7

ANOVA ANOVA
Source of
Variation SS df MS F P-value F crit
Between Groups 1128.430 2 564.215 4.576 0.028 3.68
Within Groups 1849.348 15 123.290
Barrow, Statistics for Economics, Accounting and Business Studies, 4
th
edition Pearson Education Limited 2006
Total 2977.778 17

Summary
Usethe_
2
distributionto
C l l t th CI f i CalculatetheCIforavariance
Compareactualandexpectedvalues
Analyseacontingencytable
Use the F distribution to UsetheF distributionto
Testfortheequalityoftwovariances
T t f th lit f l Testfortheequalityofseveralmeans
Barrow, Statistics for Economics, Accounting and Business Studies, 4
th
edition Pearson Education Limited 2006

Potrebbero piacerti anche