library(GAD)
## Loading required package: matrixStats
## Loading required package: R.methodsS3
## R.methodsS3 v1.8.2 (2022-06-13 22:00:14 UTC) successfully loaded. See ?R.methodsS3 for help.
temp <- c(0.15,0.18,0.20,0.25)
depth <- rep(temp,9)
feed <- c(rep(rep(0.2,4),3),rep(rep(0.25,4),3),rep(rep(0.3,4),3))
obs <- c(74,79,82,99,
64,68,88,104,
60,73,92,96,
92,98,99,104,
86,104,108,110,
88,88,95,99,
99,104,108,114,
98,99,110,111,
102,95,99,107)
data <- data.frame(feed,depth,obs)
data$feed <- as.fixed(data$feed)
data$depth <- as.fixed(data$depth)
Since the test idea is to test if both feed rate and depth of cut influences in the surface finish, we need to consider a linear equation that accounts for the interaction between both.
Linear equation:
\[ y_{ijk}=\mu+\alpha_i+\beta_j+\alpha\beta_{ij}+\epsilon_{ijk} \]
From the linear equation, we are going to perform the following:
\[ Ho: \alpha\beta_{ij} = 0\\ Ha: \alpha\beta_{ij} \neq 0 \]
model.aov.1 <- aov(obs~depth+feed+depth*feed,data = data)
summary(model.aov.1)
## Df Sum Sq Mean Sq F value Pr(>F)
## depth 3 2125.1 708.4 24.663 1.65e-07 ***
## feed 2 3160.5 1580.2 55.018 1.09e-09 ***
## depth:feed 6 557.1 92.8 3.232 0.018 *
## Residuals 24 689.3 28.7
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
From the test, it is possible to see that we can successfully reject Ho and understand that there is a significant interaction between the depth and feed rate that influences the observations.
plot(model.aov.1,1)
plot(model.aov.1,2)
From the plots, we can see that the variance is fairly constant and that the data is fairly normal.
This indicates that the model is adequate to solve the problem.
From the test, the p-values are:
temp <- rep(c(800,825,850),6)
pos <- c(rep(1,3),rep(2,3))
obs <- c(570,1063,565,
565,1080,510,
583,1043,590,
528,988,526,
547,1026,538,
521,1004,532)
data <- data.frame(temp,pos,obs)
data$pos <- as.random(data$pos)
data$temp <- as.fixed(data$temp)
Since there is no interaction between the statistical model is the following:
\[ y_{ijk}=\mu+\alpha_i+\beta_j+\epsilon_{ijk} \]
\[ H_o:\alpha_i=0\\ H_a:\alpha_i\neq0 \]
\[ H_o:\beta_j=0\\ H_a:\beta_j\neq0 \]
model.aov.3 <- aov(obs~pos+temp,data = data)
summary(model.aov.3)
## Df Sum Sq Mean Sq F value Pr(>F)
## pos 1 4080 4080 6.163 0.0263 *
## temp 2 945342 472671 713.945 8.14e-15 ***
## Residuals 14 9269 662
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
From the ANOVA analysis, we can conclude that both main effects influence in the response of the dnsity.
That’s because both p-values are lesser than alpha (for an alpha equals to 0.05) and, therefore, we can reject Ho for both hypothesis.
plot(model.aov.3,1)
plot(model.aov.3,2)
From the plots above, we can see that the data is fairly normal, but that the variance is not that constant.
Therefore, a transformation would be the ideal before testing the data.
operator <- rep(seq(1,3),10)
part <- seq(1,10)
obs <- c(50,49,50,50,48,51,
52,52,51,51,51,51,
53,50,50,54,52,51,
49,51,50,48,50,51,
48,49,48,48,49,48,
52,50,50,52,50,50,
51,51,51,51,50,50,
52,50,49,53,48,50,
50,51,50,51,48,49,
47,46,49,46,47,48)
data <- data.frame(operator,part,obs)
data$operator <- as.fixed(data$operator)
data$part <- as.random(data$part)
\[ H_o: \alpha\beta_{ij} = 0 \\ H_a: \alpha\beta_{ij} \neq 0 \]
model.aov.4 <- aov(obs~operator+part+operator*part,data = data)
summary(model.aov.4)
## Df Sum Sq Mean Sq F value Pr(>F)
## operator 2 6.70 3.350 2.680 0.084944 .
## part 9 18.02 2.002 1.601 0.159867
## operator:part 18 102.63 5.702 4.561 0.000127 ***
## Residuals 30 37.50 1.250
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
From the test, it is possible to see that the interation between the operator and the part is completely significant. In other words, we can successfully reject Ho \(p-value = 0.0001 < alpha = 0.05\)
plot(model.aov.4,1)
From the plot we can check that the variance does not change a lot between the levels.
Therefore, we can assume that this model is appropriate for this analysis.