model adequacy
play

Model Adequacy Usual residual plots: Residuals versus predicted - PowerPoint PPT Presentation

ST 516 Experimental Statistics for Engineers II Model Adequacy Usual residual plots: Residuals versus predicted (fitted) values; Probability plot (q-q plot) of residuals; Residuals by treatment level. And for blocks: Residuals by block. R


  1. ST 516 Experimental Statistics for Engineers II Model Adequacy Usual residual plots: Residuals versus predicted (fitted) values; Probability plot (q-q plot) of residuals; Residuals by treatment level. And for blocks: Residuals by block. R command for the usual plots plot(aov(Yield ~ factor(Batch) + factor(Pressure), graftLong)) 1 / 26 Blocked Designs Model Adequacy

  2. ST 516 Experimental Statistics for Engineers II Residuals vs Fitted 1.3 ● 4 ● 4.2 ● ● ● 2 ● Residuals ● ● ● ● 0 ● ● ● ● ● ● ● ● ● −2 ● ● ● ● ● 1.2 −4 85 90 95 Fitted values aov(Yield ~ factor(Batch) + factor(Pressure)) 2 / 26 Blocked Designs Model Adequacy

  3. ST 516 Experimental Statistics for Engineers II Normal Q−Q 2 1.3 ● 4.2 ● ● Standardized residuals ● ● 1 ● ● ● ● ● 0 ● ● ● ● ● ● ● ● ● −1 ● ● ● ● ● 1.2 −2 −1 0 1 2 Theoretical Quantiles aov(Yield ~ factor(Batch) + factor(Pressure)) 3 / 26 Blocked Designs Model Adequacy

  4. ST 516 Experimental Statistics for Engineers II Scale−Location 1.3 ● 4.2 ● 1.2 ● ● ● 1.2 Standardized residuals ● ● ● ● ● ● 0.8 ● ● ● ● ● ● ● ● 0.4 ● ● ● ● ● 0.0 85 90 95 Fitted values aov(Yield ~ factor(Batch) + factor(Pressure)) 4 / 26 Blocked Designs Model Adequacy

  5. ST 516 Experimental Statistics for Engineers II Constant Leverage: Residuals vs Factor Levels 2 1.3 ● ● 4.2 ● Standardized residuals ● ● 1 ● ● ● ● ● 0 ● ● ● ● ● ● ● ● ● −1 ● ● ● ● ● 1.2 −2 factor(Batch) : 2 3 5 4 1 6 Factor Level Combinations 5 / 26 Blocked Designs Model Adequacy

  6. ST 516 Experimental Statistics for Engineers II General Regression Approach Any design may be analyzed based on the statistical model; e.g. RCBD: y i , j = µ + τ i + β j + ǫ i , j , i = 1 , 2; j = 1 , 2 , . . . , n . Parameter estimates: use least squares: for balanced design, gives the usual estimates; for unbalanced design, e.g. with missing values, gives optimal estimates. 6 / 26 Blocked Designs General Regression Approach

  7. ST 516 Experimental Statistics for Engineers II General Regression Significance Test For any fitted model, write y 2 = R (parameters) + SS E � E.g. RCBD: a b � � y 2 i , j = R ( µ, τ, β ) + SS E . i =1 j =1 R ( µ, τ, β ) is the “sum of squares explained by µ , τ 1 , . . . , τ a , and β 1 , . . . , β b ”. 7 / 26 Blocked Designs General Regression Approach

  8. ST 516 Experimental Statistics for Engineers II A hypothesis such as H 0 : τ 1 = τ 2 = · · · = τ a = 0 specifies a reduced model with those parameters omitted (but still containing β 1 , . . . , β b ). The “sum of squares associated with those parameters” is the difference between the explained sums of squares. E.g. R ( τ | µ, β ) = R ( µ, τ, β ) − R ( µ, β ) is “the sum of squares associated with τ 1 , . . . , τ a ”. 8 / 26 Blocked Designs General Regression Approach

  9. ST 516 Experimental Statistics for Engineers II In a balanced design: R ( τ | µ, β ) is exactly SS Treatments R ( β | µ, τ ) is exactly SS Blockss . With unbalanced data, e.g. a balanced design with missing data, R ( τ | µ, β ) is the correct numerator for an F -statistic to test the hypothesis H 0 : τ 1 = τ 2 = · · · = τ a = 0. So in either case (balanced or unbalanced), R ( τ | µ, β ) is the correct numerator. 9 / 26 Blocked Designs General Regression Approach

  10. ST 516 Experimental Statistics for Engineers II Missing Observation Suppose the yield for 8700 psi is missing in batch 4: R commands graftCopy <- graftLong graftCopy["2.4", "Yield"] <- NA summary(aov(Yield ~ factor(Batch) + factor(Pressure), graftCopy)) Output Df Sum Sq Mean Sq F value Pr(>F) factor(Batch) 5 190.12 38.024 5.2346 0.006448 ** factor(Pressure) 3 163.40 54.466 7.4981 0.003130 ** Residuals 14 101.70 7.264 --- Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1 1 observation deleted due to missingness The order matters! Blocks before Treatments . 10 / 26 Blocked Designs Missing Observation

  11. ST 516 Experimental Statistics for Engineers II Montgomery describes an approximate method for handling a missing data point, essentially by replacing it by its predicted (“imputed”) value. To use the imputation method, we could use the predict() method to impute the missing value. R commands p <- predict(aov(Yield ~ factor(Batch) + factor(Pressure), graftCopy), newdata = graftCopy["2.4", ]) # 2.4 # 91.08 graftCopy["2.4", "Yield"] <- p summary(aov(Yield ~ factor(Batch) + factor(Pressure), graftCopy)) 11 / 26 Blocked Designs Missing Observation

  12. ST 516 Experimental Statistics for Engineers II Output Df Sum Sq Mean Sq F value Pr(>F) factor(Batch) 5 189.5 37.90 5.591 0.00419 ** factor(Pressure) 3 166.1 55.38 8.169 0.00185 ** Residuals 15 101.7 6.78 --- Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1 12 / 26 Blocked Designs Missing Observation

  13. ST 516 Experimental Statistics for Engineers II But note: The degrees of freedom for Residuals should be 14, not 15, so the table must be adjusted. By hand: Df Sum Sq Mean Sq F value Pr( > F) factor(Batch) 5 189.5 37.90 5.218 0.00653 factor(Pressure) 3 166.1 55.38 7.624 0.00292 Residuals 14 101.7 7.264 13 / 26 Blocked Designs Missing Observation

  14. ST 516 Experimental Statistics for Engineers II Adjusting residual df using R: a <- aov(Yield ~ factor(Batch) + factor(Pressure), graftCopy) a$df.residual <- a$df.residual - 1 summary(a) Output Df Sum Sq Mean Sq F value Pr(>F) factor(Batch) 5 189.5 37.90 5.218 0.00653 ** factor(Pressure) 3 166.1 55.38 7.624 0.00292 ** Residuals 14 101.7 7.26 --- Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1 Compare with correct table, above: close, but still only an approximation. Moral: do it the correct way! 14 / 26 Blocked Designs Missing Observation

  15. ST 516 Experimental Statistics for Engineers II Latin Squares The RCBD allows you to remove variability due to one controllable nuisance factor. More complex designs are needed for more than one controllable nuisance factor: Latin Square for two nuisance factors; Graeco-Latin Square for three nuisance factors. 15 / 26 Blocked Designs Latin Squares

  16. ST 516 Experimental Statistics for Engineers II A Latin Square design has one treatment factor and two nuisance factors. Same number p of levels of each factor. All p 2 combinations of levels of nuisance factors are run. Treatment assignments are balanced across both nuisance factors. 16 / 26 Blocked Designs Latin Squares

  17. ST 516 Experimental Statistics for Engineers II Examples (row = first nuisance factor, column = second nuisance factor, letter = level of treatment): 4 × 4: A B D C B C A D C D B A D A C B 5 × 5: A D B E C D A C B E C B E D A B E A C D E C D A B 17 / 26 Blocked Designs Latin Squares

  18. ST 516 Experimental Statistics for Engineers II E.g. Rocket Propellant (rocket-propellant.txt): Batch Operator Formulation BurningRate 1 1 a 24 1 2 b 20 1 3 c 19 1 4 d 24 1 5 e 24 2 1 b 17 . . . 18 / 26 Blocked Designs Latin Squares

  19. ST 516 Experimental Statistics for Engineers II R commands rocketPropellant <- read.table("data/rocket-propellant.txt", header = TRUE) summary(aov(BurningRate ~ factor(Batch) + factor(Operator) + Formulation, rocketPropellant)) Output Df Sum Sq Mean Sq F value Pr(>F) factor(Batch) 4 68 17.000 1.5937 0.239059 factor(Operator) 4 150 37.500 3.5156 0.040373 * Formulation 4 330 82.500 7.7344 0.002537 ** Residuals 12 128 10.667 --- Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1 19 / 26 Blocked Designs Latin Squares

  20. ST 516 Experimental Statistics for Engineers II Model equation: y i , j , k = µ + α i + τ j + β k + ǫ i , j , k , with 1 ≤ i ≤ p , 1 ≤ j ≤ p , 1 ≤ k ≤ p . Here: α i = i th row effect , β k = k th column effect , τ j = j th treatment effect . But we have only one observation in the ( i , k ) cell of the table; the corresponding value of j can be read from the design. 20 / 26 Blocked Designs Latin Squares

  21. ST 516 Experimental Statistics for Engineers II Random Effects If Batch is a random effect with variance σ 2 Batches , then the expected mean square is E (MS Batches ) = σ 2 + p σ 2 Batches So we estimate σ 2 Batches by Batches = MS Batches − MS Residuals = 17 . 000 − 10 . 667 σ 2 ˆ = 1 . 267 . p 5 21 / 26 Blocked Designs Latin Squares

  22. ST 516 Experimental Statistics for Engineers II R note: using reshape() The data file rocket-propellant.txt has a different layout from Table 4.8 in the text. table-04-8.txt has essentially the same layout as Table 4.8: Batch F1 R1 F2 R2 F3 R3 F4 R4 F5 R5 1 A 24 B 20 C 19 D 24 E 24 2 B 17 C 24 D 30 E 27 A 36 3 C 18 D 38 E 26 A 27 B 21 4 D 26 E 31 A 26 B 23 C 22 5 E 22 A 30 B 20 C 29 D 31 22 / 26 Blocked Designs Latin Squares

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend