Stats Lec9

download Stats Lec9

of 35

Transcript of Stats Lec9

  • 7/28/2019 Stats Lec9

    1/35

    2 andFDistributions

    Barrow, Statistics for Economics, Accounting and Business Studies, 4th edition Pearson Education Limited 2006

  • 7/28/2019 Stats Lec9

    2/35

    2 Distribution

    The

    2

    distributionis

    used

    to:

    constructconfidenceintervalsforavariance

    frequencies

    table

    freedom

    Barrow, Statistics for Economics, Accounting and Business Studies, 4th edition Pearson Education Limited 2006

  • 7/28/2019 Stats Lec9

    3/35

    FDistribution

    TheFdistribution

    is

    used

    to

    testthehypothesisofequalityoftwovariances

    con uct

    an

    ana ysis

    o

    variance ANOVA ,

    comparing

    means

    acrossseveralsamples

    sasymme r can epen son e egreeso ree om

    Barrow, Statistics for Economics, Accounting and Business Studies, 4th edition Pearson Education Limited 2006

  • 7/28/2019 Stats Lec9

    4/35

    Tailsof

    the

    219 Distribution

    2.5% 2.5%

    0 10 20 30 40 50

    8.91 32.85

    Barrow, Statistics for Economics, Accounting and Business Studies, 4th edition Pearson Education Limited 2006

  • 7/28/2019 Stats Lec9

    5/35

    CriticalValues

    of

    the

    Chi

    squared

    Distribution

    NB

    chi

    squared

    is

    not

    symmetric

    so

    table

    will

    give

    different

    values

    for

    ExcerptfromTableA4:

    0.990 0.975 0.050 0.025 0.0101 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

    : : : : : :

    . . . . .

    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, 4th edition Pearson Education Limited 2006

  • 7/28/2019 Stats Lec9

    6/35

    Case1:

    Estimating

    aVariance

    Arandom

    sample

    of

    size

    n =

    20

    yields

    astandard

    deviation

    of

    s

    = . ow owees ma e epopu a onvar ance

    Pointestimate:uses2 =252 =625whichisunbiased(E(s2)=2 )

    Intervalestimate:weneedthesamplingdistributionofs2...

    Barrow, Statistics for Economics, Accounting and Business Studies, 4th edition Pearson Education Limited 2006

  • 7/28/2019 Stats Lec9

    7/35

    TheSampling

    Distribution

    of

    s2

    212

    2

    ~

    1

    n

    sn

    n-1 gives the degrees of freedom for the 2 distribution,.

    Barrow, Statistics for Economics, Accounting and Business Studies, 4th edition Pearson Education Limited 2006

  • 7/28/2019 Stats Lec9

    8/35

    Limitsto

    the

    Confidence

    Interval

    Fort e95%CI,wenee t e va uescuttingo 2.5%ineac

    tail

    of

    the

    distribution

    ExcerptfromTableA4:

    0.990 0.975 0.050 0.025 0.010

    1 0.000 0.001 3.841 5.024 6.6352 0.020 0.051 5.991 7.378 9.210

    . . . . .

    : : : : : :

    187.015 8.231 28.869 31.526 34.805. . . . .

    20 8.260 9.591 31.410 34.170 37.566

    Barrow, Statistics for Economics, Accounting and Business Studies, 4th edition Pearson Education Limited 2006

  • 7/28/2019 Stats Lec9

    9/35

    Tailsof

    the

    219 Distribution(cont.)

    Wecan

    be

    95%

    confident

    that

    (n

    1)s2/2 lies

    between

    8.91

    and

    32.85

    orn = 85.32

    191.8

    2

    2

    sn

    11 222 snsn

    Substitutings2 =625andn =20:

    ..

    8.332,15.3612

    Barrow, Statistics for Economics, Accounting and Business Studies, 4th edition Pearson Education Limited 2006

  • 7/28/2019 Stats Lec9

    10/35

    Case2:

    Comparing

    Actual

    vs

    72ro so a iceyie :

    Score on dice 1 2 3 4 5 6

    Frequency 6 15 15 7 15 14

    times.

    Barrow, Statistics for Economics, Accounting and Business Studies, 4th edition Pearson Education Limited 2006

  • 7/28/2019 Stats Lec9

    11/35

    TestStatistic

    0:t e ce s a rH

    1:thediceisbiased

    Thiscanbetestedusing

    EO2

    2

    E

    ,

    inthiscasebecausewehave6outcomes.

    Barrow, Statistics for Economics, Accounting and Business Studies, 4th edition Pearson Education Limited 2006

  • 7/28/2019 Stats Lec9

    12/35

    Calculatingthe

    Test

    Statistic

    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

    .

    5 15 12 3 9 0.75

    .

    Totals 72 72 0 7.66

    Barrow, Statistics for Economics, Accounting and Business Studies, 4th edition Pearson Education Limited 2006

  • 7/28/2019 Stats Lec9

    13/35

    Calculatingthe

    Test

    Statistic

    (cont.)

    Thetest

    statistic,

    7.66,

    is

    less

    than

    the

    critical

    value

    of

    2 with

    =5,11.1

    observedand

    expected

    outcomes

    is

    random

    .

    thedistribution.OnlylargevaluesoftheteststatisticrejectH0

    Barrow, Statistics for Economics, Accounting and Business Studies, 4th edition Pearson Education Limited 2006

  • 7/28/2019 Stats Lec9

    14/35

    Case3:

    Contingency

    Tables

    Theassociationbetweentwovariablescanalsobeanalysedvia

    the

    2 distribution

    Votingbehaviourbasedonasampleof200:

    S o c i a l c l a s s L a b o u r C o n s e r v a t i v e L i b e r al

    D e m o c r a t

    T o t a l

    B 40 35 25 100

    C 30 20 10 60

    Total 80 70 50 200

    Barrow, Statistics for Economics, Accounting and Business Studies, 4th edition Pearson Education Limited 2006

  • 7/28/2019 Stats Lec9

    15/35

    AreSocial

    Class

    and

    Voting

    H0:noassociationbetweensocialclassandvotingbehaviourH1:someassociation

    Expectedvalues are

    calculated,

    based

    on

    the

    null

    of

    no

    association

    E.g.ifthereisnoassociation:

    40%

    (80/200)

    of

    every

    social

    class

    should

    vote

    Labour,

    i.e.

    16

    from

    classA,40fromBand24fromC

    Barrow, Statistics for Economics, Accounting and Business Studies, 4th edition Pearson Education Limited 2006

  • 7/28/2019 Stats Lec9

    16/35

    Observed(and

    Expected)

    Values

    Social class Labour Conservative Liberal Democrat Total

    A 10(16) 15(14) 15(10) 40

    C 30(24) 20(21) 10(15) 60

    Total 80 70 50 200

    Barrow, Statistics for Economics, Accounting and Business Studies, 4th edition Pearson Education Limited 2006

  • 7/28/2019 Stats Lec9

    17/35

    Calculatingthe

    Test

    Statistic

    101514151610 222

    252535354040 222

    04.8

    151021202430222

    For

    =

    (rows

    1)

    (columns

    1)

    =

    4,

    the

    critical

    value

    of

    the

    2

    distributionis9.50,sothenullofnoassociationisnotrejected

    atthe5%significancelevel.

    Barrow, Statistics for Economics, Accounting and Business Studies, 4th edition Pearson Education Limited 2006

  • 7/28/2019 Stats Lec9

    18/35

    Distribution

    Dotwo

    sam les

    have

    e ual

    variances i.e.

    come

    from

    populationswiththesamevariance)?

    n1 =30 s1 =25

    n =30 s =20

    Barrow, Statistics for Economics, Accounting and Business Studies, 4th edition Pearson Education Limited 2006

  • 7/28/2019 Stats Lec9

    19/35

    TestingTwo

    Variances

    the

    F

    .

    H0:1 =2

    H1:12 =2

    2

    or,equivalently

    H0:12/2

    2 =1

    2 21 1 2

    Barrow, Statistics for Economics, Accounting and Business Studies, 4th edition Pearson Education Limited 2006

  • 7/28/2019 Stats Lec9

    20/35

    TheTest

    Statistic

    T eteststatisticis

    s12

    ~

    Evaluatingthis:s

    n n

    2

    2 1 2,

    5625.120

    2 F

    F*29,29 =2.09>1.5625,sothenullisnotrejected. Thevariancesmaybeconsideredequal

    Barrow, Statistics for Economics, Accounting and Business Studies, 4th edition Pearson Education Limited 2006

  • 7/28/2019 Stats Lec9

    21/35

    xcerpt

    rom

    a e

    :

    1 1 2 24 30 40

    21 647.79 799.48 997.27 1001.40 1005.60

    . . . . .

    : : : : : :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 1 = 30 (rather than 29) makes little practicaldifference.)

    Barrow, Statistics for Economics, Accounting and Business Studies, 4th edition Pearson Education Limited 2006

  • 7/28/2019 Stats Lec9

    22/35

    Oneor

    Two

    Tailed

    Test?

    Aslongasthelargervarianceismadethenumeratorofthetest ,

    .

    ThesmallestpossiblevalueofFis1,whichoccursifthesamplevar ancesareequa . 0 s ou no ere ec e n scase.

    So,despitetheinH1,thisisaonetailedtest.

    Barrow, Statistics for Economics, Accounting and Business Studies, 4th edition Pearson Education Limited 2006

  • 7/28/2019 Stats Lec9

    23/35

    Case5:

    Analysis

    of

    Variance

    (ANOVA)

    A

    test

    for

    the

    equality

    of

    several

    means,

    not

    just

    two

    as e ore

    Inourexamplewetestfortheequalityofoutputof

    threefactories,

    i.e.

    are

    they

    equally

    productive,

    on

    average,ornot?

    Barrow, Statistics for Economics, Accounting and Business Studies, 4th edition Pearson Education Limited 2006

  • 7/28/2019 Stats Lec9

    24/35

    Example:Daily

    Output

    of

    Three

    Factories

    Observation Factory 1 Factory 2 Factory 3

    1 415 385 408

    2 430 410 415

    4 399 403 440

    5 408 405 425

    6 418 400

    7 399

    Barrow, Statistics for Economics, Accounting and Business Studies, 4th edition Pearson Education Limited 2006

  • 7/28/2019 Stats Lec9

    25/35

    Chartof

    Output

    Factory 1

    Factory 2Factory 3

    380 390 400 410 420 430 440 450

    Barrow, Statistics for Economics, Accounting and Business Studies, 4th edition Pearson Education Limited 2006

  • 7/28/2019 Stats Lec9

    26/35

    HypothesisTest

    H0:1 =2 =3

    H :

    Principleofthetest:breakdownthetotalvarianceofall

    o serva ons n o ew n ac ory var ancean e e ween

    factory variance

    Ifthebetweenvariancecomponentislargerelativetothe

    withinvariance

    component,

    reject

    H0

    Barrow, Statistics for Economics, Accounting and Business Studies, 4th edition Pearson Education Limited 2006

  • 7/28/2019 Stats Lec9

    27/35

    Sumsof

    Squares

    at ert anvar ances,wor w t sumso squares

    2xx

    Sum of squares

    1 ns

    Variance

    Barrow, Statistics for Economics, Accounting and Business Studies, 4th edition Pearson Education Limited 2006

  • 7/28/2019 Stats Lec9

    28/35

    ThreeSums

    of

    Squares

    Total sum

    of

    squares

    (TSS) Sumofsquaresofalldeviationsfromtheoverallaverage

    Between sumofsquares(BSS)

    Sum

    of

    squares

    of

    deviations

    of

    factory

    means

    from

    overall

    average

    Within sumofsquares(WSS)

    Sum

    of

    squares

    of

    deviations

    within

    each

    factory,

    from

    factoryaverage

    Barrow, Statistics for Economics, Accounting and Business Studies, 4th edition Pearson Education Limited 2006

  • 7/28/2019 Stats Lec9

    29/35

    TestStatistic

    kBSSF

    1

    TheFstatisticistheratioofBSStoWSS eachad ustedb their

    degreesof

    freedom

    (k

    1and

    nk)

    factoriesdeviationslarge rejectH0

    Barrow, Statistics for Economics, Accounting and Business Studies, 4th edition Pearson Education Limited 2006

  • 7/28/2019 Stats Lec9

    30/35

    Calculations

    TSS=

    2

    i xx

    (jindexesfactories,iindexesobservations)

    j i

    =(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, 4th edition Pearson Education Limited 2006

  • 7/28/2019 Stats Lec9

    31/35

    Calculations(cont.)

    BSS= j i

    i xx

    where istheaverageoutputoffactoryi

    =6 (410.83 410.11)2 +7 (401.57 410.11)2 +5 (421.2ix

    410.11 =1,128.43

    410.83,401.57,421.11arethethreeaverages,respectively.

    Barrow, Statistics for Economics, Accounting and Business Studies, 4th edition Pearson Education Limited 2006

  • 7/28/2019 Stats Lec9

    32/35

    Calculations(cont.)

    WSS=TSS BSS=2,977.778 1,128.430= , .

    2

    erna ve y, = j i

    iij

    - . - . -401.57)2 + + (399-401.57)2 + (408-421.2)2 +

    - 2 .= 1,849.348

    Barrow, Statistics for Economics, Accounting and Business Studies, 4th edition Pearson Education Limited 2006

  • 7/28/2019 Stats Lec9

    33/35

    Resultof

    the

    Test

    1343.11281 kBSS

    .318348.1849

    knWSS

    F* 2,15 =3.682

    (5%

    significance

    level)

    F>F*hencewerejectH0.Therearesignificantdifferencesbetweenthefactories.

    EasiesttodoinEXCEL.....

    Barrow, Statistics for Economics, Accounting and Business Studies, 4th edition Pearson Education Limited 2006

  • 7/28/2019 Stats Lec9

    34/35

    ANOVATable

    (Excel

    Format)

    SUMMARY

    Groups Count Sum Average Variance

    Factory 1 6 2465 410.833 166.967

    Factory 2 7 2811 401.571 70.6191

    . .

    Source ofVariation 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, 4th edition Pearson Education Limited 2006

    Total 2977.778 17

  • 7/28/2019 Stats Lec9

    35/35

    Summary

    Usethe2 distributionto

    a cu a e e oravar ance

    Compareactualandexpectedvalues

    Analyse

    a

    contingency

    table

    Testfortheequalityoftwovariances

    es

    or

    eequa y

    o

    severa

    means

    Barrow, Statistics for Economics, Accounting and Business Studies, 4th edition Pearson Education Limited 2006