18
McGraw-Hill/Irwin Copyright © 2009 by The McGraw-Hill Companies, Inc. Two Two - - Sample Hypothesis Sample Hypothesis Testing Testing Chapter 11 11 11 Overview of ANOVA One-Factor ANOVA Multiple Comparisons Tests for Homogeneity of Variances Two-Factor ANOVA Without Replication Two-Factor ANOVA With Replication General Linear Model Experimental Design: An Overview 11-2 Overview of ANOVA Overview of ANOVA Analysis of variance (ANOVA) is a Analysis of variance (ANOVA) is a comparison of means. comparison of means. ANOVA allows you to compare more ANOVA allows you to compare more than two means simultaneously. than two means simultaneously. Proper experimental design efficiently Proper experimental design efficiently uses limited data to draw the strongest uses limited data to draw the strongest possible inferences. possible inferences. 11-3 Overview of ANOVA Overview of ANOVA The Goal: Explaining Variation The Goal: Explaining Variation ANOVA seeks to identify sources of ANOVA seeks to identify sources of variation in a numerical variation in a numerical dependent dependent variable variable Y Y (the (the response response variable). variable). Variation in Variation in Y Y about its mean is explained about its mean is explained by one or more categorical by one or more categorical independent independent variables (the variables (the factors factors ) or is unexplained ) or is unexplained (random error (random error ). ). 11-4 Overview of ANOVA Overview of ANOVA The Goal: Explaining Variation The Goal: Explaining Variation Each possible value of a factor or combination Each possible value of a factor or combination of factors is a of factors is a treatment treatment . . We test to see if each factor has a significant We test to see if each factor has a significant effect on effect on Y Y using (for example) the hypotheses: using (for example) the hypotheses: H H 0 0 : : µ µ 1 1 = = µ µ 2 2 = = µ µ 3 3 = = µ µ 4 4 H H 1 1 : Not all the means are equal : Not all the means are equal The test uses the The test uses the F F distribution. distribution. If we cannot reject If we cannot reject H H 0 0 , we conclude that , we conclude that observations within each treatment have a observations within each treatment have a common mean common mean µ µ . .

Two-Sample Hypothesis Testing 11 One-Factor ANOVA (Completely Randomized Design) • When F is near zero, then there is little difference among treatments and we would not expect to

  • Upload
    dodang

  • View
    215

  • Download
    2

Embed Size (px)

Citation preview

McGraw-Hill/Irwin Copyright © 2009 by The McGraw-Hill Companies, Inc.

TwoTwo--Sample Hypothesis Sample Hypothesis Testing Testing

Chapter111111

Overview of ANOVAOne-Factor ANOVA

Multiple ComparisonsTests for Homogeneity of Variances

Two-Factor ANOVA Without Replication Two-Factor ANOVA With Replication

General Linear ModelExperimental Design: An Overview

11-2

Overview of ANOVAOverview of ANOVA

•• Analysis of variance (ANOVA) is a Analysis of variance (ANOVA) is a comparison of means.comparison of means.

•• ANOVA allows you to compare more ANOVA allows you to compare more than two means simultaneously.than two means simultaneously.

•• Proper experimental design efficiently Proper experimental design efficiently uses limited data to draw the strongest uses limited data to draw the strongest possible inferences.possible inferences.

11-3

Overview of ANOVAOverview of ANOVA

The Goal: Explaining VariationThe Goal: Explaining Variation•• ANOVA seeks to identify sources of ANOVA seeks to identify sources of

variation in a numerical variation in a numerical dependentdependent variable variable YY (the (the responseresponse variable).variable).

•• Variation in Variation in YY about its mean is explained about its mean is explained by one or more categorical by one or more categorical independentindependentvariables (the variables (the factorsfactors) or is unexplained ) or is unexplained (random error(random error).).

11-4

Overview of ANOVAOverview of ANOVA

The Goal: Explaining VariationThe Goal: Explaining Variation•• Each possible value of a factor or combination Each possible value of a factor or combination

of factors is a of factors is a treatmenttreatment..•• We test to see if each factor has a significant We test to see if each factor has a significant

effect on effect on YY using (for example) the hypotheses:using (for example) the hypotheses:HH00: : µµ11 = = µµ22 = = µµ33 = = µµ44HH11: Not all the means are equal: Not all the means are equal

•• The test uses the The test uses the FF distribution.distribution.•• If we cannot reject If we cannot reject HH00, we conclude that , we conclude that

observations within each treatment have a observations within each treatment have a common mean common mean µµ..

11-5

Overview of ANOVAOverview of ANOVA

OneOne--Factor ANOVAFactor ANOVA

Figure 11.211-6

Overview of ANOVAOverview of ANOVA

The Goal: Explaining VariationThe Goal: Explaining Variation•• For example, a oneFor example, a one--factor ANOVA would test factor ANOVA would test

the hypothesis that the length of hospital stay the hypothesis that the length of hospital stay (LOS) is affected by Type of Fracture:(LOS) is affected by Type of Fracture:Length of stay = Length of stay = ff(type(type of fracture)of fracture)

•• A twoA two--factor ANOVA would test the hypothesis factor ANOVA would test the hypothesis that the length of hospital stay (LOS) is that the length of hospital stay (LOS) is affected by Type of Fracture and Age Group:affected by Type of Fracture and Age Group:Length of stay = Length of stay = ff(type(type of fracture, age group)of fracture, age group)

•• We can also test for interaction between We can also test for interaction between factors.factors.

11-7

Overview of ANOVAOverview of ANOVA

The Goal: Explaining VariationThe Goal: Explaining Variation

Figure 11.3

11-8

Overview of ANOVAOverview of ANOVA

ANOVA AssumptionsANOVA Assumptions•• Analysis of Variance assumes that theAnalysis of Variance assumes that the

-- observations on observations on YY are independent,are independent,-- populations being sampled are normal,populations being sampled are normal,-- populations being sampled have equal populations being sampled have equal

variances.variances.•• ANOVA is somewhat robust to departures ANOVA is somewhat robust to departures

from normality and equal variance from normality and equal variance assumptions.assumptions.

11-9

Overview of ANOVAOverview of ANOVA

ANOVA CalculationsANOVA Calculations•• Software (e.g., Excel, Software (e.g., Excel, MegaStatMegaStat, MINITAB, , MINITAB,

SPSS) is used to analyze data. SPSS) is used to analyze data. •• Large samples increase the power of the Large samples increase the power of the

test, test, but power also depends on the degree of but power also depends on the degree of variation in variation in YY..

•• Lowest power would be in a small sample Lowest power would be in a small sample with high variation in with high variation in Y.Y.

11-10

OneOne--Factor ANOVAFactor ANOVA(Completely Randomized Design)(Completely Randomized Design)

•• A oneA one--factor ANOVA only compares the means factor ANOVA only compares the means of of cc groups (groups (treatments treatments oror factor levelsfactor levels).).

•• Consider the format for a oneConsider the format for a one--factor ANOVA factor ANOVA with with cc treatments, denoted treatments, denoted AA11, A, A22, , ……, A, Acc

Data FormatData Format

Table 11.1

11-11

OneOne--Factor ANOVAFactor ANOVA(Completely Randomized Design)(Completely Randomized Design)

•• Sample sizes within each treatment do Sample sizes within each treatment do notnotneed to be equal (i.e., balanced).need to be equal (i.e., balanced).

•• The total number of observations is equal The total number of observations is equal to to nn = = nn11 + n+ n2 2 + + …… + + nncc

Data FormatData Format

•• HH00: : µµ11 = = µµ22 = = …… = = µµccHH11: Not all the means are equal: Not all the means are equal

•• ANOVA tests all means simultaneously and ANOVA tests all means simultaneously and so does not inflate the type I error.so does not inflate the type I error.

Hypothesis to Be TestedHypothesis to Be Tested

11-12

OneOne--Factor ANOVAFactor ANOVA(Completely Randomized Design)(Completely Randomized Design)

•• An equivalent way to express the oneAn equivalent way to express the one--factor model is to say that treatment factor model is to say that treatment jj came came from a population with a common mean (from a population with a common mean (µµ) ) plus a treatment effect (plus a treatment effect (AAjj) plus random ) plus random error (error (εεijij):):

yyijij = = µµ + + AAjj + + εεijijjj = 1, 2, = 1, 2, ……, , cc and and ii = 1, 2, = 1, 2, ……, , nn

•• Random error is assumed to be normally Random error is assumed to be normally distributed with zero mean and the same distributed with zero mean and the same variance for all treatments.variance for all treatments.

OneOne--Factor ANOVA as a Linear ModelFactor ANOVA as a Linear Model

11-13

OneOne--Factor ANOVAFactor ANOVA(Completely Randomized Design)(Completely Randomized Design)

•• A fixed effects model only looks at what A fixed effects model only looks at what happens to the response for particular happens to the response for particular levels of the factor.levels of the factor.

HH00: : AA11 = = AA22 = = …… = = AAc c = 0= 0HH11: Not all : Not all AAjj are zeroare zero

•• If the If the HH00 is true, then the ANOVA model is true, then the ANOVA model collapses to collapses to yyijij = = µµ + + εεijij

OneOne--Factor ANOVA as a Linear ModelFactor ANOVA as a Linear Model

11-14

OneOne--Factor ANOVAFactor ANOVA(Completely Randomized Design)(Completely Randomized Design)

•• The mean of each group is calculated asThe mean of each group is calculated asGroup MeansGroup Means

•• The overall sample mean (grand mean) can The overall sample mean (grand mean) can be calculated asbe calculated as

11-15

OneOne--Factor ANOVAFactor ANOVA(Completely Randomized Design)(Completely Randomized Design)

•• For a given observation For a given observation yyijij, the following , the following relationship must holdrelationship must hold

Partitioned Sum of SquaresPartitioned Sum of Squares

((yyijij –– y y ) = () = (yyjj –– y y ) + ) + ((yyijij –– yyjj ))•• WhereWhere

((yyijij –– y y ) = ) = deviation of an observation from deviation of an observation from the grand mean the grand mean

((yyjj –– y y ) = ) = deviation of the column mean from deviation of the column mean from the grand mean (the grand mean (between treatmentsbetween treatments) )

((yyijij –– yyjj ) = ) = deviation of the observation from its deviation of the observation from its own column mean (own column mean (within treatmentswithin treatments).).

11-16

OneOne--Factor ANOVAFactor ANOVA(Completely Randomized Design)(Completely Randomized Design)

•• This relationship is true for sums of This relationship is true for sums of squared deviations, yielding squared deviations, yielding partitioned partitioned sum of squaressum of squares::

Partitioned Sum of SquaresPartitioned Sum of Squares

•• Simply put, Simply put, SSTSST = = SSA SSA ++ SSESSE

11-17

OneOne--Factor ANOVAFactor ANOVA(Completely Randomized Design)(Completely Randomized Design)

•• SSASSA and and SSESSE are used to test the are used to test the hypothesis of equal treatment means by hypothesis of equal treatment means by dividing each sum of squares by it degrees dividing each sum of squares by it degrees of freedom to adjust for group size. of freedom to adjust for group size.

•• These ratios are called Mean Squares (These ratios are called Mean Squares (MSAMSAand and MSEMSE).).

•• The resulting test statistic is The resulting test statistic is FF = = MSA/MSEMSA/MSE..

Partitioned Sum of SquaresPartitioned Sum of Squares

11-18

OneOne--Factor ANOVAFactor ANOVA(Completely Randomized Design)(Completely Randomized Design)

Partitioned Sum of SquaresPartitioned Sum of Squares

Table 11.2

11-19

OneOne--Factor ANOVAFactor ANOVA(Completely Randomized Design)(Completely Randomized Design)

•• Use ExcelUse Excel’’s ones one--factor ANOVA (Tools > factor ANOVA (Tools > Data Analysis) to analyze data.Data Analysis) to analyze data.

Partitioned Sum of SquaresPartitioned Sum of Squares

Figure 11.5

11-20

OneOne--Factor ANOVAFactor ANOVA(Completely Randomized Design)(Completely Randomized Design)

•• The The FF distribution describes the ratio of two distribution describes the ratio of two variances.variances.

•• The The FF statistic is the ratio of the variance statistic is the ratio of the variance due to treatments (due to treatments (MSAMSA) to the variance ) to the variance due to error (due to error (MSEMSE))..

Test StatisticTest Statistic

11-21

OneOne--Factor ANOVAFactor ANOVA(Completely Randomized Design)(Completely Randomized Design)

•• When When FF is near zero, then there is little is near zero, then there is little difference among treatments and we would difference among treatments and we would not expect to reject the hypothesis of equal not expect to reject the hypothesis of equal treatment means.treatment means.

Test StatisticTest Statistic

•• FF cannot be negative has no upper limit.cannot be negative has no upper limit.•• For ANOVA, the For ANOVA, the FF test is a righttest is a right--tailed test.tailed test.•• Use Appendix F or Excel to obtain the Use Appendix F or Excel to obtain the

critical value of critical value of FF for a given for a given α.α.

Decision RuleDecision Rule

11-22

OneOne--Factor ANOVAFactor ANOVA(Completely Randomized Design)(Completely Randomized Design)

Decision Rule for an FDecision Rule for an F--testtest

Figure 11.6

11-23

OneOne--Factor ANOVAFactor ANOVA(Completely Randomized Design)(Completely Randomized Design)

•• Step 1: State the hypothesesStep 1: State the hypothesesHH00: : µµ11 = = µµ22 = = …… = = µµccHH11: Not all the means are equal: Not all the means are equal

•• Step 2: State the decision ruleStep 2: State the decision ruleThe degrees of freedom for the critical value The degrees of freedom for the critical value FFareare

Numerator: Numerator: d.fd.f. = . = cc –– 1 (between treatments)1 (between treatments)Denominator: Denominator: d.fd.f. = . = nn –– cc (within treatments)(within treatments)

For the given For the given αα, obtain the critical value from , obtain the critical value from Appendix F or Excel.Appendix F or Excel.

Steps in Performing OneSteps in Performing One--Factor ANOVAFactor ANOVA

11-24

OneOne--Factor ANOVAFactor ANOVA(Completely Randomized Design)(Completely Randomized Design)

•• For example,For example,Steps in Performing OneSteps in Performing One--Factor ANOVAFactor ANOVA

Figure 11.8

11-25

OneOne--Factor ANOVAFactor ANOVA(Completely Randomized Design)(Completely Randomized Design)

•• Step 3: Perform the CalculationsStep 3: Perform the CalculationsUse Excel to perform the calculations. For Use Excel to perform the calculations. For example, here are the results of an ANOVA:example, here are the results of an ANOVA:

Steps in Performing OneSteps in Performing One--Factor ANOVAFactor ANOVA

Figure 11.9

11-26

OneOne--Factor ANOVAFactor ANOVA(Completely Randomized Design)(Completely Randomized Design)

•• Step 4: Make the DecisionStep 4: Make the DecisionReject Reject HH00 if the critical value if the critical value FF exceeds the exceeds the test statistic test statistic FFαα or if the or if the pp--value given by value given by Excel is Excel is << αα. .

•• MegaStatMegaStat and MINITAB can also be used to and MINITAB can also be used to perform the ANOVA.perform the ANOVA.

Steps in Performing OneSteps in Performing One--Factor ANOVAFactor ANOVA

11-27

Multiple Comparison TestsMultiple Comparison Tests

•• After rejecting the hypothesis of equal mean, After rejecting the hypothesis of equal mean, we naturally want to know we naturally want to know –– Which means Which means differ significantly?differ significantly?

•• In order to maintain the desired overall In order to maintain the desired overall probability of type I error, a probability of type I error, a simultaneous simultaneous confidence intervalconfidence interval for the difference of means for the difference of means must be obtained. must be obtained.

•• For For cc groups, there are groups, there are cc((cc –– 1) distinct pairs of 1) distinct pairs of means to be compared.means to be compared.

•• These types of comparisons are called These types of comparisons are called Multiple Multiple Comparison TestsComparison Tests..

TukeyTukey’’ss TestTest

11-28

Multiple Comparison TestsMultiple Comparison Tests

•• TukeyTukey’’ss studentizedstudentized range testrange test (or (or HSDHSD for for ““honestly significant differencehonestly significant difference”” test) is a test) is a multiple comparison test that has good power multiple comparison test that has good power and is widely used.and is widely used.

•• Named for statistician John Wilder Named for statistician John Wilder TukeyTukey(1915 (1915 –– 2000)2000)

•• This test is not available in ExcelThis test is not available in Excel’’s Tools > s Tools > Data Analysis but is available in Data Analysis but is available in MegaStatMegaStat..

TukeyTukey’’ss TestTest

11-29

Multiple Comparison TestsMultiple Comparison Tests

•• TukeyTukey’’ss is a twois a two--tailed test for equality of tailed test for equality of paired means from paired means from cc groups compared groups compared simultaneously.simultaneously.

•• The hypotheses are:The hypotheses are:H0: µj = µkH1: µj ≠ µk

TukeyTukey’’ss TestTest

11-30

Multiple Comparison TestsMultiple Comparison Tests

•• The decision rule is:The decision rule is:TukeyTukey’’ss TestTest

Reject Reject HH00 if if TTcalccalc==||yyjj –– yykk||

MSEMSE 11 + + 11nnjj nnkk

> > TTcc,, n n −−cc

•• Where Where TTc,nc,n−−cc is a critical value based on the is a critical value based on the studentizedstudentized rangerange for the desired for the desired αα..

11-31

Multiple Comparison TestsMultiple Comparison Tests

•• Here is a table critical values based on the Here is a table critical values based on the upper 5% of upper 5% of studentizedstudentized range:range:

TukeyTukey’’ss TestTest

Table shows studentizedrange divided by √2 to obtain Tc,n-c. See R. E. Lund and J. R. Lund, “Probabilities and Upper Quantiles for the Studentized Range,”Applied Statistics 32 (1983),pp. 204–210.

11-32

Tests for Homogeneity of VariancesTests for Homogeneity of Variances

•• ANOVA assumes that observations on the ANOVA assumes that observations on the response variable are from normally response variable are from normally distributed populations that have the same distributed populations that have the same variance.variance.

•• The oneThe one--factor ANOVA test is only slightly factor ANOVA test is only slightly affected by inequality of variance when affected by inequality of variance when group sizes are equal.group sizes are equal.

•• Test this assumption of homogeneous Test this assumption of homogeneous variances, using Hartleyvariances, using Hartley’’s s FFmaxmax Test.Test.

ANOVA AssumptionsANOVA Assumptions

11-33

Tests for Homogeneity of VariancesTests for Homogeneity of Variances

•• Named for H.O. Hartley (1912 Named for H.O. Hartley (1912 –– 1980).1980).•• The hypotheses areThe hypotheses are

HH00: : σσ1122 = = σσ22

22 = = …… = = σσcc22

HH11: Not all the : Not all the σσjj22 are equalare equal

•• The test statistic is the ratio of the largest The test statistic is the ratio of the largest sample variance to the smallest sample sample variance to the smallest sample variancevariance

HartleyHartley’’s s FFmaxmax TestTest

FFmaxmax = = ssmaxmax

22

ssminmin22

11-34

Tests for Homogeneity of VariancesTests for Homogeneity of Variances

•• Assuming equal Assuming equal group sizes, group sizes, critical values of critical values of FFmaxmax are found are found using degrees using degrees of freedomof freedom

HartleyHartley’’s s FFmaxmax TestTest

Numerator df1 = cDenominator

df2 = n/c - 1

11-35

Tests for Homogeneity of VariancesTests for Homogeneity of Variances

•• LeveneLevene’’ss test is a more robust alternative test is a more robust alternative to Hartleyto Hartley’’s s FFmaxmax test.test.

•• LeveneLevene’’ss test does not assume a normal test does not assume a normal distribution.distribution.

•• It is based on the distances of the It is based on the distances of the observations from their sample observations from their sample mediansmediansrather than their sample rather than their sample means.means.

•• A computer program (e.g., MINITAB) is A computer program (e.g., MINITAB) is needed to perform this test.needed to perform this test.

LeveneLevene’’ss TestTest

11-36

TwoTwo--Factor ANOVA Without Factor ANOVA Without Replication (Randomized Block)Replication (Randomized Block)

•• In a twoIn a two--factor ANOVA without replication factor ANOVA without replication ((nonrepeatednonrepeated measures design) each factor is measures design) each factor is observed exactly once.observed exactly once.

•• The data are represented in an The data are represented in an rr rows by rows by cccolumns matrix.columns matrix.

•• The mean of The mean of YY can be computed either across can be computed either across the rows or down the columns. the rows or down the columns.

Data FormatData Format

•• The grand mean The grand mean yy is the sum of all data values is the sum of all data values divided by the sample size divided by the sample size nn = = rcrc..

11-37

TwoTwo--Factor ANOVA Without Factor ANOVA Without Replication (Randomized Block)Replication (Randomized Block)

Data FormatData Format

Table 11.7

11-38

TwoTwo--Factor ANOVA Without Factor ANOVA Without Replication (Randomized Block)Replication (Randomized Block)

TwoTwo--Factor ANOVA ModelFactor ANOVA Model•• Expressed in linear form:Expressed in linear form:

yjk = µ + Aj + Bk + εjk

Where Where yjk = observed data value in row j and column kµ = common mean for all treatmentsAj = effect of row factor A (j = 1, 2, …, r)Bk = effect of column factor B (k = 1, 2, …, c)εjk = random error (normally distributed, zero

mean, same variance for all treatments)

11-39

TwoTwo--Factor ANOVA Without Factor ANOVA Without Replication (Randomized Block)Replication (Randomized Block)

Hypotheses to Be TestedHypotheses to Be Tested•• FixedFixed--effects model:effects model:

Factor Factor AA (row factor effect)(row factor effect)HH00: : AA11 = = AA22 = = …… = = AArr = 0= 0HH11: Not all the : Not all the AAjj are equal to zeroare equal to zero

Factor Factor BB (column factor effect)(column factor effect)HH00: : BB11 = = BB22 = = …… = = BBcc = 0= 0HH11: Not all the : Not all the BBkk are equal to zeroare equal to zero

•• If we fail to reject either If we fail to reject either HH00, then the model , then the model reduces to: reduces to: yjk = µ + εjk

11-40

TwoTwo--Factor ANOVA Without Factor ANOVA Without Replication (Randomized Block)Replication (Randomized Block)

Randomized Block ModelRandomized Block Model•• In this model, only one factor is of interest and In this model, only one factor is of interest and

the other factor is used to reduce variance.the other factor is used to reduce variance.•• The column effects are The column effects are treatmentstreatments (the (the

variable of interest).variable of interest).•• The row effects are called The row effects are called blocksblocks..•• Subjects within each block are randomly Subjects within each block are randomly

assigned to the treatments.assigned to the treatments.•• Computations are the same as a twoComputations are the same as a two--factor factor

ANOVA but interpretation resembles a oneANOVA but interpretation resembles a one--factor ANOVA.factor ANOVA.

11-41

TwoTwo--Factor ANOVA Without Factor ANOVA Without Replication (Randomized Block)Replication (Randomized Block)

Randomized Block ModelRandomized Block Model•• For example, let four types of fertilizer be For example, let four types of fertilizer be

the treatment and three soil types be the the treatment and three soil types be the block.block.

•• The data would be arranged as follows: The data would be arranged as follows:

Table 11.8

11-42

TwoTwo--Factor ANOVA Without Factor ANOVA Without Replication (Randomized Block)Replication (Randomized Block)

Format of Calculations of Format of Calculations of NonreplicatedNonreplicatedTwoTwo--Factor ANOVAFactor ANOVA

Table 11.9

11-43

TwoTwo--Factor ANOVA Without Factor ANOVA Without Replication (Randomized Block)Replication (Randomized Block)

•• Step 1: State the hypothesesStep 1: State the hypothesesFactor Factor AA (row factor effect)(row factor effect)

HH00: : AA11 = = AA22 = = AA33 = 0= 0HH11: Not all the : Not all the AAjj are equal to zeroare equal to zero

Factor Factor BB (column factor effect)(column factor effect)HH00: : BB11 = = BB22 = = BB33 = = BB44 = 0= 0HH11: Not all the : Not all the BBkk are equal to zeroare equal to zero

Steps in Performing TwoSteps in Performing Two--Factor ANOVAFactor ANOVA

11-44

TwoTwo--Factor ANOVA Without Factor ANOVA Without Replication (Randomized Block)Replication (Randomized Block)

•• Step 2: State the decision ruleStep 2: State the decision ruleThe degrees of freedom for the critical values The degrees of freedom for the critical values FF areare

Factor Factor AA: df: df11 = = rr –– 1 1 Factor Factor BB: df: df11 = = c c –– 11Error: dfError: df2 2 = (= (r r –– 1)(1)(cc –– 1)1)

For the given For the given αα and appropriate degrees of and appropriate degrees of freedom, obtain the critical values from freedom, obtain the critical values from Appendix F or Excel.Appendix F or Excel.

Steps in Performing TwoSteps in Performing Two--Factor ANOVAFactor ANOVA

11-45

TwoTwo--Factor ANOVA Without Factor ANOVA Without Replication (Randomized Block)Replication (Randomized Block)

•• Step 3: Perform the CalculationsStep 3: Perform the CalculationsUse Excel to perform the calculations. For Use Excel to perform the calculations. For example, example,

Steps in Performing TwoSteps in Performing Two--Factor ANOVAFactor ANOVA

Figure 11.1811-46

TwoTwo--Factor ANOVA Without Factor ANOVA Without Replication (Randomized Block)Replication (Randomized Block)

•• Step 4: Make the DecisionStep 4: Make the DecisionReject the null hypothesis if the Reject the null hypothesis if the FF test test exceeds the critical value or if the exceeds the critical value or if the pp--value is value is << αα..

Steps in Performing TwoSteps in Performing Two--Factor ANOVAFactor ANOVA

11-47

TwoTwo--Factor ANOVA Without Factor ANOVA Without Replication (Randomized Block)Replication (Randomized Block)

•• You can use You can use TukeyTukey’’ss simultaneous simultaneous comparisons of the treatment pairs using a comparisons of the treatment pairs using a pooled variance.pooled variance.For example,For example,

Multiple ComparisonsMultiple Comparisons

Figure 11.20

11-48

TwoTwo--Factor ANOVA With Replication Factor ANOVA With Replication (Full Factorial Model)(Full Factorial Model)

•• In this model, each factor is observed In this model, each factor is observed mmtimes, with an equal number of times, with an equal number of observations in each cell (balanced data). observations in each cell (balanced data).

•• Now we can test the factors (main effects) Now we can test the factors (main effects) and also an and also an interaction effectinteraction effect..

•• This model is called a This model is called a Full Factorial Full Factorial model. model.

What Does Replication Accomplish?What Does Replication Accomplish?

11-49

TwoTwo--Factor ANOVA With Replication Factor ANOVA With Replication (Full Factorial Model)(Full Factorial Model)

•• The linear form is The linear form is yyijkijk = = µµ + + AAjj + + BBkk + + ABABjkjk + + εεijkijk

Where Where yyijkijk = observation = observation ii for row for row jj and column and column k k ((i i = 1, 2, = 1, 2, ……,, mm))µ µ = common mean for all treatments= common mean for all treatmentsAAjj = effect of row factor = effect of row factor AA ((jj = 1, 2, = 1, 2, ……, , rr))BBkk = effect of column factor = effect of column factor BB ((kk = 1, 2, = 1, 2, ……, , cc))ABABjkjk = effect attributed to interaction between factors = effect attributed to interaction between factors AA

and and BBεεjkjk = random error (normally distributed, zero mean, = random error (normally distributed, zero mean,

same variance for all treatments)same variance for all treatments)

What Does Replication Accomplish?What Does Replication Accomplish?

11-50

TwoTwo--Factor ANOVA With Factor ANOVA With Replication (Full Factorial Model)Replication (Full Factorial Model)

Format of HypothesesFormat of Hypotheses•• Factor Factor AA: Row Effect: Row Effect

HH00: : AA11 = = AA22 = = …… = = AArr = 0= 0HH11: Not all the : Not all the AAjj are equal to zeroare equal to zero

Factor Factor BB: Column Effect: Column EffectHH00: : BB11 = = BB22 = = …… = = BBcc = 0= 0HH11: Not all the : Not all the BBkk are equal to zeroare equal to zero

Interaction EffectInteraction EffectHH00: All the : All the ABABjkjk are equal to zeroare equal to zeroHH11: Not all : Not all ABABjkjk are equal to zeroare equal to zero

11-51

TwoTwo--Factor ANOVA With Factor ANOVA With Replication (Full Factorial Model)Replication (Full Factorial Model)

Format of DataFormat of Data

Table 11.12

11-52

TwoTwo--Factor ANOVA With Factor ANOVA With Replication (Full Factorial Model)Replication (Full Factorial Model)

Sources of VariationSources of Variation

TwoTwo--Factor ANOVA With Factor ANOVA With Replication (Full Factorial Model)Replication (Full Factorial Model)

•• Step 1: State the hypothesesStep 1: State the hypothesesFactor Factor AA: Row Effect : Row Effect

HH00: : AA11 = = AA22 = = ……, = , = AArr = 0= 0HH11: Not all the : Not all the AAjj are equal to zeroare equal to zero

Factor Factor BB: Column Effect : Column Effect HH00: : BB11 = = BB22 = = …… = = BBcc = 0= 0HH11: Not all the : Not all the BBkk are equal to zeroare equal to zero

Interaction EffectInteraction EffectHH00: All the : All the ABABjkjk are equal to zeroare equal to zeroHH11: Not all : Not all ABABjkjk are equal to zeroare equal to zero

Steps in Performing TwoSteps in Performing Two--Factor ANOVAFactor ANOVA

11-53 11-54

TwoTwo--Factor ANOVA With Factor ANOVA With Replication (Full Factorial Model)Replication (Full Factorial Model)

•• Step 2: State the decision ruleStep 2: State the decision ruleThe degrees of freedom for the critical The degrees of freedom for the critical values values FF areare

Factor Factor AA: : dfdf11 = = rr –– 1 1 Factor Factor BB: : dfdf11 = = c c –– 11Interaction (Interaction (ABAB) = ) = dfdf11 = (= (r r –– 1)(1)(cc –– 1) 1) Error: Error: dfdf2 2 = = rcrc((mm –– 1)1)

For the given For the given αα and appropriate degrees of and appropriate degrees of freedom, obtain the critical values from freedom, obtain the critical values from Appendix F or Excel.Appendix F or Excel.

Steps in Performing TwoSteps in Performing Two--Factor ANOVAFactor ANOVA

11-55

TwoTwo--Factor ANOVA With Factor ANOVA With Replication (Full Factorial Model)Replication (Full Factorial Model)

•• Step 3: Perform the CalculationsStep 3: Perform the CalculationsUse Excel to perform the calculations. For Use Excel to perform the calculations. For example, example,

Steps in Performing TwoSteps in Performing Two--Factor ANOVAFactor ANOVA

Figure 11.22

11-56

TwoTwo--Factor ANOVA With Factor ANOVA With Replication (Full Factorial Model)Replication (Full Factorial Model)

•• Step 4: Make the DecisionStep 4: Make the DecisionReject the null hypothesis if the Reject the null hypothesis if the FF test test exceeds the critical value or if the exceeds the critical value or if the pp--value value is is << αα..

Steps in Performing TwoSteps in Performing Two--Factor ANOVAFactor ANOVA

11-57

TwoTwo--Factor ANOVA With Factor ANOVA With Replication (Full Factorial Model)Replication (Full Factorial Model)

•• To visualize an interaction, plot the To visualize an interaction, plot the treatment means for one factor against the treatment means for one factor against the levels of the other factor. levels of the other factor.

•• Connect the means within each factor.Connect the means within each factor.•• If no interaction, lines will be roughly If no interaction, lines will be roughly

parallel.parallel.•• If strong interaction, lines will have If strong interaction, lines will have

differing slopes and tend to cross each differing slopes and tend to cross each other.other.

Interaction EffectInteraction Effect

11-58

TwoTwo--Factor ANOVA With Factor ANOVA With Replication (Full Factorial Model)Replication (Full Factorial Model)

Possible Interaction PatternsPossible Interaction Patterns

Figure 11.24

11-59

TwoTwo--Factor ANOVA With Factor ANOVA With Replication (Full Factorial Model)Replication (Full Factorial Model)

Possible Interaction PatternsPossible Interaction Patterns

Figure 11.24

11-60

TwoTwo--Factor ANOVA With Factor ANOVA With Replication (Full Factorial Model)Replication (Full Factorial Model)

•• MegaStatMegaStat performs performs TukeyTukey comparisons. comparisons. For example:For example:

TukeyTukey Tests of Pairs of MeansTests of Pairs of Means

Figure 11.26

11-61

General Linear ModelGeneral Linear Model

•• ANOVA models can have more than two ANOVA models can have more than two factors. For example:factors. For example:

•• InteractionInteractioneffects areeffects areABAB, , ACAC, , BCBC,,and and ABCABC..

•• Use MINITAB,Use MINITAB,SPSS, or SAS SPSS, or SAS for higherfor higher--order order models.models.

HigherHigher--Order ANOVA ModelsOrder ANOVA Models

11-62

General Linear ModelGeneral Linear Model

•• The general linear model (GLM) The general linear model (GLM) -- is a tool for estimating large and complex is a tool for estimating large and complex

ANOVA modelsANOVA models-- allows more than two factorsallows more than two factors-- permits unbalanced data and any desired permits unbalanced data and any desired

subset of interactionssubset of interactions-- provides predictions and identifies provides predictions and identifies

unusual observationsunusual observations-- does not require equal variancesdoes not require equal variances-- is easy to understand is easy to understand

What is the GLM?What is the GLM?

11-63

Experimental Design: Experimental Design: An OverviewAn Overview

•• Experimental designExperimental design refers to refers to -- the number of factors under investigation, the number of factors under investigation, -- the number of levels assigned to each factor,the number of levels assigned to each factor,-- the way factor levels are defined, andthe way factor levels are defined, and-- the way observations are obtained.the way observations are obtained.

•• Fully crossedFully crossed or or full factorialfull factorial designs include designs include all possible combinations of factor levels.all possible combinations of factor levels.

•• Fractional factorialFractional factorial designs limit data designs limit data collection to a subset of possible factor collection to a subset of possible factor combinations.combinations.

What is Experimental Design?What is Experimental Design?

11-64

Experimental Design: Experimental Design: An OverviewAn Overview

•• NestedNested or or hierarchicalhierarchical designs occur when all designs occur when all the levels of one factor are fully contained in the levels of one factor are fully contained in another.another.

•• Balanced Balanced designs have an equal number of designs have an equal number of observations for each factor combination.observations for each factor combination.

•• FixedFixed--effectseffects models have predetermined models have predetermined levels of each factor, limiting inferences to levels of each factor, limiting inferences to only the specified factor levels.only the specified factor levels.

•• Random effectsRandom effects models randomly choose models randomly choose factor levels from a population of potential factor levels from a population of potential factor levels.factor levels.

What is Experimental Design?What is Experimental Design?

11-65

Experimental Design: Experimental Design: An OverviewAn Overview

•• In a In a 22kk factorial designfactorial design, there are , there are kk factors, factors, each with two levels.each with two levels.

•• This reduces the data requirements in a This reduces the data requirements in a replicated experiment.replicated experiment.

•• Especially useful when the number of Especially useful when the number of factors is large.factors is large.

22kk ModelsModels

11-66

Experimental Design: Experimental Design: An OverviewAn Overview

•• This design limits collection to a subset of This design limits collection to a subset of the possible factor combinations for the possible factor combinations for reasons of economy.reasons of economy.

•• Extremely important in realExtremely important in real--life situations life situations where many factors exist.where many factors exist.

•• This model sacrifices some of the This model sacrifices some of the interaction effects.interaction effects.

Fractional Factorial DesignsFractional Factorial Designs

11-67

Experimental Design: Experimental Design: An OverviewAn Overview

•• All levels of one factor are fully contained All levels of one factor are fully contained within another.within another.

•• For example,For example,DefectsDefects == f f ((ExperienceExperience, , MethodMethod ((MachineMachine))))

•• MachineMachine is nested within is nested within MethodMethod so the so the effect of effect of MachineMachine cannot appear as a main cannot appear as a main effect.effect.

•• MachineMachine depends on depends on MethodMethod..

Nested or Hierarchical DesignNested or Hierarchical Design

11-68

Experimental Design: Experimental Design: An OverviewAn Overview

•• Factor levels are chosen randomly from a Factor levels are chosen randomly from a population of potential factor levels.population of potential factor levels.

•• Computation and interpretation is more Computation and interpretation is more complicated.complicated.

Random Effects ModelRandom Effects Model

McGraw-Hill/Irwin Copyright © 2009 by The McGraw-Hill Companies, Inc.

Applied Statistics in Applied Statistics in Business & EconomicsBusiness & Economics

End of Chapter 11End of Chapter 11

11-69