/
Two-way ANOVA  Factor Level Means Study Two-way ANOVA  Factor Level Means Study

Two-way ANOVA Factor Level Means Study - PowerPoint Presentation

myesha-ticknor
myesha-ticknor . @myesha-ticknor
Follow
344 views
Uploaded On 2020-01-17

Two-way ANOVA Factor Level Means Study - PPT Presentation

Twoway ANOVA Factor Level Means Study Cells defined b y combinations of t w o or more discrete f actors All o ws ef f ects to be decomposed into main ef f ects and inte r actions Model assumptions remain unchanged ID: 773058

level factor main interaction factor level interaction main effect bread wide regular sales height width anova significant display model

Share:

Link:

Embed:

Download Presentation from below link

Download Presentation The PPT/PDF document "Two-way ANOVA Factor Level Means Study" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

Two-way ANOVA Factor Level Means Study

Cells defined by combinations of two or more discrete factorsAllows effects to be decomposed into main effects and interactionsModel assumptions remain unchanged Main ef f ects and Interaction ef f ects

Cell means notation for two-way ANOVAFor i = 1, . . . , a levels in Factor A and j = 1, . . . , b levels in Factor B, there are k = 1 . . . , ni,j individual observations in cell (i, j). Cell means model: Yi,j,k = µi,j + εi,j,kµi,j is the expected value (true mean) of cell (i, j), estimated by Y¯i,j• ε ∼ N (0, σ )There are ab + 1 parameters in this model (including σ2) iid 2

Main ef fects and Interaction effectsA main effect describes the difference between a baseline reference (µ)and the marginal mean f or a factor level (µi· or µ·j ).The marginal mean is the average value of the response across all data points that belong to a particular level of a factor.An interaction effect gives the difference between the mean for a par ticular cell (µi,j )and the sum of the baseline and main effects for belonging to level i of factor A and level jof factor B.

Cell Means and Marginal Means in Two-way ANOVA

F actor effects notation for two-way ANOVAFactor effects model: Yi,j,k = µ + αi + βj + (αβ)i,j + εi,j,kwhere, is grand mean, estimated by αi is the main effect of belonging to level i of factor A, estimated by βj is the main effect of belonging to level j of factor B, estimated by (αβ)i,j is the interaction effect of belonging to both i and jestimated by Note that “(αβ)i,j ” is ONE parameter, NOT a product!  

T wo-way ANOVA with no interactions: µi,j = µ + αi + β j

T wo-way ANOVA with interactions: µi,j = µ + αi + β j + (αβ)i,j

Development of two-way ANOVA Model , where   For two variables with , we need to define and dummy variables for main effect, and dummy variables for interaction.  For example, , the design matrix X is   X1X2level 1 in factor A10level 2 in factor A01level 3 in factor A-1-1X3level 1 in factor B1level 2 in factor B-1Note: the reference baseline (): unweighted mean   Main effect X1X3 X2X3 level 1 in factor A and level 1 in factor B 1 0 level 1 in factor A and level 2 in factor B -1 0 level 2 in factor A and level 1 in factor B 0 1 level 2 in factor A and level 2 in factor B 0 -1 level 3 in factor A and level 1 in factor B -1 -1 level 3 in factor A and level 2 in factor B 1 1 Interaction effect

µ is the grand mean of the population (µ , estimated by Y·· ··¯ ) µ + αi is the marginal mean for level i of Factor A (µi·, estimated by Y¯i·)µ + β is the marginal mean for level j of Factor B ( jµ , estimated by Y·j¯·j)µ + αi + βj + (αβ)i,j is the cell mean (µi,j , estimated by Y¯i,j ) (in a purely additive model, the cell mean would be µ + α i + β j )Constraints in two-way ANOVA Const r aint ( α β ) a,b = 0 appears twic e , so this isa total of 1 + 1 + a + b − 1 = 1 + a + b const r aint s .

Development of the Regression Model Example: Bread sales In this example, we use data from a designed experiment to determine how the height and width of a displa y shelf af f ects bread sales at a bakery. Twelve supermarkets, similar in sales volume and clientele were studied (bakery.txt). , where    ya (weight)b(height)Int.x1x2x3x1x3x2x34711110110431111 0 1 1 0 46 1 2 1 1 0 -10 -1 40 1 2 1 1 0 -1 0 -1 62 2 1 1 0 1 1 0 1 68 2 1 1 0 1 1 0 1 67 2 2 1 0 1 -1 0 -1 71 2 2 1 0 1 -10-141311-1-11-1139311-1-11-1142321-1-1-1-1146321-1-1-1-11 Design matrix

Development of the Regression Model Example: Bread sales In this example, we use data from a designed experiment to determine how the height and width of a display shelf af f ects bread sales at a bakery. Twelve supermarkets, similar in sales volume and clientele were studied (bakery.txt).              1        

Development of the Regression Model Example: Bread sales In this example, we use data from a designed experiment to determine how the height and width of a display shelf af f ects bread sales at a bakery. Twelve supermarkets, similar in sales volume and clientele were studied (bakery.txt).      69   What matters now is that the factor effect model and the cell mean model will come up with the same estimate for each cell, i.e., The ANOVA table should be the same.  

Building the ana lysis of variance table in two-way ANOVAIn regression and one-way ANOVA, we broke the total sum of squares down into the model sum of squares (SSM) and error sum of squares (SSE).In two-way ANOVA, SSM is further broken down into the main and interaction effects. (This is really just an application of the extra sum of squares)

Rules for degrees of freedomDegrees of freedom in the two-way ANOVA analysis are allocated as follows:Main ef f ects for each factor take df, where is the number of levels in the factor Interactions take df’s equal to the product of the main effect df’s: for the interaction between factors A and B.Total sum of squares: (as usual)Model df’s are given by the sum of the df’s for all main and interactions in the model:Error: (as usual)   i.e., and  

F -testsTwo-way ANOVA adds several secondary F -tests to the standard global F -test. In fi xed effects models, all of the F -tests use MSE in the denominator.The numerators for the secondary F -tests may use either the Type I (sequential) or Type II (last-variable-added) extra sums of squares.

Expected mean squaresWith the zero-sum constraints and a balanced design (so ni,j = n ∀i, j):

Ana lytical strategyIf the model contains interaction terms that are significantly different from zero, then the relationship between each factor and the response is not consistent. It depends on the level of the other factor.Always check for an interaction first.If the interaction is not significant, you can remove it.If the interaction term is significant, leave the main effects in the model, e ven if they are not significant.

Ana lytic strategy for two-way ANOVA

Compare main factor effectsEstimation of factor level meanConfidence interval for and   Estimation of contrast (or just general linear combination without the constriction) of factor level means For factor A means  For factor B means  The test statistic is  

Compare main factor effectsBonferroni procedure comparison of factor level means Compare g groups in factor A, each being D The confidence interval for D are     Compare g groups in factor B, each being D There are also other procedures (Turkey, LSD, Sheaffe etc.) comparison of factor level means. Check out the text book for more details. The test statistic are For example (main effect comparison)Which of the following is the correct equation to compare average sale between regular and wide width..  

Compare interaction effectsSimultaneously compare multiple cell meansThe confidence interval for D are    The test statistic are For example,            Comparison multiple cell means is n ecessary especially when the interaction effect is significant.

Example: Bread salesIn this example, we use data from a designed experiment to determine how the height and width of a display shelf affects bread sales at a bake r y . Twelve supermarkets, similar in sales volume and clientele were studied (bakery.txt).    

Example: Bread salesIn this example, we use data from a designed experiment to determine how the height and width of a display shelf affects bread sales at a bake r y . Twelve supermarkets, similar in sales volume and clientele were studied (bakery.txt).    Not significant, p-value=0.3747 Significant, p-value<0.0001 Not significant, p-value=0.3226

Example: Bread salesCheck the interaction term: not significant (F2,6 = 1 .16, p = 0.3747)Since the interaction is not significant, we can interpret the main effects independently of each other.Main effect of height is significant (F2,6 = 74.71, p < 0.0001) Main effect of width is not significant (F1,6 = 1.16, p = 0.3226)

The height of the display affects sales, and has a similar effect at both widths. Width has no effect on sales.Further analyses are needed to tell which levels of height differ from the o t hers: Rerun the analysis as a one-way ANOVA on heightCompare the individual pairwise differences between levelsLook at a plot or at the cell means to see which height(s) maximize sales.Example: Bread sales

Since the interaction effect is not significant. We can do comparison based on the marginal means (main effect) Example: Bread salesCompare the average sale between bottom and middle heightD  Factor A (display height, i)Factor B (display width, j) Meanni=1 bottomj=1 (regular)452i=2 middlej=1 (regular)652i=3 topj=1 (regular)402 i=1 bottomj=2 (wide)432i=2 middlej=2 (wide)692i=3 topj=2 (wide)442MSE=10.3 a=3, b=2   2. Compare the average sale between regular and wide width   3 . Compare the average sale between the average of middle and top regular (21 and 31) and middle and top wide (22 and 32) width   4 . Is the average sale the highest in the middle height? Consider a simultaneous comparison with Bonferroni procedure at 95% level.

Since the interaction effect is not significant. We can do comparison based on the marginal means (main effect) Example: Bread salesCompare the average sale between bottom and middle heightD  Factor A (display height, i)Factor B (display width, j) Meanni=1 bottomj=1 (regular)452i=2 middlej=1 (regular)652i=3 topj=1 (regular)402 i=1 bottomj=2 (wide)432i=2 middlej=2 (wide)692i=3 topj=2 (wide)442MSE=10.3 a=3, b=2   D         To underhand the cm setting

Since the interaction effect is not significant. We can do comparison based on the marginal means (main effect) Example: Bread salesFactor A (display height, i)Factor B (display width, j) Mean n i=1 bottomj=1 (regular)452i=2 middlej=1 (regular)652i=3 topj=1 (regular)402i=1 bottomj=2 (wide)432i=2 middle j=2 (wide)692i=3 topj=2 (wide)442MSE=10.3 a=3, b=2          2 . Compare the average sale between regular and wide width  

Example: Bread salesFactor A (display height, i)Factor B (display width, j) Meann i=1 bottom j=1 (regular) 452i=2 middlej=1 (regular)652i=3 topj=1 (regular)402i=1 bottomj=2 (wide)432i=2 middlej=2 (wide) 692i=3 topj=2 (wide)442MSE=10.3 a=3, b=2          3. Compare the average sale between the average of middle and top regular (21 and 31) and middle and top wide (22 and 32) width  

Example: Bread salesFactor A (display height, i)Factor B (display width, j) Meann i=1 bottom j=1 (regular) 452i=2 middlej=1 (regular)652i=3 topj=1 (regular)402i=1 bottomj=2 (wide)432i=2 middlej=2 (wide) 692i=3 topj=2 (wide)442MSE=10.3 a=3, b=2   4. Is the average sale the highest in the middle height? Consider a simultaneous confidence interval with Bonferroni procedure at 0.95 level.         The confidence interval for D are     Where .9875; 6)=2.97   =   =  

Example: Teaching method (significant interaction) A junior college system studies the effects of teaching method (factor A) and student’s quantitative ability (facto B) on learning of College mathematics. Factor A (teaching methods) Abstract and Standard, a=2Factor B (quantitative ability) Excellent, Good, and Moderate, b=3n=42 students were selected and randomly placed into classes, with each class containing equal numbers of students of each quantitative ability level. Y is the amount of learning of college mathematics, measured by a standard mathematics achievement test.

Example: Teaching method (significant interaction) Investigate the nature of the interaction effects: estimating separately for students with excellent, good, and moderate quantitative abilities, how large is the difference in mean learning for the two teaching methods. Consider Bonferroni procedure,  

Additive model Cell sample size  

Additive models or Pooling

Example: Bread salesIn this example, we use data from a designed experiment to determine how the height and width of a display shelf affects bread sales at a bake r y . Twelve supermarkets, similar in sales volume and clientele were studied (bakery.txt).The original ANOVA table

Example: Bread salesThe original ANOVA table After pooling MSE doesn’t change much in this case.

Another pooling example The original ANOVA table After pooling The interaction is not significant and 9 degrees of freedom are being spent here. After pooling,  

Pooling summary

ANOVA for n=1