Q9

A)

Temperature P-value = 3.25e-14

Position P-value = 0.00176

Interaction P-value = 0.427110

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.
obs<-c(570,565,583,1063,1080,1043,565,510,590,528,547,521,988,1026,1004,526,538,532)
Pos<-c(rep(1,9),rep(2,9))
Temp<-c(rep(800,3),rep(825,3),rep(850,3),rep(800,3),rep(825,3),rep(850,3))
Temp<-as.factor(Temp)
Pos<-as.factor(Pos)
dat<-data.frame(Pos,Temp,obs)
dat$Temp<-as.fixed(dat$Temp)
dat$Pos<-as.fixed(dat$Pos)
dat
##    Pos Temp  obs
## 1    1  800  570
## 2    1  800  565
## 3    1  800  583
## 4    1  825 1063
## 5    1  825 1080
## 6    1  825 1043
## 7    1  850  565
## 8    1  850  510
## 9    1  850  590
## 10   2  800  528
## 11   2  800  547
## 12   2  800  521
## 13   2  825  988
## 14   2  825 1026
## 15   2  825 1004
## 16   2  850  526
## 17   2  850  538
## 18   2  850  532
model<-lm(obs~Pos+Temp+Pos*Temp,data=dat)
gad(model)
## Analysis of Variance Table
## 
## Response: obs
##          Df Sum Sq Mean Sq  F value   Pr(>F)    
## Pos       1   7160    7160   15.998 0.001762 ** 
## Temp      2 945342  472671 1056.117 3.25e-14 ***
## Pos:Temp  2    818     409    0.914 0.427110    
## Residual 12   5371     448                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

B)

Temperature P-value = 0.0008647

Position P-value = 0.0526583

Interaction P-value = 0.42711

library(GAD)
obs<-c(570,565,583,1063,1080,1043,565,510,590,528,547,521,988,1026,1004,526,538,532)
Pos<-c(rep(1,9),rep(2,9))
Temp<-c(rep(800,3),rep(825,3),rep(850,3),rep(800,3),rep(825,3),rep(850,3))
Temp<-as.factor(Temp)
Pos<-as.factor(Pos)
dat<-data.frame(Pos,Temp,obs)
dat$Temp<-as.random(dat$Temp)
dat$Pos<-as.random(dat$Pos)
dat
##    Pos Temp  obs
## 1    1  800  570
## 2    1  800  565
## 3    1  800  583
## 4    1  825 1063
## 5    1  825 1080
## 6    1  825 1043
## 7    1  850  565
## 8    1  850  510
## 9    1  850  590
## 10   2  800  528
## 11   2  800  547
## 12   2  800  521
## 13   2  825  988
## 14   2  825 1026
## 15   2  825 1004
## 16   2  850  526
## 17   2  850  538
## 18   2  850  532
model<-lm(obs~Pos+Temp+Pos*Temp,data=dat)
gad(model)
## Analysis of Variance Table
## 
## Response: obs
##          Df Sum Sq Mean Sq  F value    Pr(>F)    
## Pos       1   7160    7160   17.504 0.0526583 .  
## Temp      2 945342  472671 1155.518 0.0008647 ***
## Pos:Temp  2    818     409    0.914 0.4271101    
## Residual 12   5371     448                       
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

C)

Temperature P-value = 3.25e-14

Position P-value = 0.05266

Interaction P-value = 0.42711

library(GAD)
obs<-c(570,565,583,1063,1080,1043,565,510,590,528,547,521,988,1026,1004,526,538,532)
Pos<-c(rep(1,9),rep(2,9))
Temp<-c(rep(800,3),rep(825,3),rep(850,3),rep(800,3),rep(825,3),rep(850,3))
Temp<-as.factor(Temp)
Pos<-as.factor(Pos)
dat<-data.frame(Pos,Temp,obs)
dat$Temp<-as.random(dat$Temp)
dat$Pos<-as.fixed(dat$Pos)
dat
##    Pos Temp  obs
## 1    1  800  570
## 2    1  800  565
## 3    1  800  583
## 4    1  825 1063
## 5    1  825 1080
## 6    1  825 1043
## 7    1  850  565
## 8    1  850  510
## 9    1  850  590
## 10   2  800  528
## 11   2  800  547
## 12   2  800  521
## 13   2  825  988
## 14   2  825 1026
## 15   2  825 1004
## 16   2  850  526
## 17   2  850  538
## 18   2  850  532
model<-lm(obs~Pos+Temp+Pos*Temp,data=dat)
gad(model)
## Analysis of Variance Table
## 
## Response: obs
##          Df Sum Sq Mean Sq  F value   Pr(>F)    
## Pos       1   7160    7160   17.504  0.05266 .  
## Temp      2 945342  472671 1056.117 3.25e-14 ***
## Pos:Temp  2    818     409    0.914  0.42711    
## Residual 12   5371     448                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

D)

Temperature P- value when changed from fixed to random increases a lot, however it still remains significant at an alpha of 0.05.

In the other hand, Position P-value when changed from fixed to random its also increases, however it becomes non significant when its random at an alpha of 0.05.

The interaction P-value remains the same independently of fixed or random.