You are on page 1of 5

Tutorial 10

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 is the plate material for the battery, and he has three possible choices.
When the device is manufactured and is shipped to the field, the engineer has no
control over the temperature extremes that the device will encounter, and he
knows from experience that temperature will probably affect the effective battery
life. However, temperature can be controlled in the product development
laboratory for the purposes of a test.
The engineer decides to test all three plate materials at three temperature levels
15,70 and 125F- because these temperature levels 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 random order. The
experiment and the resulting observed battery life data are given in the file
battery (life is given in hours).
The engineer wants to answer the following questions:
1. What effects do material type and temperature have on the life of the
battery?
2. Is there any choice of material that would give uniformly long life
regardless of temperature?
Perform the analysis of the data and write a report for the client as if you were
the engineer.

Analysis
1.
2.
3.
4.
5.
6.
7.

Make clear the aim of the study


Look at the data (interaction plot): descriptive statistics
Write a model
Fit the model
Diagnostic check
Results
Write a report (introduction, methods, results, conclusion, appendix)

Commands
#Factor variables
battery$Material <- factor(battery$Material)
battery$Temp <- factor(battery$Temp)

#Ordering variables
battery$Material <ordered(battery$Material,c("1","2","3"))
battery$Temp <- ordered(battery$Temp,c("15","70","125"))

#Defining contrasts
contrasts(battery$Material) <- contr.sum(3)
contrasts(battery$Temp) <- contr.sum(3)
#Fitting the model
yfit <- lm(Life~Temp*Material,data=battery)
summary(yfit)

#Checking assumptions
qqnorm(resid(yfit))
plot(as.numeric(battery$Temp),resid(yfit))
plot(as.numeric(battery$Material),resid(yfit))
plot(fitted(yfit),resid(yfit))

#Testing hypothesis of the interaction effect


anova(yfit)

Report Sample
Introduction
Company Fake makes batteries with long life that can be exposed to extreme
temperature changes.
An experiment was conducted to investigate if different materials produce
different expected life for batteries regarding distinct temperatures. And if any of
these three materials performs better. The materials considered are: type1, type
2 and type 3, and the temperature levels considered are: 15, 70 and 125 F.
Methods
A linear regression model was fitted, regarding Material and Temperature and
their interaction. These predictors were considered as factors.
Model Yijk = mu + Ti + Bj + (TB)ij +Eijk

Where T, B and TB represent temperature, material and interaction effects,


respectively.
A diagnostic analysis was performed and a test of hypothesis for the interaction
effect.

Results
In the model adequacy checking no deviations from normality were observed.
Some mild suggestions of non equal variances were observed indicating that
outliers could be present, but after checking with the company it was confirmed
that they were right observations.
As the experiment was randomized in all the possible phases the assumption of
independence is assumed to be hold.
Anova table for battery data
Analysis of Variance Table
Response: Life
Terms added sequentially (first to last)
Df Sum of Sq Mean Sq F Value
Pr(F)
Temp 2 39118.72 19559.36 28.96769 0.00000019
Material 2 10683.72 5341.86 7.91137 0.00197608
Temp:Material 4
9613.78 2403.44 3.55954 0.01861117
Residuals 27 18230.75
675.21
There was some evidence of an interaction effect between material type and
temperature level (p=0.019). The next plot gives an idea about how they interact
with each other.

160
140

Material

100
60

80

mean of Life

120

3
1
2

15

70

125
Temp

In general, longer life is attained at low temperature, regardless of material type.


Changing from low to intermediate temperature, battery life with material type 3
actually increases, whereas it decreases for types 1 and 2. From intermediate to
high temperature, battery life decreases for material types 2 and 3 and is
essentially unchanged for type 1.

Conclusion and discussion

Material type 3 gives the best results if the interest is to achieve less loss of
effective life as the temperature changes.
In this analysis is possible to make multiple comparison of means response for
different levels of material and temperature, and in this way check more formally
the differences in levels of combination material-temperature.

Appendix
Model
Call: lm(formula = Life ~ Temp * Material, data = battery)
Residuals:
Min
1Q Median
3Q
Max

-60.75 -14.63

1.375 17.94 45.25

Coefficients:
(Intercept)
Temp1
Temp2
Material1
Material2
Temp1Material1
Temp2Material1
Temp1Material2
Temp2Material2

Value Std. Error


105.5278
4.3308
-18.6250
5.3041
-20.6806
3.0623
-22.3611
6.1247
2.8056
6.1247
-20.1250
7.5012
7.8472
4.3308
0.6250
7.5012
-8.7361
4.3308

t value
24.3668
-3.5114
-6.7532
-3.6510
0.4581
-2.6829
1.8120
0.0833
-2.0172

Pr(>|t|)
0.0000
0.0016
0.0000
0.0011
0.6506
0.0123
0.0811
0.9342
0.0537

You might also like