position<-c(rep(1,9),rep(2,9))
t<-c(800,825,850)            
temp<-rep(t,6)
obs<-c(570,1063,565,565,1080,510,583,1043,590,528,988,526,547,1026,538,521,1004,532)
dat<-data.frame(position,temp,obs)
library(GAD)
## Warning: package 'GAD' was built under R version 4.1.3
## Loading required package: matrixStats
## Warning: package 'matrixStats' was built under R version 4.1.3
## Loading required package: R.methodsS3
## Warning: package 'R.methodsS3' was built under R version 4.1.3
## R.methodsS3 v1.8.2 (2022-06-13 22:00:14 UTC) successfully loaded. See ?R.methodsS3 for help.

Question 1

position<-as.fixed(position)
temp<-as.fixed(temp)
model<-aov(obs~position*temp+position+temp)
GAD::gad(model)
## Analysis of Variance Table
## 
## Response: obs
##               Df Sum Sq Mean Sq  F value   Pr(>F)    
## position       1   7160    7160   15.998 0.001762 ** 
## temp           2 945342  472671 1056.117 3.25e-14 ***
## position:temp  2    818     409    0.914 0.427110    
## Residual      12   5371     448                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

The p-value for position is 0.001762 (highly significant at 0.05)

The p-value for temp is 3.25e-14 (highly significant at 0.05)

The p-value for position and temp (0.427110) insignificant at 0.05

Question 2

position<-as.random(position)
temp<-as.random(temp)
model2<-aov(obs~position*temp+position+temp)
GAD::gad(model2)
## Analysis of Variance Table
## 
## Response: obs
##               Df Sum Sq Mean Sq  F value    Pr(>F)    
## position       1   7160    7160   17.504 0.0526583 .  
## temp           2 945342  472671 1155.518 0.0008647 ***
## position:temp  2    818     409    0.914 0.4271101    
## Residual      12   5371     448                       
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

The p-value for position is 0.0526583(significant at 0.05)

The p-value for temp is 0.0008647 (highly significant at 0.05)

The p-value for position and temp (0.4271101) insignificant at 0.05

Question 3

position<-as.fixed(position)
temp<-as.random(temp)
model3<-aov(obs~position*temp+position+temp)
GAD::gad(model3)
## Analysis of Variance Table
## 
## Response: obs
##               Df Sum Sq Mean Sq  F value   Pr(>F)    
## position       1   7160    7160   17.504  0.05266 .  
## temp           2 945342  472671 1056.117 3.25e-14 ***
## position:temp  2    818     409    0.914  0.42711    
## Residual      12   5371     448                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

The p-value for position is 0.05266 (significant at 0.05)

The p-value for temp is 3.25e-14 (highly significant at 0.05)

The p-value for position and temp (0.42711 ) insignificant at 0.05

#Question 4

#P-values (position, temperature, position:temperature) are nearly significant the same levels for question A,B and C