You work at a chemical processing firm. The engineers are testing new formulations of a commercial grade lubricant. This lubricant will be used in high use heavy machinery.
They want to know how long each formulation lasts in general, but also how the formulations last under different temperatures and following different storage temperatures. Since these are initial tests they have simplified the predictor variables by forming categories (low, medium, high heat). These tests were performed across three different machines which might vary in some ways.
Your task is to provide answers to their questions. Make sure to check the assumptions of your model and to provide a well written summary of the findings.
Weekly_Lab_4=read.csv("C:/Users/jcolu/OneDrive/Documents/Harrisburg/Summer 2018/ANLY 510/Weekly Lab 4.csv")
Weekly_Lab_4
## Running.Temperature Storage.Temperature Formulation Machine
## 1 high high F1 M1
## 2 high high F1 M3
## 3 high high F1 M2
## 4 low high F1 M2
## 5 low high F1 M3
## 6 low high F1 M1
## 7 med high F1 M2
## 8 med high F1 M3
## 9 med high F1 M1
## 10 high low F1 M2
## 11 high low F1 M3
## 12 high low F1 M1
## 13 low low F1 M1
## 14 low low F1 M3
## 15 low low F1 M2
## 16 med low F1 M3
## 17 med low F1 M2
## 18 med low F1 M1
## 19 high med F1 M1
## 20 high med F1 M2
## 21 high med F1 M3
## 22 low med F1 M3
## 23 low med F1 M2
## 24 low med F1 M1
## 25 med med F1 M3
## 26 med med F1 M2
## 27 med med F1 M1
## 28 high high F2 M2
## 29 high high F2 M1
## 30 high high F2 M3
## 31 low high F2 M2
## 32 low high F2 M3
## 33 low high F2 M1
## 34 med high F2 M1
## 35 med high F2 M2
## 36 med high F2 M3
## 37 high low F2 M3
## 38 high low F2 M1
## 39 high low F2 M2
## 40 low low F2 M1
## 41 low low F2 M2
## 42 low low F2 M3
## 43 med low F2 M3
## 44 med low F2 M1
## 45 med low F2 M2
## 46 high med F2 M1
## 47 high med F2 M2
## 48 high med F2 M3
## 49 low med F2 M3
## 50 low med F2 M2
## 51 low med F2 M1
## 52 med med F2 M1
## 53 med med F2 M2
## 54 med med F2 M3
## 55
## Life.in.Hours
## 1 25
## 2 16
## 3 20
## 4 27
## 5 24
## 6 26
## 7 26
## 8 26
## 9 20
## 10 24
## 11 24
## 12 29
## 13 39
## 14 38
## 15 38
## 16 32
## 17 29
## 18 30
## 19 25
## 20 21
## 21 22
## 22 23
## 23 32
## 24 33
## 25 32
## 26 33
## 27 28
## 28 26
## 29 24
## 30 24
## 31 34
## 32 28
## 33 31
## 34 26
## 35 31
## 36 30
## 37 27
## 38 29
## 39 32
## 40 47
## 41 46
## 42 40
## 43 35
## 44 31
## 45 38
## 46 33
## 47 21
## 48 29
## 49 27
## 50 39
## 51 43
## 52 32
## 53 42
## 54 37
## 55 NA
Determine Data Type.
str(Weekly_Lab_4)
## 'data.frame': 55 obs. of 5 variables:
## $ Running.Temperature: Factor w/ 4 levels "","high","low",..: 2 2 2 3 3 3 4 4 4 2 ...
## $ Storage.Temperature: Factor w/ 4 levels "","high","low",..: 2 2 2 2 2 2 2 2 2 3 ...
## $ Formulation : Factor w/ 3 levels "","F1","F2": 2 2 2 2 2 2 2 2 2 2 ...
## $ Machine : Factor w/ 4 levels "","M1","M2","M3": 2 4 3 3 4 2 3 4 2 3 ...
## $ Life.in.Hours : int 25 16 20 27 24 26 26 26 20 24 ...
There is not a need to factorize data.
Next step is to subset the data set accordoing to the Formulation
F1=subset(Weekly_Lab_4,Weekly_Lab_4$Formulation=="F1",select = c("Running.Temperature", "Storage.Temperature","Life.in.Hours", "Machine"))
F1
## Running.Temperature Storage.Temperature Life.in.Hours Machine
## 1 high high 25 M1
## 2 high high 16 M3
## 3 high high 20 M2
## 4 low high 27 M2
## 5 low high 24 M3
## 6 low high 26 M1
## 7 med high 26 M2
## 8 med high 26 M3
## 9 med high 20 M1
## 10 high low 24 M2
## 11 high low 24 M3
## 12 high low 29 M1
## 13 low low 39 M1
## 14 low low 38 M3
## 15 low low 38 M2
## 16 med low 32 M3
## 17 med low 29 M2
## 18 med low 30 M1
## 19 high med 25 M1
## 20 high med 21 M2
## 21 high med 22 M3
## 22 low med 23 M3
## 23 low med 32 M2
## 24 low med 33 M1
## 25 med med 32 M3
## 26 med med 33 M2
## 27 med med 28 M1
F2=subset(Weekly_Lab_4,Weekly_Lab_4$Formulation=="F2",select = c("Running.Temperature", "Storage.Temperature","Life.in.Hours","Machine"))
F2
## Running.Temperature Storage.Temperature Life.in.Hours Machine
## 28 high high 26 M2
## 29 high high 24 M1
## 30 high high 24 M3
## 31 low high 34 M2
## 32 low high 28 M3
## 33 low high 31 M1
## 34 med high 26 M1
## 35 med high 31 M2
## 36 med high 30 M3
## 37 high low 27 M3
## 38 high low 29 M1
## 39 high low 32 M2
## 40 low low 47 M1
## 41 low low 46 M2
## 42 low low 40 M3
## 43 med low 35 M3
## 44 med low 31 M1
## 45 med low 38 M2
## 46 high med 33 M1
## 47 high med 21 M2
## 48 high med 29 M3
## 49 low med 27 M3
## 50 low med 39 M2
## 51 low med 43 M1
## 52 med med 32 M1
## 53 med med 42 M2
## 54 med med 37 M3
Question 1: How long does each formulation last?
tapply(X=Weekly_Lab_4$Life.in.Hours,INDEX = Weekly_Lab_4$Formulation,FUN = mean)
## F1 F2
## NA 27.48148 32.66667
Question 2: How long does each formulation last under different temperatures?
F1 Running Temperature
tapply(X=F1$Life.in.Hours,INDEX = F1$Running.Temperature,FUN = mean)
## high low med
## NA 22.88889 31.11111 28.44444
F1 Storage Temperature
tapply(X=F1$Life.in.Hours,INDEX = F1$Storage.Temperature,FUN = mean)
## high low med
## NA 23.33333 31.44444 27.66667
F2 Running Temperature
tapply(X=F2$Life.in.Hours,INDEX = F2$Running.Temperature,FUN = mean)
## high low med
## NA 27.22222 37.22222 33.55556
F2 Storage Temperature
tapply(X=F2$Life.in.Hours,INDEX = F2$Storage.Temperature,FUN = mean)
## high low med
## NA 28.22222 36.11111 33.66667
Conclusions