Topic 25: Inference for Two-Way ANOVA. Outline Two-way ANOVA –Data, models, parameter estimates ANOVA table, EMS Analytical strategies Regression approach.

Slides:



Advertisements
Similar presentations
Topic 12: Multiple Linear Regression
Advertisements

Lecture 10 F-tests in MLR (continued) Coefficients of Determination BMTRY 701 Biostatistical Methods II.
Topic 9: Remedies.
Topic 32: Two-Way Mixed Effects Model. Outline Two-way mixed models Three-way mixed models.
Multifactor Experiments November 26, 2013 Gui Citovsky, Julie Heymann, Jessica Sopp, Jin Lee, Qi Fan, Hyunhwan Lee, Jinzhu Yu, Lenny Horowitz, Shuvro Biswas.
Topic 15: General Linear Tests and Extra Sum of Squares.
Topic 3: Simple Linear Regression. Outline Simple linear regression model –Model parameters –Distribution of error terms Estimation of regression parameters.
Statistics for Managers Using Microsoft® Excel 5th Edition
Chapter 11 Analysis of Variance
Statistics for Managers Using Microsoft Excel, 4e © 2004 Prentice-Hall, Inc. Chap 10-1 Chapter 10 Analysis of Variance Statistics for Managers Using Microsoft.
Chap 10-1 Analysis of Variance. Chap 10-2 Overview Analysis of Variance (ANOVA) F-test Tukey- Kramer test One-Way ANOVA Two-Way ANOVA Interaction Effects.
Chapter 12: Analysis of Variance
Topic 16: Multicollinearity and Polynomial Regression.
Topic 28: Unequal Replication in Two-Way ANOVA. Outline Two-way ANOVA with unequal numbers of observations in the cells –Data and model –Regression approach.
1 Experimental Statistics - week 7 Chapter 15: Factorial Models (15.5) Chapter 17: Random Effects Models.
1 Experimental Statistics - week 6 Chapter 15: Randomized Complete Block Design (15.3) Factorial Models (15.5)
Topic 2: An Example. Leaning Tower of Pisa Construction began in 1173 and by 1178 (2 nd floor), it began to sink Construction resumed in To compensate.
Inferences in Regression and Correlation Analysis Ayona Chatterjee Spring 2008 Math 4803/5803.
© 2002 Prentice-Hall, Inc.Chap 9-1 Statistics for Managers Using Microsoft Excel 3 rd Edition Chapter 9 Analysis of Variance.
1 Experimental Statistics - week 10 Chapter 11: Linear Regression and Correlation.
23-1 Analysis of Covariance (Chapter 16) A procedure for comparing treatment means that incorporates information on a quantitative explanatory variable,
Topic 7: Analysis of Variance. Outline Partitioning sums of squares Breakdown degrees of freedom Expected mean squares (EMS) F test ANOVA table General.
Lecture 4 SIMPLE LINEAR REGRESSION.
 The idea of ANOVA  Comparing several means  The problem of multiple comparisons  The ANOVA F test 1.
Topic 14: Inference in Multiple Regression. Outline Review multiple linear regression Inference of regression coefficients –Application to book example.
CHAPTER 12 Analysis of Variance Tests
McGraw-Hill/Irwin Copyright © 2007 by The McGraw-Hill Companies, Inc. All rights reserved. Experimental Design and Analysis of Variance Chapter 10.
Randomized Block Design (Kirk, chapter 7) BUSI 6480 Lecture 6.
Topic 17: Interaction Models. Interaction Models With several explanatory variables, we need to consider the possibility that the effect of one variable.
The Completely Randomized Design (§8.3)
Topic 6: Estimation and Prediction of Y h. Outline Estimation and inference of E(Y h ) Prediction of a new observation Construction of a confidence band.
Topic 13: Multiple Linear Regression Example. Outline Description of example Descriptive summaries Investigation of various models Conclusions.
Hormone Example: nknw892.sas Y = change in growth rate after treatment Factor A = gender (male, female) Factor B = bone development level (severely depressed,
Topic 23: Diagnostics and Remedies. Outline Diagnostics –residual checks ANOVA remedial measures.
1 Experimental Statistics - week 14 Multiple Regression – miscellaneous topics.
Topic 30: Random Effects. Outline One-way random effects model –Data –Model –Inference.
Bread Example: nknw817.sas Y = number of cases of bread sold (sales) Factor A = height of shelf display (bottom, middle, top) Factor B = width of shelf.
Topic 26: Analysis of Covariance. Outline One-way analysis of covariance –Data –Model –Inference –Diagnostics and rememdies Multifactor analysis of covariance.
PSYC 3030 Review Session April 19, Housekeeping Exam: –April 26, 2004 (Monday) –RN 203 –Use pencil, bring calculator & eraser –Make use of your.
Experiment Design Overview Number of factors 1 2 k levels 2:min/max n - cat num regression models2k2k repl interactions & errors 2 k-p weak interactions.
1 Experimental Statistics - week 9 Chapter 17: Models with Random Effects Chapter 18: Repeated Measures.
Topic 24: Two-Way ANOVA. Outline Two-way ANOVA –Data –Cell means model –Parameter estimates –Factor effects model.
1 Experimental Statistics Spring week 6 Chapter 15: Factorial Models (15.5)
Experimental Statistics - week 3
Topic 20: Single Factor Analysis of Variance. Outline Analysis of Variance –One set of treatments (i.e., single factor) Cell means model Factor effects.
Chapter 4 Analysis of Variance
Copyright © Cengage Learning. All rights reserved. 11 Multifactor Analysis of Variance.
Experimental Statistics - week 9
Topic 29: Three-Way ANOVA. Outline Three-way ANOVA –Data –Model –Inference.
Topic 27: Strategies of Analysis. Outline Strategy for analysis of two-way studies –Interaction is not significant –Interaction is significant What if.
Topic 22: Inference. Outline Review One-way ANOVA Inference for means Differences in cell means Contrasts.
Topic 21: ANOVA and Linear Regression. Outline Review cell means and factor effects models Relationship between factor effects constraint and explanatory.
1 Experimental Statistics - week 8 Chapter 17: Mixed Models Chapter 18: Repeated Measures.
1 Experimental Statistics - week 12 Chapter 11: Linear Regression and Correlation Chapter 12: Multiple Regression.
CHAPTER 3 Analysis of Variance (ANOVA) PART 3 = TWO-WAY ANOVA WITH REPLICATION (FACTORIAL EXPERIMENT) MADAM SITI AISYAH ZAKARIA EQT 271 SEM /2015.
McGraw-Hill/IrwinCopyright © 2009 by The McGraw-Hill Companies, Inc. All Rights Reserved. Experimental Design and Analysis of Variance Chapter 11.
Three Factor ANOVA I,J,K = Levels of the factors A,B, C L ijk = The number of obeservations of factor A at level i, factor B at level j, and factor C at.
10-1 of 29 ANOVA Experimental Design and Analysis of Variance McGraw-Hill/Irwin Copyright © 2003 by The McGraw-Hill Companies, Inc. All rights reserved.
1 Experimental Statistics - week 11 Chapter 11: Linear Regression and Correlation.
CHAPTER 3 Analysis of Variance (ANOVA) PART 3 = TWO-WAY ANOVA WITH REPLICATION (FACTORIAL EXPERIMENT)
MADAM SITI AISYAH ZAKARIA
Two-Way Analysis of Variance Chapter 11.
Factorial Experiments
Two-Factor Full Factorial Designs
ANalysis Of VAriance (ANOVA)
Topic 31: Two-way Random Effects Models
Two-Factor Studies with Equal Replication
Two-Factor Studies with Equal Replication
Experimental Statistics - week 8
Slides are available at:
Presentation transcript:

Topic 25: Inference for Two-Way ANOVA

Outline Two-way ANOVA –Data, models, parameter estimates ANOVA table, EMS Analytical strategies Regression approach

Data Response written Y ijk where –i denotes the level of the factor A –j denotes the level of the factor B –k denotes the k th observation in cell (i,j) i = 1,..., a levels of factor A j = 1,..., b levels of factor B k = 1,..., n observations in cell (i,j)

Cell means model Y ijk = μ ij + ε ijk –where μ ij is the theoretical mean or expected value of all observations in cell (i,j) –the ε ijk are iid N(0, σ 2 ) –This means Y ijk ~N(μ ij, σ 2 ) and independent

Factor effects model μ ij = μ + α i + β j + (αβ) ij Consider μ to be the overall mean α i is the main effect of A β j is the main effect of B (αβ) ij is the interaction between A and B

Constraints for this interpretation α. = Σ i α i = 0 (df = a-1) β. = Σ j β j = 0 (df = b-1) (αβ).j = Σ i (αβ) ij = 0 for all j (αβ) i. = Σ j (αβ) ij = 0 for all I df = (a-1)(b-1)

SAS GLM Constraints α a = 0 (1 constraint) β b = 0 (1 constraint) (αβ) aj = 0 for all j (b constraints) (αβ) ib = 0 for all i (a constraints) The total is 1+1+a+b-1=a+b+1 (the constraint (αβ) ab is counted twice in the last two bullets above)

Parameters and constraints The cell means model has ab parameters for the means The factor effects model has (1+a+b+ab) parameters –An intercept (1) –Main effect of A (a) –Main effect of B (b) –Interaction of A and B (ab)

Factor effects model There are 1+a+b+ab parameters There are 1+a+b constraints There are ab unconstrained parameters (or sets of parameters), the same number of parameters for the means in the cell means model While certain parameters depend on choice of constraints, others do not

KNNL Example KNNL p 833 Y is the number of cases of bread sold A is the height of the shelf display, a=3 levels: bottom, middle, top B is the width of the shelf display, b=2: regular, wide n=2 stores for each of the 3x2 treatment combinations

Proc GLM with solution proc glm data=a1; class height width; model sales=height width height*width /solution; means height*width; run;

Solution output Intercept 44.0 B height B height B height B width B width B

Solution output height*width B height*width B height*width B height*width B height*width B height*width B

Means height width Mean = = = = = = Based on estimates from previous two pages

Check normality Alternative way to form QQplot proc glm data=a1; class height width; model sales=height width height*width; output out=a2 r=resid; proc rank data=a2 out=a3 normal=blom; var resid; ranks zresid;

Normal Quantile plot proc sort data=a3; by zresid; symbol1 v=circle i=sm70; proc gplot data=a3; plot resid*zresid/frame; run;

The plot Note, dfE is only 6

ANOVA Table Source df SS MS F A a-1 SSA MSA MSA/MSE B b-1 SSB MSB MSB/MSE AB (a-1)(b-1) SSAB MSAB MSAB/MSE Error ab(n-1) SSE MSE _ Total abn-1 SSTO

Expected Mean Squares E(MSE) = σ 2 E(MSA) = σ 2 + nb( Σ i α i 2 )/(a-1) E(MSB) = σ 2 + na( Σ j β j 2 )/(b-1) E(MSAB) = σ 2 + n( Σ )/((a-1)(b-1)) Here, α i, β j, and (αβ) ij are defined with the usual factor effects constraints

An analytical strategy Run the model with main effects and the two-way interaction Plot the data, the means, and look at the normal quantile plot and residual plots If assumptions seem reasonable, check the significance of test for the interaction

AB interaction not sig If the AB interaction is not statistically significant –Possibly rerun the analysis without the interaction (See pooling §19.10) –Potential Type II errors when pooling –For a main effect with more than two levels that is significant, use the means statement with the Tukey multiple comparison procedure

GLM Output Source DF SS MS F Pr > F Model Error Total Note that there are 6 cells in this design.

Output ANOVA Type I or Type III Source DF SS MS F Pr > F height <.0001 width h*w Note Type I and Type III analyses are the same because cell size n is constant

Rerun without interaction proc glm data=a1; class height width; model sales=height width; means height / tukey lines; run;

ANOVA output Source DF MS F Pr > F height <.0001 width MS(height) and MS(width) have not changed. The MSE, F*’s, and P-values have because of pooling.

Comparison of MSEs Error Error Model with interaction Model without interaction Little change in MSE here…often only pool when df small

Pooling SS Data = Model + Residual When we remove a term from the `model’, we put this variation and the associated df into `residual’ This is called pooling A benefit is that we have more df for error and a simpler model Potential Type II errors Beneficial only in small experiments

Pooling SSE and SSAB For model with interaction SSAB=24, dfAB=2 SSE=62, dfE=6 MSE=10.33 For the model with main effects only SSE=62+24=86, dfE=6+2=8 MSE=10.75

Tukey Output Mean N height A B B B

Plot of the means

Regression Approach Similar to what we did for one-way Use a-1 variables for A Use b-1 variables for B Multiply each of the a-1 variables for A times each of the b-1 for B to get (a- 1)(b-1) for AB You can use the test statement in Proc reg to perform F tests

Create Variables data a4; set a1; X1 = (height eq 1) - (height eq 3); X2 = (height eq 2) - (height eq 3); X3 = (width eq 1) - (width eq 2); X13 = X1*X3; X23 = X2*X3;

Run Proc Reg proc reg data=a4; model sales= X1 X2 X3 X13 X23 / ss1; height: test X1, X2; width: test X3; interaction: test X13, X23; run;

SAS Output Analysis of Variance SourceDF Sum of Squares Mean SquareF ValuePr > F Model Error Corrected Total Same basic ANOVA table

SAS Output Parameter Estimates VariableDF Parameter Estimate Standard Errort ValuePr > |t|Type I SS Intercept < X X < X X X

SS Results SS(Height) = SS(X1)+SS(X2|X1) 1544 = SS(Width) = SS(X3|X1,X2) 12 = 12 SS(Height*Width) = SS(X13|X1,X2,X3) + SS(X23|X1, X2,X3,X13) 24 =

Test Results Test height Results for Dependent Variable sales SourceDF Mean SquareF ValuePr > F Numerator <.0001 Denominator Test interaction Results for Dependent Variable sales SourceDF Mean SquareF ValuePr > F Numerator Denominator Test width Results for Dependent Variable sales SourceDF Mean SquareF ValuePr > F Numerator Denominator

Interpreting Estimates

Last slide Finish reading KNNL Chapter 19 Topic25.sas contains the SAS commands for these slides We will now focus more on the strategies needed to handle a two- or more factor ANOVA