doe ch 3 rel

Upload: kishanvora

Post on 03-Jun-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/11/2019 doe ch 3 rel

    1/22

    Single Factor Experiments

    Topic:

    Comparison of more than 2 groups

    One-Way Analysis of Variance

    F test

    Learning Aims:Understand model parametrization

    Carry out an anova

    Reason: Multiple t tests wont do!

    . 1/22

  • 8/11/2019 doe ch 3 rel

    2/22

    Potatoe scab

    widespread disease

    causes economic loss

    known factors: variety, soil condition

    . 2/22

  • 8/11/2019 doe ch 3 rel

    3/22

    Experiment with different treatments

    Compare 7 treatments for effectiveness inreducing scab

    Field with 32 plots, 100 potatoes are randomlysampled from each plot

    For each potatoe the percentage of the surfacearea affected was recorded. Response variable isthe average of the 100 percentages.

    . 3/22

  • 8/11/2019 doe ch 3 rel

    4/22

  • 8/11/2019 doe ch 3 rel

    5/22

    1-Factor Design

    Plots, subjects

    Randomisation

    Group 1 Group 2 . . . Group I

    . . .

    . 5/22

  • 8/11/2019 doe ch 3 rel

    6/22

    Complete Randomisation

    a) number the plots 1, . . ., 32.

    b) construct a vector with 8 replicates of 1 and 4replicates of 2 to 7.

    c) choose a random permutation and apply it to thevector in b).

    in R:

    > treatment=factor(c(rep(1,8),rep(2:7,each=4)))

    > sample(treatment)

    . 6/22

  • 8/11/2019 doe ch 3 rel

    7/22

    Exploratory data analysis

    Group y y

    1 12 10 24 29 30 18 32 26 22.625

    2 9 9 16 4 9.5

    3 16 10 18 18 15.5

    4 10 4 4 5 5.755 30 7 21 9 16.75

    6 18 24 12 19 18.25

    7 17 7 16 17 14.25

    . 7/22

  • 8/11/2019 doe ch 3 rel

    8/22

    Graphical display

    1 2 3 4 5 6 7

    5

    10

    15

    20

    25

    30

    Treatment

    y

    1 2 3 4 5 6 7

    5

    10

    15

    20

    25

    30

    Treatment

    y

    . 8/22

  • 8/11/2019 doe ch 3 rel

    9/22

    Two sample t tests

    Group 1 Group 2 : H0:1 =2Group 1 Group 3 : H0:1 =3

    Group 1 Group 4 : H0:1 =4Group 1 Group 5 : H0:1 =5Group 1 Group 6 : H0:1 =6

    Group 1 Group 7 : H0:1 =7. . .

    = 5%,P(Test not significant |H0) = 95%7 groups, 21 independent tests:P(none of the tests sign. |H0) = 0.9521 = 0.34P(at least one test sign. |H0) = 0.66 (more realistic: 0.42)

    1 (1 )n

    . 9/22

  • 8/11/2019 doe ch 3 rel

    10/22

    Bonferroni correction

    ChooseTsuch that

    1 (1 T)n

    =E= 5%

    (T =testwise,E= experimentwise)

    Since1 (1 n)n , the significance level for asingle test has to be divided by the number of tests.

    Overcorrection, not very efficient.

    . 10/22

  • 8/11/2019 doe ch 3 rel

    11/22

    Analysis of variance

    Comparison of more than 2 groups

    for more complex designs

    global F test

    Idea:

    total variability

    in data=

    source of

    variation 1+

    source of

    variation 2+ . . .

    Comparison of components

    total = treatment + experimental error

    total = variability of plots with + variability of plots with

    different treatments the same treatment

    2

    +treatment effect 2

    . 11/22

  • 8/11/2019 doe ch 3 rel

    12/22

    Definitions

    Factor: categorical, explanatory variableLevel: value of a factor

    Ex 1: Factor= soil treatment, 7 levels 1 7.= One-way analysis of varianceEx 2: 3 varieties with 4 quantities of fertilizer

    = Two-way analysis of varianceTreatment: combination of factor levels

    Plot, experimental unit: smallest unit to which a

    treatment can be appliedEx: feeding (chicken, chicken-houses), dentalmedicine (families, people, teeth)

    . 12/22

  • 8/11/2019 doe ch 3 rel

    13/22

    One-way analysis of variance

    Model:

    response = treatment + error (Plot)

    Yij = + Ai + ij(1)

    i=1,...,I;j=1,...,Ji

    =overall meanAi=ith treatment effectij =random error, N(0, 2)iid.

    . 13/22

  • 8/11/2019 doe ch 3 rel

    14/22

    Illustration of model (1)

    0.

    05

    0.

    10

    0.

    15

    0.

    20

    0.

    25

    0.

    30

    o ooo o oo o oo o o oo ooo oo o oo o ooooo oo o o ooo oo oo o

    +A1 +A2 +A3 +A4

    . 14/22

  • 8/11/2019 doe ch 3 rel

    15/22

    Necessary constraint

    Model (1) is overparametrized, a restriction is needed.

    usual constraint:JiAi= 0,

    Ai= 0ifJi=Jfor alli

    Ai denotes the deviation from overall mean.

    A1= 0, resp.AI= 0First (or last) group is reference group.

    . 15/22

    Decomposition of the deviation of a

  • 8/11/2019 doe ch 3 rel

    16/22

    Decomposition of the deviation of a

    response from the overall mean

    yij y..= yi. y..

    + yij yi.

    deviation of deviation from

    the group mean the group mean

    yi.= 1Ji

    jyij mean of groupi,

    y..= 1N

    i

    jyij overall mean,N=

    Ji.

    . 16/22

  • 8/11/2019 doe ch 3 rel

    17/22

    Analysis of variance identity

    i

    j

    (yij y..)2

    total variability

    =i

    j

    (yi. y..)2

    variability between groups

    +i

    j

    (yij yi.)2

    variability within groups

    total sum = treatment sum + residual sum

    of squares of squares of squares

    SStot = SStreat + SSres

    . 17/22

  • 8/11/2019 doe ch 3 rel

    18/22

    Mean squares

    Total mean square: M Stot=SStot/(N 1)Residual mean square: M Sres =SSres/(N I)

    SSresN I

    =

    i(Ji 1)S

    2i

    i(Ji 1) , S2i =

    j(yij yi.)

    2

    Ji 1

    M Sres = 2 = V ar(Yij), E(M Sres) =

    2

    Treatment mean square: M Streat=SStreat/(I 1)

    E(M Streat) =2 +

    JiA

    2i /(I 1)

    dftot=dftreat+ dfres, N 1 =I 1 + N I

    . 18/22

  • 8/11/2019 doe ch 3 rel

    19/22

    F test

    H0: allAi= 0

    HA: at least oneAi= 0

    Sinceij N(0, 2),F =MStreatMSres

    has underH0 anF

    distribution withI 1andN Idegrees of freedom.

    one-sided test:rejectH0 ifF > F95%,I1,NI

    . 19/22

  • 8/11/2019 doe ch 3 rel

    20/22

    Chisquare and t distribution

    LetZ1, . . . , Z n N(0, 1),iid. Then

    X=Z21 + Z

    22 + + Z

    2n

    has a2 distribution withndf,X 2n

    LetZ N(0, 1)andX 2

    n be independentrandom variables. The distribution of

    T = Z

    X/nis called thetdistribution withndf,T tn

    . 20/22

  • 8/11/2019 doe ch 3 rel

    21/22

    F distribution

    LetX1 2n andX2 2m be independent random

    variables. The distribution of

    F = X1/n

    X2/m

    is called theFdistribution withnandmdf,F Fn,m

    Properties: F1,m=t2mE(Fn,m) =

    mm2

    . 21/22

  • 8/11/2019 doe ch 3 rel

    22/22

    R: anova table

    > mod1=aov(ytreatment,data=scab)

    > summary(mod1)

    Df Sum Sq Mean Sq F value Pr(>F)

    treatment 6 972.34 162.06 3.608 0.0103 *

    Residuals 25 1122.88 44.92

    F test is significant, there are significant treatmentdifferences.

    . 22/22