This is a Nested design, where machine is the principal factor and spindle is the nested factor within the machine.
Also, we will assume the nested effect is random instead of fixed.
Model Equation\[ Y_ijk=\mu+\alpha_i+\beta_{j(i)}+\epsilon_{ijk} \]
where,
\(\alpha_i\)=Factor A (Machine) with 3 levels āiā
\(\beta_{j(i)}\)=Factor B (spindle) with 2 levels ājā
\(\epsilon_ijk\)= Standard Error Term
Reading the Data:
Machine <- c(rep(1,8), rep(2,8), rep(3,8))
Spindle <- rep(c(rep(1,4), rep(2,4)), 3)
Values <- c(12, 9, 11, 12, 8, 9, 10, 8, 14, 15, 13, 14, 12, 10, 11, 13, 14, 10, 12, 11, 16, 15, 15, 14)
library(GAD)
Machine<-as.fixed(Machine)
Spindle<-as.random(Spindle)
Data <- data.frame(Machine, Spindle, Values)
Data
## Machine Spindle Values
## 1 1 1 12
## 2 1 1 9
## 3 1 1 11
## 4 1 1 12
## 5 1 2 8
## 6 1 2 9
## 7 1 2 10
## 8 1 2 8
## 9 2 1 14
## 10 2 1 15
## 11 2 1 13
## 12 2 1 14
## 13 2 2 12
## 14 2 2 10
## 15 2 2 11
## 16 2 2 13
## 17 3 1 14
## 18 3 1 10
## 19 3 1 12
## 20 3 1 11
## 21 3 2 16
## 22 3 2 15
## 23 3 2 15
## 24 3 2 14
Hypothesis
Nested Factor - Spindle:
Null:\[H_o:\sigma{_{\beta}}^{2}=0\]
Alternate:\[H_a:\sigma{_{\beta}}^{2}\neq0\]
Principle Factor - Machine:
Null:\[\alpha_i=0\]
Alternate:\[\alpha_i\neq0\]
Analysis#Spindle Nested with Machine
Model <- lm(Values~Machine+Spindle%in%Machine)
gad(Model)
## Analysis of Variance Table
##
## Response: Values
## Df Sum Sq Mean Sq F value Pr(>F)
## Machine 2 55.75 27.8750 1.9114 0.2915630
## Machine:Spindle 3 43.75 14.5833 9.9057 0.0004428 ***
## Residual 18 26.50 1.4722
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Model Adequacy
library(ggplot2)
library(ggfortify)
autoplot(Model,col="blue")
&
Conclusion --> The p-value for Principle Factor (Machine) is = 0.2915630 which is greater than alpha = 0.05. Hence, we fail to reject the null hypothesis & conclude that machine does not have a significant effect on the model& & the p-value for Nested Factor (Spindle) is = 0.0004428 which is less then alpha = 0.05. Hence, we reject the null hypothesis & conclude that spindle does have a significant effect on the modelMachine <- c(rep(1,8), rep(2,8), rep(3,8))
Spindle <- rep(c(rep(1,4), rep(2,4)), 3)
Values <- c(12, 9, 11, 12, 8, 9, 10, 8, 14, 15, 13, 14, 12, 10, 11, 13, 14, 10, 12, 11, 16, 15, 15, 14)
Library(GAD)
Machine<-as.fixed(Machine)
Spindle<-as.random(Spindle)
Data <- data.frame(Machine, Spindle, Values)
Data
Model <- lm(Values~Machine+Spindle%in%Machine)
gad(Model)
library(ggfortify)
library(ggplot2)
autoplot(Model)