Question9

P<-c(rep(1,9),rep(2,9))
Temp<-rep(c(1,2,3),6)
obs<-c(570,1063,565,565,1080,510,583,1043,590,528,988,526,547,1026,538,521,1004,532)
library("GAD")
P<-as.fixed(P)
Temp<-as.fixed(Temp)

(a) Assume that both Temperature and Position are fixed effects. Report p-values

P<-as.fixed(P)
Temp<-as.fixed(Temp)
model<-aov(obs~P*Temp)
summary(model)
##             Df Sum Sq Mean Sq  F value   Pr(>F)    
## P            1   7160    7160   15.998  0.00176 ** 
## Temp         2 945342  472671 1056.117 3.25e-14 ***
## P:Temp       2    818     409    0.914  0.42711    
## Residuals   12   5371     448                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

comments: The interaction term is not significant we fail to reject null hypothesis(We got P value(0.42711) as far greater than 0.05(significance level)).

we need to check if main effects make sense are not.

model1<-aov(obs~P+Temp)
summary(model1)
##             Df Sum Sq Mean Sq F value   Pr(>F)    
## P            1   7160    7160    16.2  0.00125 ** 
## Temp         2 945342  472671  1069.3 4.92e-16 ***
## Residuals   14   6189     442                     
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Comments: Main effects make sense they are significantly effecting the model we can reject null hypothesis as we got p-value of position as 0.00125 and p-value of Temperature effect is \(4.92e^{-16}\).firing temperature and furnace position affects the baked density of a carbon anode.

(b)Assume that both Temperature and Position are random effects. Report p-values

P<-c(rep(1,9),rep(2,9))
Temp<-rep(c(1,2,3),6)
library("GAD")
P<-as.random(P)
Temp<-as.random(Temp)
model2<-aov(obs~P*Temp)
gad(model2)
## Analysis of Variance Table
## 
## Response: obs
##          Df Sum Sq Mean Sq  F value    Pr(>F)    
## P         1   7160    7160   17.504 0.0526583 .  
## Temp      2 945342  472671 1155.518 0.0008647 ***
## P:Temp    2    818     409    0.914 0.4271101    
## Residual 12   5371     448                       
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
model3<-aov(obs~P+Temp)
gad(model3)
## Analysis of Variance Table
## 
## Response: obs
##          Df Sum Sq Mean Sq  F value    Pr(>F)    
## P         1   7160    7160   16.197  0.001254 ** 
## Temp      2 945342  472671 1069.257 4.924e-16 ***
## Residual 14   6189     442                       
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Comments; We got P value for Position effect is 0.001254 and for Temperature effect is \(4.924e^{-16}\)

(C) Assume the Position effect is fixed and the Temperature effect is random. Report p-values

P<-c(rep(1,9),rep(2,9))
Temp<-rep(c(1,2,3),6)
library("GAD")
P<-as.fixed(P)
Temp<-as.random(Temp)
model4<-aov(obs~P*Temp)
gad(model4)
## Analysis of Variance Table
## 
## Response: obs
##          Df Sum Sq Mean Sq  F value   Pr(>F)    
## P         1   7160    7160   17.504  0.05266 .  
## Temp      2 945342  472671 1056.117 3.25e-14 ***
## P:Temp    2    818     409    0.914  0.42711    
## Residual 12   5371     448                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
model5<-aov(obs~P+Temp)
gad(model5)
## Analysis of Variance Table
## 
## Response: obs
##          Df Sum Sq Mean Sq  F value    Pr(>F)    
## P         1   7160    7160   16.197  0.001254 ** 
## Temp      2 945342  472671 1069.257 4.924e-16 ***
## Residual 14   6189     442                       
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Comments: We got P value for Position effect is 0.001254 and for Temperature effect is \(4.924e^{-16}\)

(d) Comment on similarities and/or differences between the p-values in parts a,b,c.

Answer; From the final model of all above parts we can conclude by considering the temperature, position as fixed, random effects , Mixed there is no change in p values . In all the above parts the interaction effect is not significant. only the main effects make sense. P values are same for all the final models of part(a,b,c)