In: Statistics and Probability
An engineer is designing a battery for use in a device that will be subjected to some extreme variations in temperature. The only design parameter that he can select at this point is the plate material for the battery, and he has three possible choices (1, 2, and 3). The engineer decides to test all three plate materials at three temperature levels (15°F, 70°F, and 125°F) because these temperatures are consistent with the product end-use environment. Four batteries are tested at each combination of plate material and temperature, and all 36 tests are run in completely random order. The response is the life of the battery in hours. Confirm that the interaction term is significant and then draw and interpret the Interaction Plot.
Type | Temperature | Life |
1 | 15 | 130 |
1 | 15 | 74 |
1 | 15 | 155 |
1 | 15 | 180 |
1 | 70 | 34 |
1 | 70 | 80 |
1 | 70 | 40 |
1 | 70 | 75 |
1 | 125 | 20 |
1 | 125 | 82 |
1 | 125 | 70 |
1 | 125 | 58 |
2 | 15 | 150 |
2 | 15 | 159 |
2 | 15 | 188 |
2 | 15 | 126 |
2 | 70 | 136 |
2 | 70 | 122 |
2 | 70 | 106 |
2 | 70 | 115 |
2 | 125 | 25 |
2 | 125 | 58 |
2 | 125 | 70 |
2 | 125 | 45 |
3 | 15 | 138 |
3 | 15 | 168 |
3 | 15 | 110 |
3 | 15 | 160 |
3 | 70 | 174 |
3 | 70 | 150 |
3 | 70 | 120 |
3 | 70 | 139 |
3 | 125 | 96 |
3 | 125 | 82 |
3 | 125 | 104 |
3 | 125 | 60 |
# reding the data
>df = read.csv(file.choose(),header = T)
> str(df)
'data.frame': 36 obs. of 3 variables: $ Type : Factor w/ 3 levels "1","2","3": 1 1 1 1 1 1 1 1 1 1 ... $ Temperature: Factor w/ 3 levels "15","70","125": 1 1 1 1 2 2 2 2 3 3 ... $ Life : int 130 74 155 180 34 80 40 75 20 82 ... # converting type into factor variable > df$Type = factor(df$Type) > df$Temperature = factor(df$Temperature) > str(df) 'data.frame': 36 obs. of 3 variables: $ Type : Factor w/ 3 levels "1","2","3": 1 1 1 1 1 1 1 1 1 1 ... $ Temperature: Factor w/ 3 levels "15","70","125": 1 1 1 1 2 2 2 2 3 3 ... $ Life : int 130 74 155 180 34 80 40 75 20 82 ... > head(df) Type Temperature Life 1 1 15 130 2 1 15 74 3 1 15 155 4 1 15 180 5 1 70 34 6 1 70 80 > mod = lm(Life~Type*Temperature, data = df) > res = aov(mod, data = df) > summary(res) Df Sum Sq Mean Sq F value Pr(>F) Type 2 10684 5342 7.911 0.00198 ** Temperature 2 39119 19559 28.968 1.91e-07 *** Type:Temperature 4 9614 2403 3.560 0.01861 * Residuals 27 18231 675 --- Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1 #since the p- value of interaction term is 0.018 which is less than 0.05, so we can conclude that the interaction term is significant. > interaction.plot(x.factor = df$Temperature, + trace.factor = df$Type, + response = df$Life, + fun = mean, + type="b", + col=c("black","red","green"), + pch=c(19, 17, 15), + fixed=TRUE, ### Order by factor order in data + leg.bty = "o")
The plot suggest that the effect of type1 material is consistent at 70°F and 125°F but no t in 15°F, effect of type 2 material is not consistent across all three temperature and effect of type 3 material is consistent at 15°F and 70°F but not in 125°F. While type 2 showed greatest mean life in 15°F and type 2 showed greatest mean life in 70°F and 125°F.