SlideShare a Scribd company logo
1 of 62
Download to read offline
ANOVA
        Ji Li


    April 24, 2012




.                    .   .   .   .   .   .
The Basic Idea



     We want to determine if different “treatments” have different
     effects by comparing two different measures of variability of data
     to determine how much of the variation of data is random and how
     much is due to the treatment.




.                                              .    .   .    .   .      .
Outline

     Basic ANOVA
        The Set-Up
        An Example
        The Model
        Treatment sum of squares SSTR
        More sum of squares

     An ANOVA F Test Example

     Comparing ANOVA F test with Kruskal-Wallis test



.                                             .   .    .   .   .   .
The Hypotheses
     ▶   We have data divided into k categories called “treatments.”
         The word “treatment” refers to application of chemicals or
         other methods to improve crop yield on pieces of land.




.                                               .   .    .    .   .    .
The Hypotheses
     ▶   We have data divided into k categories called “treatments.”
         The word “treatment” refers to application of chemicals or
         other methods to improve crop yield on pieces of land.
     ▶   For the jth treatment, we obtain numbers

                               Y1j , Y2j , . . . , Ynj

         which indicate how well the jth treatment worked to improve
         crop output, or how well the jth drug worked for the patients
         who took it.




.                                                        .   .   .   .   .   .
The Hypotheses
     ▶   We have data divided into k categories called “treatments.”
         The word “treatment” refers to application of chemicals or
         other methods to improve crop yield on pieces of land.
     ▶   For the jth treatment, we obtain numbers

                               Y1j , Y2j , . . . , Ynj

         which indicate how well the jth treatment worked to improve
         crop output, or how well the jth drug worked for the patients
         who took it.
     ▶   We test
                           H0 : µ1 = µ2 = · · · = µk
                                         versus

                        H1 : not all the µj ’s are equal
.                                                        .   .   .   .   .   .
Notations 1


      ▶   k = number of treatments. For example, we want to test the
          effectiveness of k drugs.




.                                              .    .   .    .   .     .
Notations 1


      ▶   k = number of treatments. For example, we want to test the
          effectiveness of k drugs.
      ▶   nj = size of sample from the jth treatment.




.                                                .      .   .   .   .   .
Notations 1


      ▶   k = number of treatments. For example, we want to test the
          effectiveness of k drugs.
      ▶   nj = size of sample from the jth treatment.
              ∑k
      ▶   n=      nj is the total number of sample points.
              j=1




.                                                .    .      .   .   .   .
Notations 1


      ▶   k = number of treatments. For example, we want to test the
          effectiveness of k drugs.
      ▶   nj = size of sample from the jth treatment.
              ∑k
      ▶   n=      nj is the total number of sample points.
              j=1
      ▶   Yij = ith sample point from jth treatment.




.                                                .     .     .   .   .   .
Notations 2

                  ∑
                  nj
      ▶   T·j =         Yij is the sum of the numbers in the jth treatment.
                  i=1




.                                                     .   .    .    .   .     .
Notations 2

                  ∑
                  nj
      ▶   T·j =         Yij is the sum of the numbers in the jth treatment.
                  i=1
                  ∑k
      ▶   T·· =         T·j is the sum of all the numbers Yij .
                  j=1




.                                                      .    .     .   .   .   .
Notations 2

                  ∑
                  nj
      ▶   T·j =         Yij is the sum of the numbers in the jth treatment.
                  i=1
                  ∑k
      ▶   T·· =         T·j is the sum of all the numbers Yij .
                  j=1

                       1 ∑
                                 nj
                 T·j
      ▶   Y ·j =     =    ·     Yij is the sample mean from the jth
                 nj    nj
                            i=1
          treatment.




.                                                      .    .     .   .   .   .
Notations 2

                  ∑
                  nj
      ▶   T·j =         Yij is the sum of the numbers in the jth treatment.
                  i=1
                  ∑k
      ▶   T·· =         T·j is the sum of all the numbers Yij .
                  j=1

                         1 ∑
                               nj
                 T·j
      ▶   Y ·j =     =      ·     Yij is the sample mean from the jth
                 nj      nj
                              i=1
          treatment.
                 T··
      ▶   Y ·· =     is the average of all sample points.
                 n




.                                                      .    .     .   .   .   .
An example

      Treatment   A   B   C
        data:     1   6   9
                  3   5   8
                      1   7




.                             .   .   .   .   .   .
An example

      Treatment   A   B    C
        data:     1   6    9
                  3   5    8
                      1    7
        T·j       4   12   24   T·· = 40              totals
         nj       2   3    3     n=8               sample sizes
        Y ·j      2   4    8    Y ·· = 5            averages




.                                          .   .      .   .       .   .
An example

      Treatment   A   B    C
        data:     1   6    9
                  3   5    8
                      1    7
        T·j       4   12   24   T·· = 40              totals
         nj       2   3    3     n=8               sample sizes
        Y ·j      2   4    8    Y ·· = 5            averages
         Sj2      2   7    1                   sample variances




.                                          .   .      .   .       .   .
An example

      Treatment       A   B    C
        data:         1   6    9
                      3   5    8
                          1    7
         T·j          4   12   24   T·· = 40              totals
         nj           2   3    3     n=8               sample sizes
         Y ·j         2   4    8    Y ·· = 5            averages
         Sj2          2   7    1                   sample variances
      (nj −   1)Sj2   2   14   2    SSE = 18                  error




.                                              .   .      .       .   .   .
An example

       Treatment          A    B    C
           data:          1    6    9
                          3    5    8
                               1    7
            T·j           4    12   24    T·· = 40              totals
            nj            2    3    3      n=8               sample sizes
           Y ·j           2    4    8     Y ·· = 5            averages
            Sj2           2    7    1                    sample variances
       (nj −     1)Sj2    2    14   2    SSE = 18                   error
     nj (Y ·j − Y ·· )2   18   3    27   SSTR = 48            treatment


.                                                    .   .      .       .   .   .
The theory
      ▶   The theory of ANOVA is based on the model Yij = µj + ϵij ,
          where µj is the average effect (true mean) of treatment j and
          ϵij are independent normal variables ϵij ∼ N(0, σ 2 ).




.                                               .    .   .    .    .     .
The theory
      ▶   The theory of ANOVA is based on the model Yij = µj + ϵij ,
          where µj is the average effect (true mean) of treatment j and
          ϵij are independent normal variables ϵij ∼ N(0, σ 2 ).
      ▶   Equivalently, Yij ∼ N(µj , σ 2 ).




.                                               .    .   .    .    .     .
The theory
      ▶   The theory of ANOVA is based on the model Yij = µj + ϵij ,
          where µj is the average effect (true mean) of treatment j and
          ϵij are independent normal variables ϵij ∼ N(0, σ 2 ).
      ▶   Equivalently, Yij ∼ N(µj , σ 2 ).
      ▶   Let µ be the true mean of the total population:

                                              ∑
                                              k
                                                  nj µj
                                          j=1
                                     µ=                   .
                                                  n




.                                                             .   .   .   .   .   .
The theory
      ▶   The theory of ANOVA is based on the model Yij = µj + ϵij ,
          where µj is the average effect (true mean) of treatment j and
          ϵij are independent normal variables ϵij ∼ N(0, σ 2 ).
      ▶   Equivalently, Yij ∼ N(µj , σ 2 ).
      ▶   Let µ be the true mean of the total population:

                                              ∑
                                              k
                                                  nj µj
                                          j=1
                                     µ=                   .
                                                  n

          Then
                           (        )                         (      )
                                 σ2                               σ2
                   Y ·j ∼ N µj ,              and     Y ·· ∼ N µ,
                                 nj                               n

.                                                             .   .   .   .   .   .
Treatment sum of squares
                                ∑
                                k
                       SSTR =         nj (Y ·j − Y ·· )2
                                j=1
     When the treatments are different, the treatment sum of squares
     gets larger.




.                                                   .      .   .   .   .   .
Treatment sum of squares
                                   ∑
                                   k
                       SSTR =            nj (Y ·j − Y ·· )2
                                   j=1
     When the treatments are different, the treatment sum of squares
     gets larger.
     Theorem 1

                          ∑
                          k
                 SSTR =         nj (Y ·j − µ)2 − n(Y ·· − µ)2 .
                          j=1




.                                                      .      .   .   .   .   .
Treatment sum of squares
                                   ∑
                                   k
                       SSTR =            nj (Y ·j − Y ·· )2
                                   j=1
     When the treatments are different, the treatment sum of squares
     gets larger.
     Theorem 1

                          ∑
                          k
                 SSTR =         nj (Y ·j − µ)2 − n(Y ·· − µ)2 .
                          j=1


     Theorem 2

                                               ∑
                                               k
                 E (SSTR) = (k − 1)σ 2 +              nj (µj − µ)2 .
                                                j=1
.                                                       .     .    .   .   .   .
Proof of Theorem 2
     According to our model,

                    Y ·j ∼ N(µj , σ 2 /nj ),   Y ·· ∼ N(µ, σ 2 /n).

     Therefore,

                                                      σ2
                         E [(Y ·· − µ)2 ] = Var(Y ·· ) = ,
                                                      n
                                                      σ2
                         Var(Y ·j − µ) = Var(Y ·j ) =    .
                                                      nj

     The variance can also be computed using
     Var(X ) = E (X 2 ) − E (X )2 :

                  Var(Y ·j − µ)                         E (Y ·j − µ)2
                                  = E [(Y ·j − µ) ] −
                                                  2
                     σ 2 /nj                                (µj − µ)2
.                                                       .      .      .   .   .   .
Proof of Theorem 2: continue

     So
                                         σ2
                    E [(Y ·j − µ)2 ] =      + (µj − µ)2
                                         nj
     Therefore
                          ∑
             E (SSTR) =       nj E [(Y ·j − µ)2 ] − nE [(Y ·· − µ)2 ]
                          j
                          ∑     (                )
                              σ2                     σ2
                     =     nj      + (µj − µ) − n ·
                                               2
                               nj                    n
                        j
                              ∑
                     = kσ 2 +     nj (µj − µ)2 − σ 2
                                    j




.                                                   .     .    .        .   .   .
Sum of squares formula
     Example
          data vector    (Yij ) =   (1, 3; 6, 5, 1; 9, 8, 7)
                        (Y ·j ) =   (2, 2; 4, 4, 4; 8, 8, 8)




.                                           .     .     .      .   .   .
Sum of squares formula
     Example
          data vector          (Yij ) =    (1, 3; 6, 5, 1; 9, 8, 7)
                              (Y ·j ) =    (2, 2; 4, 4, 4; 8, 8, 8)
          error vector   (Yij − Y ·j ) =   (−1, 1; 2, 1, −3; 1, 0, −1)
                               (Y ·· ) =   (5, 5; 5, 5, 5; 5, 5, 5)




.                                                  .     .     .      .   .   .
Sum of squares formula
     Example
           data vector          (Yij ) =    (1, 3; 6, 5, 1; 9, 8, 7)
                               (Y ·j ) =    (2, 2; 4, 4, 4; 8, 8, 8)
          error vector   (Yij − Y ·j ) =    (−1, 1; 2, 1, −3; 1, 0, −1)
                                (Y ·· ) =   (5, 5; 5, 5, 5; 5, 5, 5)
      treatment vector   (Y ·j − Y ·· ) =   (−3, −3; −1, −1, −1; 3, 3, 3)




.                                                   .     .     .      .   .   .
Sum of squares formula
     Example
           data vector               (Yij ) =   (1, 3; 6, 5, 1; 9, 8, 7)
                                   (Y ·j ) =    (2, 2; 4, 4, 4; 8, 8, 8)
          error vector     (Yij − Y ·j ) =      (−1, 1; 2, 1, −3; 1, 0, −1)
                                    (Y ·· ) =   (5, 5; 5, 5, 5; 5, 5, 5)
      treatment vector    (Y ·j − Y ·· ) =      (−3, −3; −1, −1, −1; 3, 3, 3)

     Definitions
                          ∑                         ∑
                  SSE =          (Yij − Y ·j )2 =       (nj − 1)Sj2 .
                           i,j                      j
                                  ∑
                          SSTOT =  (Yij − Y ·· )2
                                          i,j

.                                                         .    .        .   .   .   .
Sum of squares identity
     Theorem

                            SSTOT = SSTR + SSE .
     This identity represents
            ∑                    ∑                   ∑
                (Yij − Y ·· )2 =   (Y ·j − Y ·· )2 +   (Yij − Y ·j )2 .
             i,j                 i,j                     i,j




.                                                    .         .   .   .   .   .
Sum of squares identity
     Theorem

                            SSTOT = SSTR + SSE .
     This identity represents
            ∑                    ∑                   ∑
                (Yij − Y ·· )2 =   (Y ·j − Y ·· )2 +   (Yij − Y ·j )2 .
             i,j                 i,j                     i,j



     Theorem
     Suppose that µ1 = µ2 = · · · = µk = µ is true. Then
                        SSTR                SSE
                             ∼ χ2 ,
                                k−1             ∼ χ2 .
                                                   n−k
                         σ2                  σ2
     Furthermore, SSTR and SSE are independent.
.                                                    .         .   .   .   .   .
Sum of squares identity
     Theorem

                            SSTOT = SSTR + SSE .
     This identity represents
            ∑                    ∑                   ∑
                (Yij − Y ·· )2 =   (Y ·j − Y ·· )2 +   (Yij − Y ·j )2 .
             i,j                 i,j                     i,j



     Theorem
     Suppose that µ1 = µ2 = · · · = µk = µ is true. Then
                        SSTR                SSE
                             ∼ χ2 ,
                                k−1             ∼ χ2 .
                                                   n−k
                         σ2                  σ2
     Furthermore, SSTR and SSE are independent.
.                                                    .         .   .   .   .   .
F test

     Theorem
     Under the same conditions,
                           SSTR/(k − 1)
                     F =                 ∼ Fk−1,n−k ,
                            SSE /(n − k)

     and the null hypotheses (µ1 = µ2 = · · · = µk = µ) should be
     rejected at the level α of significance if the test statistic

                            F ≥ F1−α,k−1,n−k .




.                                                .   .   .    .     .   .
Outline

     Basic ANOVA
        The Set-Up
        An Example
        The Model
        Treatment sum of squares SSTR
        More sum of squares

     An ANOVA F Test Example

     Comparing ANOVA F test with Kruskal-Wallis test



.                                             .   .    .   .   .   .
The problem


       k = 3 treatments           Drug A   Drug B         Drug C

       column #             j       1           2             3
       sample size          nj      7           8             10
       mean                Y ·j     80          88            90
       variance            Sj2     5.2          4.8           5.4

                     Are these drugs different?




.                                           .         .   .         .   .   .
Finding totals and averages
           treatment        Drug A   Drug B     Drug C

                 j            1        2             3
                nj            7        8            10
               Y ·j           80       88           90
          T·j = nj · Y ·j    560      704           900




.                                           .   .         .   .   .   .
Finding totals and averages
                   treatment            Drug A        Drug B       Drug C

                         j                    1          2              3
                        nj                    7          8             10
                       Y ·j               80             88            90
                  T·j = nj · Y ·j         560           704            900

     Therefore,                          ∑
                                 T·· =            T·j = 2164
                                          j

     and
                                       T··   2164
                              Y ·· =       =      = 86.56.
                                       n      25

.                                                              .   .         .   .   .   .
Finding SSTR and MSTR
           treatment             Drug A   Drug B     Drug C

                 j                 1        2              3
                nj                 7        8             10
               Y ·j                80       88            90
        nj · (Y ·j − Y ··   )2   301.24   16.59          118.34




.                                                .   .         .   .   .   .
Finding SSTR and MSTR
                    treatment                Drug A     Drug B      Drug C

                          j                     1          2              3
                         nj                     7          8             10
                        Y ·j                   80          88            90
                 nj · (Y ·j − Y ··   )2      301.24      16.59          118.34

    Therefore,
                                ∑
                     SSTR =               nj · (Y ·j − Y ·· )2 = 436.16.
                                     j




.                                                               .   .         .   .   .   .
Finding SSTR and MSTR
                    treatment                Drug A     Drug B      Drug C

                          j                     1          2              3
                         nj                     7          8             10
                        Y ·j                   80          88            90
                 nj · (Y ·j − Y ··   )2      301.24      16.59          118.34

    Therefore,
                                ∑
                     SSTR =               nj · (Y ·j − Y ·· )2 = 436.16.
                                     j

    The number of degrees of freedom of SSTR is k − 1 = 2. So
                                         SSTR   436.16
                      MSTR =                  =        = 218.08.
                                         k −1     2
.                                                               .   .         .   .   .   .
Finding SSE and MSE
          treatment       Drug A   Drug B      Drug C

              nj            7        8              10
              Sj2          5.2      4.8             5.4
         (nj − 1) · Sj2    31.2     33.6        48.6




.                                          .    .         .   .   .   .
Finding SSE and MSE
                  treatment       Drug A   Drug B      Drug C

                      nj            7         8             10
                      Sj2          5.2       4.8            5.4
                 (nj − 1) · Sj2    31.2     33.6        48.6
     The sum of squared error (SSE) measures random errors and
     variability of data. It tells us nothing about the treatments.




.                                                  .    .         .   .   .   .
Finding SSE and MSE
                  treatment           Drug A   Drug B      Drug C

                      nj                7        8              10
                      Sj2              5.2      4.8             5.4
                 (nj − 1) · Sj2        31.2     33.6        48.6
     The sum of squared error (SSE) measures random errors and
     variability of data. It tells us nothing about the treatments.
                                 ∑
                        SSE =        (nj − 1) · Sj2 = 113.4.
                                  j




.                                                      .    .         .   .   .   .
Finding SSE and MSE
                  treatment           Drug A   Drug B      Drug C

                      nj                7         8             10
                      Sj2              5.2       4.8            5.4
                 (nj − 1) · Sj2        31.2     33.6        48.6
     The sum of squared error (SSE) measures random errors and
     variability of data. It tells us nothing about the treatments.
                                 ∑
                        SSE =        (nj − 1) · Sj2 = 113.4.
                                  j
                                  ∑
     The degree of freedom is         (nj − 1) = n − k = 22,
                                  j




.                                                      .    .         .   .   .   .
Finding SSE and MSE
                  treatment           Drug A   Drug B      Drug C

                      nj                7        8              10
                      Sj2              5.2      4.8             5.4
                 (nj − 1) · Sj2        31.2     33.6        48.6
     The sum of squared error (SSE) measures random errors and
     variability of data. It tells us nothing about the treatments.
                                 ∑
                        SSE =        (nj − 1) · Sj2 = 113.4.
                                  j
                                  ∑
     The degree of freedom is         (nj − 1) = n − k = 22, and the mean
                                  j
     squared error (MSE) is
                                  SSE   113.4
                       MSE =          =       = 5.15.
                                  n−k    22
.                                                      .    .         .   .   .   .
ANOVA, F test
     ▶   The test statistic is
                      SSTR/(k − 1)    MSTR   218.08
                F =                 =      =        = 42.3.
                       SSE /(n − k)   MSE     5.15




.                                            .   .   .   .    .   .
ANOVA, F test
     ▶   The test statistic is
                      SSTR/(k − 1)    MSTR   218.08
                F =                 =      =        = 42.3.
                       SSE /(n − k)   MSE     5.15

     ▶   In ANOVA the F test is always right-tailed.




.                                               .      .   .   .   .   .
ANOVA, F test
     ▶   The test statistic is
                      SSTR/(k − 1)    MSTR   218.08
                F =                 =      =        = 42.3.
                       SSE /(n − k)   MSE     5.15

     ▶   In ANOVA the F test is always right-tailed.
     ▶   When the test statistic F is large, we conclude that there is a
         significant difference between the drugs.




.                                                .     .   .    .    .     .
ANOVA, F test
     ▶   The test statistic is
                      SSTR/(k − 1)    MSTR   218.08
                F =                 =      =        = 42.3.
                       SSE /(n − k)   MSE     5.15

     ▶   In ANOVA the F test is always right-tailed.
     ▶   When the test statistic F is large, we conclude that there is a
         significant difference between the drugs. This is because the
         numerator measures the difference between the treatments,
         and the denominator measures the mean variability of data.




.                                                .     .   .    .    .     .
ANOVA, F test
     ▶   The test statistic is
                      SSTR/(k − 1)    MSTR   218.08
                F =                 =      =        = 42.3.
                       SSE /(n − k)   MSE     5.15

     ▶   In ANOVA the F test is always right-tailed.
     ▶   When the test statistic F is large, we conclude that there is a
         significant difference between the drugs. This is because the
         numerator measures the difference between the treatments,
         and the denominator measures the mean variability of data.
     ▶   The critical value is F1−α,k−1,n−k = F0.95,2,22 = 3.44.




.                                                 .    .   .       .   .   .
ANOVA, F test
     ▶   The test statistic is
                      SSTR/(k − 1)    MSTR   218.08
                F =                 =      =        = 42.3.
                       SSE /(n − k)   MSE     5.15

     ▶   In ANOVA the F test is always right-tailed.
     ▶   When the test statistic F is large, we conclude that there is a
         significant difference between the drugs. This is because the
         numerator measures the difference between the treatments,
         and the denominator measures the mean variability of data.
     ▶   The critical value is F1−α,k−1,n−k = F0.95,2,22 = 3.44.
     ▶   Since the test statistic is much larger than the critical value,
         we reject H0 and conclude that the drugs are different. But
         we don’t know if they make people better or worse!
.                                                  .    .    .     .   .    .
Summary of results

     The traditional way to summarize the results is by the following
     chart with either the critical F value or the p-value in the last
     column.

             Souce         SS      df    MS       F                p
          Treatment      436.16    2    218.08   42.3       2.9 × 10−8
             Error        113.4   22     5.15
             Total       549.56   24




.                                                 .     .      .       .   .   .
Summary of results

     The traditional way to summarize the results is by the following
     chart with either the critical F value or the p-value in the last
     column.

             Souce         SS      df    MS       F                p
          Treatment      436.16    2    218.08   42.3       2.9 × 10−8
             Error        113.4   22     5.15
             Total       549.56   24

     The conclusion is that at least one of the drugs is different from
     the other two.



.                                                 .     .      .       .   .   .
Summary of results

     The traditional way to summarize the results is by the following
     chart with either the critical F value or the p-value in the last
     column.

             Souce         SS      df    MS       F                p
          Treatment      436.16    2    218.08   42.3       2.9 × 10−8
             Error        113.4   22     5.15
             Total       549.56   24

     The conclusion is that at least one of the drugs is different from
     the other two. We need to do additional tests to see which one is
     different.


.                                                 .     .      .       .   .   .
Outline

     Basic ANOVA
        The Set-Up
        An Example
        The Model
        Treatment sum of squares SSTR
        More sum of squares

     An ANOVA F Test Example

     Comparing ANOVA F test with Kruskal-Wallis test



.                                             .   .    .   .   .   .
ANOVA F test
    In planning for future staffing, the ages of 19 hospital staff
    members were analyzed. Three groups (nurses, doctors, and x-ray
    techs) were chosen. At α = 0.05 , can it be concluded that the
    average ages of the three groups differ? (See Excel workbook:
    Chapter 12.)




.                                             .    .   .    .   .     .
ANOVA F test
    In planning for future staffing, the ages of 19 hospital staff
    members were analyzed. Three groups (nurses, doctors, and x-ray
    techs) were chosen. At α = 0.05 , can it be concluded that the
    average ages of the three groups differ? (See Excel workbook:
    Chapter 12.)

         Souce         SS      df    MS       F             p
       Treatment    1190.48    2    595.24   5.96   0.0116 × 10−8
         Error      1598.05   16    99.88
         Total      2788.53   18




.                                              .    .   .       .   .   .
ANOVA F test
    In planning for future staffing, the ages of 19 hospital staff
    members were analyzed. Three groups (nurses, doctors, and x-ray
    techs) were chosen. At α = 0.05 , can it be concluded that the
    average ages of the three groups differ? (See Excel workbook:
    Chapter 12.)

         Souce          SS      df     MS       F             p
       Treatment     1190.48     2   595.24   5.96   0.0116 × 10−8
          Error      1598.05    16    99.88
          Total      2788.53    18

    Since F is big (or, p-value is small), we reject H0 and conclude
    that the average ages of the three groups differ.

.                                                .   .    .       .    .   .
Kruskal-Wallis test

     We could also work out this problem using the nonparametric
     Kruskal-Wallis test.
     The Kruskal-Wallis statistic is

                        12      ∑ Rj2
                                k
                  B=          ·       − 3(n + 1) = 6.63
                     n(n + 1)     nj
                                  j=1

     and the critical value

                          χ2          2
                           1−α,k−1 = χ0.95,2 = 5.99.

     So we reject H0 and conclude that the average ages of the three
     groups differ.


.                                                .     .   .   .   .   .

More Related Content

What's hot

Chapter 5 experimental design for sbh
Chapter 5 experimental design for sbhChapter 5 experimental design for sbh
Chapter 5 experimental design for sbh
Rione Drevale
 
Standard Scores
Standard ScoresStandard Scores
Standard Scores
shoffma5
 

What's hot (20)

Elements of inferential statistics
Elements of inferential statisticsElements of inferential statistics
Elements of inferential statistics
 
Understanding the Z- score (Application on evaluating a Learner`s performance)
Understanding the Z- score (Application on evaluating a Learner`s performance)Understanding the Z- score (Application on evaluating a Learner`s performance)
Understanding the Z- score (Application on evaluating a Learner`s performance)
 
ITEM ANALYSIS.pptx
ITEM ANALYSIS.pptxITEM ANALYSIS.pptx
ITEM ANALYSIS.pptx
 
Z test asia
Z test asiaZ test asia
Z test asia
 
Measures of Variability
Measures of VariabilityMeasures of Variability
Measures of Variability
 
Statistics
StatisticsStatistics
Statistics
 
Comparing means
Comparing meansComparing means
Comparing means
 
Z scores
Z scoresZ scores
Z scores
 
Practice Test Chapter 6 (Normal Probability Distributions)
Practice Test Chapter 6 (Normal Probability Distributions)Practice Test Chapter 6 (Normal Probability Distributions)
Practice Test Chapter 6 (Normal Probability Distributions)
 
Significance test
Significance testSignificance test
Significance test
 
Regression & correlation coefficient
Regression & correlation coefficientRegression & correlation coefficient
Regression & correlation coefficient
 
Chapter 5 experimental design for sbh
Chapter 5 experimental design for sbhChapter 5 experimental design for sbh
Chapter 5 experimental design for sbh
 
The two sample t-test
The two sample t-testThe two sample t-test
The two sample t-test
 
Probability
ProbabilityProbability
Probability
 
Application of statistical tests in Biomedical Research .pptx
Application of statistical tests in Biomedical Research .pptxApplication of statistical tests in Biomedical Research .pptx
Application of statistical tests in Biomedical Research .pptx
 
Chi-square, Yates, Fisher & McNemar
Chi-square, Yates, Fisher & McNemarChi-square, Yates, Fisher & McNemar
Chi-square, Yates, Fisher & McNemar
 
Standard Scores
Standard ScoresStandard Scores
Standard Scores
 
Hypergeometric Distribution
Hypergeometric DistributionHypergeometric Distribution
Hypergeometric Distribution
 
Inferential Statistics
Inferential StatisticsInferential Statistics
Inferential Statistics
 
Anova (f test) and mean differentiation
Anova (f test) and mean differentiationAnova (f test) and mean differentiation
Anova (f test) and mean differentiation
 

Viewers also liked

Bus b272 f unit 1
Bus b272 f unit 1Bus b272 f unit 1
Bus b272 f unit 1
kocho2
 
Anova n metaanalysis
Anova n metaanalysisAnova n metaanalysis
Anova n metaanalysis
utpal sharma
 
Experimental design data analysis
Experimental design data analysisExperimental design data analysis
Experimental design data analysis
metalkid132
 
9. basic concepts_of_one_way_analysis_of_variance_(anova)
9. basic concepts_of_one_way_analysis_of_variance_(anova)9. basic concepts_of_one_way_analysis_of_variance_(anova)
9. basic concepts_of_one_way_analysis_of_variance_(anova)
Irfan Hussain
 
Data Analysis with SPSS : One-way ANOVA
Data Analysis with SPSS : One-way ANOVAData Analysis with SPSS : One-way ANOVA
Data Analysis with SPSS : One-way ANOVA
Dr Ali Yusob Md Zain
 

Viewers also liked (20)

Analysis of variance (ANOVA)
Analysis of variance (ANOVA)Analysis of variance (ANOVA)
Analysis of variance (ANOVA)
 
Reporting a one-way anova
Reporting a one-way anovaReporting a one-way anova
Reporting a one-way anova
 
Statr session 19 and 20
Statr session 19 and 20Statr session 19 and 20
Statr session 19 and 20
 
Bus b272 f unit 1
Bus b272 f unit 1Bus b272 f unit 1
Bus b272 f unit 1
 
Manova dalam spss
Manova dalam spssManova dalam spss
Manova dalam spss
 
Anova n metaanalysis
Anova n metaanalysisAnova n metaanalysis
Anova n metaanalysis
 
Oneway ANOVA - Overview
Oneway ANOVA - OverviewOneway ANOVA - Overview
Oneway ANOVA - Overview
 
Experimental design data analysis
Experimental design data analysisExperimental design data analysis
Experimental design data analysis
 
9. basic concepts_of_one_way_analysis_of_variance_(anova)
9. basic concepts_of_one_way_analysis_of_variance_(anova)9. basic concepts_of_one_way_analysis_of_variance_(anova)
9. basic concepts_of_one_way_analysis_of_variance_(anova)
 
In Anova
In  AnovaIn  Anova
In Anova
 
Presentasi uji manova
Presentasi uji manovaPresentasi uji manova
Presentasi uji manova
 
SAS 0412
SAS 0412SAS 0412
SAS 0412
 
Data analysis with spss anova
Data analysis with spss anovaData analysis with spss anova
Data analysis with spss anova
 
Analysis of variance anova
Analysis of variance anovaAnalysis of variance anova
Analysis of variance anova
 
Manova
ManovaManova
Manova
 
Manova
ManovaManova
Manova
 
Two-Way ANOVA Overview & SPSS interpretation
Two-Way ANOVA Overview & SPSS interpretationTwo-Way ANOVA Overview & SPSS interpretation
Two-Way ANOVA Overview & SPSS interpretation
 
What is a Factorial ANOVA?
What is a Factorial ANOVA?What is a Factorial ANOVA?
What is a Factorial ANOVA?
 
Data Analysis with SPSS : One-way ANOVA
Data Analysis with SPSS : One-way ANOVAData Analysis with SPSS : One-way ANOVA
Data Analysis with SPSS : One-way ANOVA
 
Anova ppt
Anova pptAnova ppt
Anova ppt
 

Similar to Introduction to Anova

Causal Inference Opening Workshop - New Statistical Learning Methods for Esti...
Causal Inference Opening Workshop - New Statistical Learning Methods for Esti...Causal Inference Opening Workshop - New Statistical Learning Methods for Esti...
Causal Inference Opening Workshop - New Statistical Learning Methods for Esti...
The Statistical and Applied Mathematical Sciences Institute
 

Similar to Introduction to Anova (10)

Introduction and crd
Introduction and crdIntroduction and crd
Introduction and crd
 
ANOVA Lec 1 (alternate).pptx
ANOVA Lec 1 (alternate).pptxANOVA Lec 1 (alternate).pptx
ANOVA Lec 1 (alternate).pptx
 
ANOVA.pdf
ANOVA.pdfANOVA.pdf
ANOVA.pdf
 
One Way ANOVA.pdf
One Way ANOVA.pdfOne Way ANOVA.pdf
One Way ANOVA.pdf
 
95720357 a-design-of-experiments
95720357 a-design-of-experiments95720357 a-design-of-experiments
95720357 a-design-of-experiments
 
Causal Inference Opening Workshop - New Statistical Learning Methods for Esti...
Causal Inference Opening Workshop - New Statistical Learning Methods for Esti...Causal Inference Opening Workshop - New Statistical Learning Methods for Esti...
Causal Inference Opening Workshop - New Statistical Learning Methods for Esti...
 
Causal Effect Inference with Deep Latent-Variable Models
Causal Effect Inference with Deep Latent-Variable ModelsCausal Effect Inference with Deep Latent-Variable Models
Causal Effect Inference with Deep Latent-Variable Models
 
Anova statistics
Anova statisticsAnova statistics
Anova statistics
 
Norsminde 2009
Norsminde 2009Norsminde 2009
Norsminde 2009
 
ANOVA BY IIT MADRAS.pdf
ANOVA BY IIT MADRAS.pdfANOVA BY IIT MADRAS.pdf
ANOVA BY IIT MADRAS.pdf
 

More from Ji Li (8)

Data science in_action
Data science in_actionData science in_action
Data science in_action
 
Preferred Parking Perplexity
Preferred Parking PerplexityPreferred Parking Perplexity
Preferred Parking Perplexity
 
Proof with Crayon
Proof with CrayonProof with Crayon
Proof with Crayon
 
Time Value of Money
Time Value of MoneyTime Value of Money
Time Value of Money
 
Arithmetic Product of Species
Arithmetic Product of SpeciesArithmetic Product of Species
Arithmetic Product of Species
 
Not Only About Mathematics Tutoring
Not Only About Mathematics TutoringNot Only About Mathematics Tutoring
Not Only About Mathematics Tutoring
 
Bi-Point-Determining Graphs
Bi-Point-Determining GraphsBi-Point-Determining Graphs
Bi-Point-Determining Graphs
 
Thesis Defense of Ji Li
Thesis Defense of Ji LiThesis Defense of Ji Li
Thesis Defense of Ji Li
 

Recently uploaded

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
ssuserdda66b
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 

Recently uploaded (20)

Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 

Introduction to Anova

  • 1. ANOVA Ji Li April 24, 2012 . . . . . . .
  • 2. The Basic Idea We want to determine if different “treatments” have different effects by comparing two different measures of variability of data to determine how much of the variation of data is random and how much is due to the treatment. . . . . . . .
  • 3. Outline Basic ANOVA The Set-Up An Example The Model Treatment sum of squares SSTR More sum of squares An ANOVA F Test Example Comparing ANOVA F test with Kruskal-Wallis test . . . . . . .
  • 4. The Hypotheses ▶ We have data divided into k categories called “treatments.” The word “treatment” refers to application of chemicals or other methods to improve crop yield on pieces of land. . . . . . . .
  • 5. The Hypotheses ▶ We have data divided into k categories called “treatments.” The word “treatment” refers to application of chemicals or other methods to improve crop yield on pieces of land. ▶ For the jth treatment, we obtain numbers Y1j , Y2j , . . . , Ynj which indicate how well the jth treatment worked to improve crop output, or how well the jth drug worked for the patients who took it. . . . . . . .
  • 6. The Hypotheses ▶ We have data divided into k categories called “treatments.” The word “treatment” refers to application of chemicals or other methods to improve crop yield on pieces of land. ▶ For the jth treatment, we obtain numbers Y1j , Y2j , . . . , Ynj which indicate how well the jth treatment worked to improve crop output, or how well the jth drug worked for the patients who took it. ▶ We test H0 : µ1 = µ2 = · · · = µk versus H1 : not all the µj ’s are equal . . . . . . .
  • 7. Notations 1 ▶ k = number of treatments. For example, we want to test the effectiveness of k drugs. . . . . . . .
  • 8. Notations 1 ▶ k = number of treatments. For example, we want to test the effectiveness of k drugs. ▶ nj = size of sample from the jth treatment. . . . . . . .
  • 9. Notations 1 ▶ k = number of treatments. For example, we want to test the effectiveness of k drugs. ▶ nj = size of sample from the jth treatment. ∑k ▶ n= nj is the total number of sample points. j=1 . . . . . . .
  • 10. Notations 1 ▶ k = number of treatments. For example, we want to test the effectiveness of k drugs. ▶ nj = size of sample from the jth treatment. ∑k ▶ n= nj is the total number of sample points. j=1 ▶ Yij = ith sample point from jth treatment. . . . . . . .
  • 11. Notations 2 ∑ nj ▶ T·j = Yij is the sum of the numbers in the jth treatment. i=1 . . . . . . .
  • 12. Notations 2 ∑ nj ▶ T·j = Yij is the sum of the numbers in the jth treatment. i=1 ∑k ▶ T·· = T·j is the sum of all the numbers Yij . j=1 . . . . . . .
  • 13. Notations 2 ∑ nj ▶ T·j = Yij is the sum of the numbers in the jth treatment. i=1 ∑k ▶ T·· = T·j is the sum of all the numbers Yij . j=1 1 ∑ nj T·j ▶ Y ·j = = · Yij is the sample mean from the jth nj nj i=1 treatment. . . . . . . .
  • 14. Notations 2 ∑ nj ▶ T·j = Yij is the sum of the numbers in the jth treatment. i=1 ∑k ▶ T·· = T·j is the sum of all the numbers Yij . j=1 1 ∑ nj T·j ▶ Y ·j = = · Yij is the sample mean from the jth nj nj i=1 treatment. T·· ▶ Y ·· = is the average of all sample points. n . . . . . . .
  • 15. An example Treatment A B C data: 1 6 9 3 5 8 1 7 . . . . . . .
  • 16. An example Treatment A B C data: 1 6 9 3 5 8 1 7 T·j 4 12 24 T·· = 40 totals nj 2 3 3 n=8 sample sizes Y ·j 2 4 8 Y ·· = 5 averages . . . . . . .
  • 17. An example Treatment A B C data: 1 6 9 3 5 8 1 7 T·j 4 12 24 T·· = 40 totals nj 2 3 3 n=8 sample sizes Y ·j 2 4 8 Y ·· = 5 averages Sj2 2 7 1 sample variances . . . . . . .
  • 18. An example Treatment A B C data: 1 6 9 3 5 8 1 7 T·j 4 12 24 T·· = 40 totals nj 2 3 3 n=8 sample sizes Y ·j 2 4 8 Y ·· = 5 averages Sj2 2 7 1 sample variances (nj − 1)Sj2 2 14 2 SSE = 18 error . . . . . . .
  • 19. An example Treatment A B C data: 1 6 9 3 5 8 1 7 T·j 4 12 24 T·· = 40 totals nj 2 3 3 n=8 sample sizes Y ·j 2 4 8 Y ·· = 5 averages Sj2 2 7 1 sample variances (nj − 1)Sj2 2 14 2 SSE = 18 error nj (Y ·j − Y ·· )2 18 3 27 SSTR = 48 treatment . . . . . . .
  • 20. The theory ▶ The theory of ANOVA is based on the model Yij = µj + ϵij , where µj is the average effect (true mean) of treatment j and ϵij are independent normal variables ϵij ∼ N(0, σ 2 ). . . . . . . .
  • 21. The theory ▶ The theory of ANOVA is based on the model Yij = µj + ϵij , where µj is the average effect (true mean) of treatment j and ϵij are independent normal variables ϵij ∼ N(0, σ 2 ). ▶ Equivalently, Yij ∼ N(µj , σ 2 ). . . . . . . .
  • 22. The theory ▶ The theory of ANOVA is based on the model Yij = µj + ϵij , where µj is the average effect (true mean) of treatment j and ϵij are independent normal variables ϵij ∼ N(0, σ 2 ). ▶ Equivalently, Yij ∼ N(µj , σ 2 ). ▶ Let µ be the true mean of the total population: ∑ k nj µj j=1 µ= . n . . . . . . .
  • 23. The theory ▶ The theory of ANOVA is based on the model Yij = µj + ϵij , where µj is the average effect (true mean) of treatment j and ϵij are independent normal variables ϵij ∼ N(0, σ 2 ). ▶ Equivalently, Yij ∼ N(µj , σ 2 ). ▶ Let µ be the true mean of the total population: ∑ k nj µj j=1 µ= . n Then ( ) ( ) σ2 σ2 Y ·j ∼ N µj , and Y ·· ∼ N µ, nj n . . . . . . .
  • 24. Treatment sum of squares ∑ k SSTR = nj (Y ·j − Y ·· )2 j=1 When the treatments are different, the treatment sum of squares gets larger. . . . . . . .
  • 25. Treatment sum of squares ∑ k SSTR = nj (Y ·j − Y ·· )2 j=1 When the treatments are different, the treatment sum of squares gets larger. Theorem 1 ∑ k SSTR = nj (Y ·j − µ)2 − n(Y ·· − µ)2 . j=1 . . . . . . .
  • 26. Treatment sum of squares ∑ k SSTR = nj (Y ·j − Y ·· )2 j=1 When the treatments are different, the treatment sum of squares gets larger. Theorem 1 ∑ k SSTR = nj (Y ·j − µ)2 − n(Y ·· − µ)2 . j=1 Theorem 2 ∑ k E (SSTR) = (k − 1)σ 2 + nj (µj − µ)2 . j=1 . . . . . . .
  • 27. Proof of Theorem 2 According to our model, Y ·j ∼ N(µj , σ 2 /nj ), Y ·· ∼ N(µ, σ 2 /n). Therefore, σ2 E [(Y ·· − µ)2 ] = Var(Y ·· ) = , n σ2 Var(Y ·j − µ) = Var(Y ·j ) = . nj The variance can also be computed using Var(X ) = E (X 2 ) − E (X )2 : Var(Y ·j − µ) E (Y ·j − µ)2 = E [(Y ·j − µ) ] − 2 σ 2 /nj (µj − µ)2 . . . . . . .
  • 28. Proof of Theorem 2: continue So σ2 E [(Y ·j − µ)2 ] = + (µj − µ)2 nj Therefore ∑ E (SSTR) = nj E [(Y ·j − µ)2 ] − nE [(Y ·· − µ)2 ] j ∑ ( ) σ2 σ2 = nj + (µj − µ) − n · 2 nj n j ∑ = kσ 2 + nj (µj − µ)2 − σ 2 j . . . . . . .
  • 29. Sum of squares formula Example data vector (Yij ) = (1, 3; 6, 5, 1; 9, 8, 7) (Y ·j ) = (2, 2; 4, 4, 4; 8, 8, 8) . . . . . . .
  • 30. Sum of squares formula Example data vector (Yij ) = (1, 3; 6, 5, 1; 9, 8, 7) (Y ·j ) = (2, 2; 4, 4, 4; 8, 8, 8) error vector (Yij − Y ·j ) = (−1, 1; 2, 1, −3; 1, 0, −1) (Y ·· ) = (5, 5; 5, 5, 5; 5, 5, 5) . . . . . . .
  • 31. Sum of squares formula Example data vector (Yij ) = (1, 3; 6, 5, 1; 9, 8, 7) (Y ·j ) = (2, 2; 4, 4, 4; 8, 8, 8) error vector (Yij − Y ·j ) = (−1, 1; 2, 1, −3; 1, 0, −1) (Y ·· ) = (5, 5; 5, 5, 5; 5, 5, 5) treatment vector (Y ·j − Y ·· ) = (−3, −3; −1, −1, −1; 3, 3, 3) . . . . . . .
  • 32. Sum of squares formula Example data vector (Yij ) = (1, 3; 6, 5, 1; 9, 8, 7) (Y ·j ) = (2, 2; 4, 4, 4; 8, 8, 8) error vector (Yij − Y ·j ) = (−1, 1; 2, 1, −3; 1, 0, −1) (Y ·· ) = (5, 5; 5, 5, 5; 5, 5, 5) treatment vector (Y ·j − Y ·· ) = (−3, −3; −1, −1, −1; 3, 3, 3) Definitions ∑ ∑ SSE = (Yij − Y ·j )2 = (nj − 1)Sj2 . i,j j ∑ SSTOT = (Yij − Y ·· )2 i,j . . . . . . .
  • 33. Sum of squares identity Theorem SSTOT = SSTR + SSE . This identity represents ∑ ∑ ∑ (Yij − Y ·· )2 = (Y ·j − Y ·· )2 + (Yij − Y ·j )2 . i,j i,j i,j . . . . . . .
  • 34. Sum of squares identity Theorem SSTOT = SSTR + SSE . This identity represents ∑ ∑ ∑ (Yij − Y ·· )2 = (Y ·j − Y ·· )2 + (Yij − Y ·j )2 . i,j i,j i,j Theorem Suppose that µ1 = µ2 = · · · = µk = µ is true. Then SSTR SSE ∼ χ2 , k−1 ∼ χ2 . n−k σ2 σ2 Furthermore, SSTR and SSE are independent. . . . . . . .
  • 35. Sum of squares identity Theorem SSTOT = SSTR + SSE . This identity represents ∑ ∑ ∑ (Yij − Y ·· )2 = (Y ·j − Y ·· )2 + (Yij − Y ·j )2 . i,j i,j i,j Theorem Suppose that µ1 = µ2 = · · · = µk = µ is true. Then SSTR SSE ∼ χ2 , k−1 ∼ χ2 . n−k σ2 σ2 Furthermore, SSTR and SSE are independent. . . . . . . .
  • 36. F test Theorem Under the same conditions, SSTR/(k − 1) F = ∼ Fk−1,n−k , SSE /(n − k) and the null hypotheses (µ1 = µ2 = · · · = µk = µ) should be rejected at the level α of significance if the test statistic F ≥ F1−α,k−1,n−k . . . . . . . .
  • 37. Outline Basic ANOVA The Set-Up An Example The Model Treatment sum of squares SSTR More sum of squares An ANOVA F Test Example Comparing ANOVA F test with Kruskal-Wallis test . . . . . . .
  • 38. The problem k = 3 treatments Drug A Drug B Drug C column # j 1 2 3 sample size nj 7 8 10 mean Y ·j 80 88 90 variance Sj2 5.2 4.8 5.4 Are these drugs different? . . . . . . .
  • 39. Finding totals and averages treatment Drug A Drug B Drug C j 1 2 3 nj 7 8 10 Y ·j 80 88 90 T·j = nj · Y ·j 560 704 900 . . . . . . .
  • 40. Finding totals and averages treatment Drug A Drug B Drug C j 1 2 3 nj 7 8 10 Y ·j 80 88 90 T·j = nj · Y ·j 560 704 900 Therefore, ∑ T·· = T·j = 2164 j and T·· 2164 Y ·· = = = 86.56. n 25 . . . . . . .
  • 41. Finding SSTR and MSTR treatment Drug A Drug B Drug C j 1 2 3 nj 7 8 10 Y ·j 80 88 90 nj · (Y ·j − Y ·· )2 301.24 16.59 118.34 . . . . . . .
  • 42. Finding SSTR and MSTR treatment Drug A Drug B Drug C j 1 2 3 nj 7 8 10 Y ·j 80 88 90 nj · (Y ·j − Y ·· )2 301.24 16.59 118.34 Therefore, ∑ SSTR = nj · (Y ·j − Y ·· )2 = 436.16. j . . . . . . .
  • 43. Finding SSTR and MSTR treatment Drug A Drug B Drug C j 1 2 3 nj 7 8 10 Y ·j 80 88 90 nj · (Y ·j − Y ·· )2 301.24 16.59 118.34 Therefore, ∑ SSTR = nj · (Y ·j − Y ·· )2 = 436.16. j The number of degrees of freedom of SSTR is k − 1 = 2. So SSTR 436.16 MSTR = = = 218.08. k −1 2 . . . . . . .
  • 44. Finding SSE and MSE treatment Drug A Drug B Drug C nj 7 8 10 Sj2 5.2 4.8 5.4 (nj − 1) · Sj2 31.2 33.6 48.6 . . . . . . .
  • 45. Finding SSE and MSE treatment Drug A Drug B Drug C nj 7 8 10 Sj2 5.2 4.8 5.4 (nj − 1) · Sj2 31.2 33.6 48.6 The sum of squared error (SSE) measures random errors and variability of data. It tells us nothing about the treatments. . . . . . . .
  • 46. Finding SSE and MSE treatment Drug A Drug B Drug C nj 7 8 10 Sj2 5.2 4.8 5.4 (nj − 1) · Sj2 31.2 33.6 48.6 The sum of squared error (SSE) measures random errors and variability of data. It tells us nothing about the treatments. ∑ SSE = (nj − 1) · Sj2 = 113.4. j . . . . . . .
  • 47. Finding SSE and MSE treatment Drug A Drug B Drug C nj 7 8 10 Sj2 5.2 4.8 5.4 (nj − 1) · Sj2 31.2 33.6 48.6 The sum of squared error (SSE) measures random errors and variability of data. It tells us nothing about the treatments. ∑ SSE = (nj − 1) · Sj2 = 113.4. j ∑ The degree of freedom is (nj − 1) = n − k = 22, j . . . . . . .
  • 48. Finding SSE and MSE treatment Drug A Drug B Drug C nj 7 8 10 Sj2 5.2 4.8 5.4 (nj − 1) · Sj2 31.2 33.6 48.6 The sum of squared error (SSE) measures random errors and variability of data. It tells us nothing about the treatments. ∑ SSE = (nj − 1) · Sj2 = 113.4. j ∑ The degree of freedom is (nj − 1) = n − k = 22, and the mean j squared error (MSE) is SSE 113.4 MSE = = = 5.15. n−k 22 . . . . . . .
  • 49. ANOVA, F test ▶ The test statistic is SSTR/(k − 1) MSTR 218.08 F = = = = 42.3. SSE /(n − k) MSE 5.15 . . . . . . .
  • 50. ANOVA, F test ▶ The test statistic is SSTR/(k − 1) MSTR 218.08 F = = = = 42.3. SSE /(n − k) MSE 5.15 ▶ In ANOVA the F test is always right-tailed. . . . . . . .
  • 51. ANOVA, F test ▶ The test statistic is SSTR/(k − 1) MSTR 218.08 F = = = = 42.3. SSE /(n − k) MSE 5.15 ▶ In ANOVA the F test is always right-tailed. ▶ When the test statistic F is large, we conclude that there is a significant difference between the drugs. . . . . . . .
  • 52. ANOVA, F test ▶ The test statistic is SSTR/(k − 1) MSTR 218.08 F = = = = 42.3. SSE /(n − k) MSE 5.15 ▶ In ANOVA the F test is always right-tailed. ▶ When the test statistic F is large, we conclude that there is a significant difference between the drugs. This is because the numerator measures the difference between the treatments, and the denominator measures the mean variability of data. . . . . . . .
  • 53. ANOVA, F test ▶ The test statistic is SSTR/(k − 1) MSTR 218.08 F = = = = 42.3. SSE /(n − k) MSE 5.15 ▶ In ANOVA the F test is always right-tailed. ▶ When the test statistic F is large, we conclude that there is a significant difference between the drugs. This is because the numerator measures the difference between the treatments, and the denominator measures the mean variability of data. ▶ The critical value is F1−α,k−1,n−k = F0.95,2,22 = 3.44. . . . . . . .
  • 54. ANOVA, F test ▶ The test statistic is SSTR/(k − 1) MSTR 218.08 F = = = = 42.3. SSE /(n − k) MSE 5.15 ▶ In ANOVA the F test is always right-tailed. ▶ When the test statistic F is large, we conclude that there is a significant difference between the drugs. This is because the numerator measures the difference between the treatments, and the denominator measures the mean variability of data. ▶ The critical value is F1−α,k−1,n−k = F0.95,2,22 = 3.44. ▶ Since the test statistic is much larger than the critical value, we reject H0 and conclude that the drugs are different. But we don’t know if they make people better or worse! . . . . . . .
  • 55. Summary of results The traditional way to summarize the results is by the following chart with either the critical F value or the p-value in the last column. Souce SS df MS F p Treatment 436.16 2 218.08 42.3 2.9 × 10−8 Error 113.4 22 5.15 Total 549.56 24 . . . . . . .
  • 56. Summary of results The traditional way to summarize the results is by the following chart with either the critical F value or the p-value in the last column. Souce SS df MS F p Treatment 436.16 2 218.08 42.3 2.9 × 10−8 Error 113.4 22 5.15 Total 549.56 24 The conclusion is that at least one of the drugs is different from the other two. . . . . . . .
  • 57. Summary of results The traditional way to summarize the results is by the following chart with either the critical F value or the p-value in the last column. Souce SS df MS F p Treatment 436.16 2 218.08 42.3 2.9 × 10−8 Error 113.4 22 5.15 Total 549.56 24 The conclusion is that at least one of the drugs is different from the other two. We need to do additional tests to see which one is different. . . . . . . .
  • 58. Outline Basic ANOVA The Set-Up An Example The Model Treatment sum of squares SSTR More sum of squares An ANOVA F Test Example Comparing ANOVA F test with Kruskal-Wallis test . . . . . . .
  • 59. ANOVA F test In planning for future staffing, the ages of 19 hospital staff members were analyzed. Three groups (nurses, doctors, and x-ray techs) were chosen. At α = 0.05 , can it be concluded that the average ages of the three groups differ? (See Excel workbook: Chapter 12.) . . . . . . .
  • 60. ANOVA F test In planning for future staffing, the ages of 19 hospital staff members were analyzed. Three groups (nurses, doctors, and x-ray techs) were chosen. At α = 0.05 , can it be concluded that the average ages of the three groups differ? (See Excel workbook: Chapter 12.) Souce SS df MS F p Treatment 1190.48 2 595.24 5.96 0.0116 × 10−8 Error 1598.05 16 99.88 Total 2788.53 18 . . . . . . .
  • 61. ANOVA F test In planning for future staffing, the ages of 19 hospital staff members were analyzed. Three groups (nurses, doctors, and x-ray techs) were chosen. At α = 0.05 , can it be concluded that the average ages of the three groups differ? (See Excel workbook: Chapter 12.) Souce SS df MS F p Treatment 1190.48 2 595.24 5.96 0.0116 × 10−8 Error 1598.05 16 99.88 Total 2788.53 18 Since F is big (or, p-value is small), we reject H0 and conclude that the average ages of the three groups differ. . . . . . . .
  • 62. Kruskal-Wallis test We could also work out this problem using the nonparametric Kruskal-Wallis test. The Kruskal-Wallis statistic is 12 ∑ Rj2 k B= · − 3(n + 1) = 6.63 n(n + 1) nj j=1 and the critical value χ2 2 1−α,k−1 = χ0.95,2 = 5.99. So we reject H0 and conclude that the average ages of the three groups differ. . . . . . . .