﻿ VisualStat® Examples - Multi-factor Analysis of Variance  Software to Simplify Statistical Practice ...

## Multi-Factor ANOVA - Example

#### Data

The data for this case study were collected by Said Jahanmir of the NIST Ceramics Division in 1996 in connection with a NIST/industry ceramics consortium for strength optimization of ceramic strength.

The motivation for studying this data set is to illustrate the analysis of multiple factors from a designed experiment

This case study will utilize only a subset of a full study that was conducted by Lisa Gill and James Filliben of the NIST Statistical Engineering Division

The response variable is a measure of the strength of the ceramic material.

The goals of this case study is to determine if the nuisance factors (lab and batch) have an effect on the ceramic strength (y).

#### Analysis

1. Open the DataBook jahanmi2.vstz
open this data file via the Help / Open Examples menu; it is in the Sample Data
2. Choose the menu Analyze and the command Multi-Way, under group Analysis of Variance
3. In Variables, select Y
4. In Grouping Variables, select Batch, Speed, FeedRate, GritSize
5. Click OK #### Output

By default, R code is printed after parsing and before evaluation.

DataSheet is converted to DataFrame, in the form DataBook.DataSheet

```> ## Save variables as factors.
> Y <- jahanmi2.Sheet1\$Y
> Batch <- as.factor(jahanmi2.Sheet1\$Batch)
> Speed <- as.factor(jahanmi2.Sheet1\$Speed)
> FeedRate <- as.factor(jahanmi2.Sheet1\$FeedRate)
> GritSize <- as.factor(jahanmi2.Sheet1\$GritSize)

> ## Fit the model and print the anova table.
> AnovaModel <- (lm(Y ~ Batch + Speed + FeedRate + GritSize))
> summary.aov(AnovaModel)
Df  Sum Sq Mean Sq F value  Pr(>F)
Batch         1  727138  727138 182.869 < 2e-16 ***
Speed         1   26673   26673   6.708 0.00989 **
FeedRate      1   11524   11524   2.898 0.08933 .
GritSize      1   14380   14380   3.616 0.05782 .
Residuals   475 1888731    3976
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

> ## Print effect estimates.
> summary(AnovaModel)

Call:
lm(formula = Y ~ Batch + Speed + FeedRate + GritSize)

Residuals:
Min       1Q   Median       3Q      Max
-309.784  -31.082    3.651   34.923  203.617

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept)  697.027      6.436 108.305  < 2e-16 ***
Batch2       -77.843      5.756 -13.523  < 2e-16 ***
Speed1       -14.909      5.756  -2.590  0.00989 **
FeedRate1      9.800      5.756   1.702  0.08933 .
GritSize1    -10.947      5.756  -1.902  0.05782 .
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 63.06 on 475 degrees of freedom
Multiple R-squared:  0.2922,	Adjusted R-squared:  0.2862
F-statistic: 49.02 on 4 and 475 DF,  p-value: < 2.2e-16

> ## Summary Statistics
> summary.vst(jahanmi2.Sheet1[,c('Y')], statistics = c('mean','sd','nobs'),
groups = jahanmi2.Sheet1\$Batch)
Statistic
Group nobs     mean       sd
1  240 688.9986 65.54909
2  240 611.1560 61.85425

> summary.vst(jahanmi2.Sheet1[,c('Y')], statistics = c('mean','sd','nobs'),
groups = jahanmi2.Sheet1\$Speed)
Statistic
Group nobs     mean       sd
-1  240 657.5318 75.81438
1   240 642.6228 72.83972

> summary.vst(jahanmi2.Sheet1[,c('Y')], statistics = c('mean','sd','nobs'),
groups = jahanmi2.Sheet1\$FeedRate)
Statistic
Group nobs     mean       sd
-1  240 645.1774 76.66968
1   240 654.9772 72.37810

> summary.vst(jahanmi2.Sheet1[,c('Y')], statistics = c('mean','sd','nobs'),
groups = jahanmi2.Sheet1\$GritSize)
Statistic
Group nobs     mean       sd
-1  240 655.5507 75.33374
1   240 644.6039 73.68657```