Analysis of Variance_bm [Compatibility Mode]

download Analysis of Variance_bm [Compatibility Mode]

of 7

Transcript of Analysis of Variance_bm [Compatibility Mode]

  • 8/14/2019 Analysis of Variance_bm [Compatibility Mode]

    1/7

    1

    ANALYSIS OF VARIANCE

    (ANOVA)

    Wah Mong Weh

    Jabatan Matematik

    IPG KSAH

    2

    Aims and Objectives

    Understand the basic principles ofANOVA

    -why it is done?

    - what it tells us?

    To conduct one-way independent

    ANOVA by hand

    3

    When And Why?

    When do we use ANOVA?

    When we would like to compare means from 3 or

    more groups.

    Why not use lots of t-tests?

    Cant look at several independent variables at once

    Inflates the Type I error

    Need many t tests when the number of groups

    increase. [See Andy Field handout]

    4

    AOVA

    One-way analysis of variance (ANOVA) is a

    hypothesis testing technique that is used to

    compare means from three or more

    populations.

    5

    ANOVA

    ANOVA adalah kaedah ujian

    hipotesis bagi mengenalpasti

    perbezaan min yang wujud dalam

    dua ataupun lebih sample ujian.

    Tujuan utama ANOVA adalah

    menentukan sama ada perbezaan

    sample disebabkan kesilapan proses

    sample ataupun kesan rawatan yang

    sistematik .

    6

    JENIS-JENIS ANOVA

    a. One way ANOVA

    - yang melibatkan satu

    pembolehubah bebas.

    b. Two way ANOVA

    - melibatkan dua pembolehubah

    bebas.

  • 8/14/2019 Analysis of Variance_bm [Compatibility Mode]

    2/7

    7

    ANOVA SATU HALA

    Ujian statisti yan! di!unaan

    untu mencari perbe"aan diantara ti!a atau lebih min

    #ipotesis nol ba!i ANOVA

    ialah $min-min populasi

    daripada tempat sampel-

    sampel itu diambil adalah

    sama%

    H0: 1 = 2 = 3 = . . . k8

    ANOVA SATU HALA

    #ipotesis alternatif ialah $&euran!-uran!nya terdapat

    satu pasan!an min populasi yan!

    berbe"a%

    H1: 1 2

    9

    Testing the Hypothesis

    The null hypothesis that the three(or more) population means areequal.

    That is written as

    H0: 1 = 2 = 3 = . . . kH1: At least one mean is different

    10

    Theory of ANOVA

    We calculate how much variability there is

    between scores.

    -Total sum of squares (SST )

    We then calculate how much of this variability

    can be explained by the model we fit to the

    data

    -how much variability is due to the

    experimental manipulation, Model Sum of

    Squares (SSM)

    11

    Theory of ANOVA

    How much cannot be explained

    How much is due to individual differences in

    performance, Residual Sum of Squares (SSR )

    We compare the amount of variability

    explained by the model (experiment), to the

    error in the model ( individual differences)

    - The ratio is called the F-ratio

    12

    Test Statistic for One-Way ANOVA

    A excessively large F test statistic isevidence against equal population means.Thus, the null will be rejected.

    F = variance between samplesvariance within samples

  • 8/14/2019 Analysis of Variance_bm [Compatibility Mode]

    3/7

    13

    The variance is calculated intwo different ways and the

    ratio of the two values is

    formed'

    W

    B

    MS

    MSF =

    14

    MSB, Mean Square Between, the variancebetween samples, measures the differences

    related to the treatment given to each sample.

    2.MSW

    Mean Square Within, the variance

    within samples, measures the differences

    related to entries within the same sample. The

    variance within samples is due to sampling

    error.

    15

    One-Way ANOVA Assumptions

    1. The populations have normal distributions.

    2. The populations have the same variance

    2(or standard deviation ).3. The samples are simple random samples.

    4. The samples are independent of each other.

    5. The different samples are from populationsthat are categorized in only one way.

    16

    ANOVA methods require theF-distribution

    1. The F-distribution is not symmetric; it isskewed to the right.

    2. The values of F can be 0 or positive, theycannot be negative.

    3. There is a different F-distribution for each pairof degrees of freedom for the numerator anddenominator.

    4. Critical values of F can be found from Tables

    17

    Critical Value of F

    Right-tailed test

    Degree of freedom with ksamples of thesame size n is given by:

    numerator df = k-1

    denominator df= k(n -1) or N-k

    18

    F distribution: General Shape

    nonnegative values only

    Not symmetric (skewed to the right)

    F [3,16]

    Illustrative graph for 4 sampleswith 5 members each.

    k-1 = 4-1 = 3 N-k = 20-4= 16

  • 8/14/2019 Analysis of Variance_bm [Compatibility Mode]

    4/7

    19

    Taburan persampelan yan!di!unaan ialah taburan ('

    &ala statisti yan!

    di!unaan ialah nisbah (

    20

    Relationships Among Components of ANOVA

    21

    CALCULATING ANOVA

    BY HAND

    22

    EQUAL SAMPLE SIZES

    2

    xs

    2

    xns

    2

    ps

    Variance between samples =

    where = variance of sample means

    Variance within samples =

    Where = pooled variance (or themean of the sample variances)

    2

    ps

    23

    F = =variance within samples

    variance between samples

    ni(xi - x)2

    k -1

    (ni - 1)si

    (ni - 1)

    2

    Calculations with Unequal Sample Sizes

    See Formula Booklet pp. 20-21

    24

    F = =variance within samples

    variance between samples

    ni(xi - x)2

    k -1

    (ni - 1)si

    (ni - 1)

    where x = mean of all sample scorescombined, also known as grand mean

    2

    Calculations with Unequal Sample Sizes

  • 8/14/2019 Analysis of Variance_bm [Compatibility Mode]

    5/7

    25

    F = =variance within samplesvariance between samples

    ni(xi - x)2

    k -1

    (ni - 1)si

    (ni - 1)

    where x = mean of all sample scores combined

    k = number of population means being compared

    2

    Calculations with Unequal Sample Sizes

    26

    F = =variance within samplesvariance between samples

    ni(xi - x)2

    k -1

    (ni - 1)si

    (ni - 1)

    where x = mean of all sample scores combined

    k = number of population means being compared

    ni = number of values in the ith sample

    2

    Calculations with Unequal Sample Sizes

    27

    F = =variance within samples

    variance between samples

    ni(xi - x)2

    k -1

    (ni - 1)si

    (ni - 1)

    where x = mean of all sample scores combined

    k = number of population means being compared

    ni = number of values in the ith sample

    xi = mean of the ith sample

    2

    Calculations with Unequal Sample Sizes

    28

    F = =variance within samples

    variance between samples

    ni(xi - x)2

    k -1

    (ni - 1)si

    (ni - 1)

    where x = mean of all sample scores combined

    k = number of population means being compared

    ni = number of values in the ith sample

    xi = mean of the ith sample

    si = variance of values in the ith sample

    2

    2

    Calculations with Unequal Sample Sizes

    29

    Key Components of ANOVA Method

    SS(total), or total sum of squares, is a

    measure of the total variation (around x) inall the sample data combined.

    30

    Key Components of ANOVAMethod

    SS(total), or total sum of squares, is a measureof the total variation (around x) in all the sampledata combined and can be obtained using either

    formula below.

    SS(total) = (x - x)2

    ( )N

    xxTotalSS

    2

    2)( =

  • 8/14/2019 Analysis of Variance_bm [Compatibility Mode]

    6/7

    31

    SS(treatment) is a measure of the variationbetween the samples [see Formula 6.119ii)].

    In one-way ANOVA, SS(treatment) is

    sometimes referred to as SS(model).

    Because it is a measure of variability between

    the sample means, it is also referred to as SS

    (between groups) or SS (between samples).

    Key Components of ANOVA Method

    32

    SS(treatment) = n1(x1 - x)2 + n2(x2 - x)

    2 + . . . nk(xk - x)2

    = ni(xi - x)2

    SS(treatment) is a measure of the variationbetween the samples.

    It is computed in the following way:

    Key Components of ANOVA Method

    33

    SS(error) is a sum of squares representing the variabilitythat is assumed to be common to all the populations beingconsidered [Also called SS(residual)]

    SS(error) = (n1 -1)s1 + (n2 -1)s2 + (n3 -1)s3 . . . nk(xk -1)si

    = (ni - 1)si

    2 2 2

    2

    2

    Key Components of ANOVA Method

    34

    SS(total) = SS(treatment) + SS(error)

    Key Components of ANOVA Method

    35

    Mean Squares (MS)

    Sum of Squares SS(treatment) and SS(error)divided by corresponding number of degreesof freedom give the mean squares.

    36

    MS (Treatment / Model / Group)

    MSTR / MSM / MSG is the mean square fortreatment or model or group and is obtained asfollows:

    MS (treatment) =SS (treatment)

    k - 1

  • 8/14/2019 Analysis of Variance_bm [Compatibility Mode]

    7/7

    37

    MS (Error or Residual)

    MS (error) is mean square for error,obtained as follows:

    MS (error) =SS (error)

    N - k

    38

    Mean Squares (MS)

    MS (error) is mean square for errorobtained as follows:

    MS (total) =SS (total)

    N - 1

    MS (error) =SS (error)

    N - k

    39

    Test Statistic for ANOVA with

    Unequal Sample Sizes

    Numerator df= k -1 Denominator df= N - k

    F =MS (treatment)

    MS (error)

    40

    Example 1 (Equal sample sizes)

    A researcher wishes to try three different

    techniques to lower the blood pressure of

    individuals diagnosed with high blood

    pressure. The subjects are randomly assigned

    to three groups; the first group takes

    medication, the second group exercises, and

    the third group follows a special diet. Afterfour weeks, the reduction in each person's

    blood pressure is recorded. At =0.05, test the

    claim that there is no difference among the

    means. The data are shown

    41

    Medication

    Exercise Diet

    10 6 5

    12 8 9

    9 3 12

    15 0 8

    13 2 4

    Sample means

    sample sd

    sample var