Q4.3)

Hypothesis:

  • Null Hypothesis:

    \(H_o : \mu_1 = \mu_2 = \mu_3 =\mu_i\)

  • Alternative Hypothesis:

    \(Ha\) : atleast one \(\mu_i\) differs

As we know it has fixed effects hence we can write our hypothesis as,

  • Null Hypothesis:

    \(H_o : \tau_i=0\) for all i

  • Alternative Hypothesis:

    \(H_a\) : \(\tau_i \neq 0\) for some i

Linear Effects:

\(y_{ij} = \mu + \tau_i + \beta_j + \epsilon_{ij}\)

Where \(\mu\) is the grand mean

Where \(\tau_i\) is the fixed effects for treatment i

Where \(\beta_j\) is the block effect for j

Where \(\epsilon_{ij}\) is the random error

chemical <- c(rep(1,5),rep(2,5),rep(3,5),rep(4,5))
bolts <- c(rep(seq(1,5),4))
obs <- c(73,68,74,71,67,73,67,75,72,70,75,68,78,73,68,73,71,75,75,69)
chemical <- as.fixed(chemical)
bolts <- as.fixed(bolts)
model1 <- lm(obs~chemical+bolts)
gad(model1)
## Analysis of Variance Table
## 
## Response: obs
##          Df Sum Sq Mean Sq F value    Pr(>F)    
## chemical  3  12.95   4.317  2.3761    0.1211    
## bolts     4 157.00  39.250 21.6055 2.059e-05 ***
## Residual 12  21.80   1.817                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Answer - As we can see from general anova design test we got p value as 0.1211 which is greater than 0.05 , hence we can claim that we fail to reject Null Hypothesis i.e we can say there is no difference among chemical on cloth even including nuisiance variabilty of bolts

4.16) Find value for \(\tau_i\) and \(beta_j\) in above question

Calculating \(\tau_i\) first for all i

As we know \(\tau_i = \mu_i - \mu\)

tau_1 <- mean(obs[1:5])-mean(obs)
tau_1
## [1] -1.15
tau_2 <- mean(obs[6:10])-mean(obs)
tau_2
## [1] -0.35
tau_3 <- mean(obs[11:15])-mean(obs)
tau_3
## [1] 0.65
tau_4 <- mean(obs[16:20])-mean(obs)
tau_4
## [1] 0.85

Answer for \(\tau_i\) we can see that ,

\(\tau_1 =\) -1.15

\(\tau_2 =\) -0.35

\(\tau_3 =\) 0.65

\(\tau_4 =\) 0.85

Calculating \(\beta_j\) first for all j

As we know \(\beta_j = \mu_j - \mu\)

beta_1 <- mean(c(73,73,75,73))-mean(obs)
beta_1
## [1] 1.75
beta_2 <-  mean(c(68,67,68,71))-mean(obs)
beta_2
## [1] -3.25
beta_3 <-  mean(c(74,75,78,75))-mean(obs)
beta_3
## [1] 3.75
beta_4 <-  mean(c(71,72,73,75))-mean(obs)
beta_4
## [1] 1
beta_5 <-  mean(c(67,70,68,69))-mean(obs)
beta_5
## [1] -3.25

Answer for \(\beta_i\) we can see that ,

\(\beta_1 =\) 1.75

\(\beta_2 =\) -3.25

\(\beta_3 =\) 3.75

\(\beta_4 =\) 1

\(\beta_5 =\) -3.25

Q4.22)

Hypothesis:

  • Null Hypothesis:

    \(H_o : \mu_1 = \mu_2 = \mu_3 =\mu_i\)

  • Alternative Hypothesis:

    \(Ha\) : atleast one \(\mu_i\) differs

As we know it has fixed effects hence we can write our hypothesis as,

  • Null Hypothesis:

    \(H_o : \tau_i=0\) for all i

  • Alternative Hypothesis:

    \(H_a\) : \(\tau_i \neq 0\) for some i

Linear Effects Equation:

\(y_{ijk} = \mu + \tau_i + \beta_j +\gamma_k + \epsilon_{ijk}\)

Where \(\mu\) is the grand mean

Where \(\tau_i\) is the fixed effects for treatment i

Where \(\beta_j\) is the block effect for j

Where \(\gamma_k\) is the block effect for k

Where \(\epsilon_{ijk}\) is the random error

batch <- c(rep(1,5),rep(2,5),rep(3,5),rep(4,5),rep(5,5))
Day <- c(rep(seq(1,5),5))
ingred <- c("A","B","D","C","E","C","E","A","D","B","B","A","C","E","D","D","C","E","B","A","E","D","B","A","C")
obs <- c(8,7,1,7,3,11,2,7,3,8,4,9,10,1,5,6,8,6,6,10,4,2,3,8,8)
dat <- cbind(batch,Day,ingred,obs)
dat <- as.data.frame(dat)
dat$batch <- as.fixed(dat$batch)
dat$Day <- as.fixed(dat$Day)
dat$ingred <- as.fixed(dat$ingred)

model3 <- lm(dat$obs~dat$batch+dat$Day+dat$ingred,data = dat)
anova(model3)
## Analysis of Variance Table
## 
## Response: dat$obs
##            Df Sum Sq Mean Sq F value    Pr(>F)    
## dat$batch   4  15.44   3.860  1.2345 0.3476182    
## dat$Day     4  12.24   3.060  0.9787 0.4550143    
## dat$ingred  4 141.44  35.360 11.3092 0.0004877 ***
## Residuals  12  37.52   3.127                      
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Answer -As we can see from anova test on Latin Square model , it gave p value of 0.3476 , which is greater than 0.05 , which means we fail to reject Null Hypothesis and state there is no difference among batch for given known nuisance variability of Days and ingredients. As we blocked both of them.

And of the p value of Day = 0.455 > 0.05 , it shows that blocking this was a good decision as it is significant if checked with confidence interval of 95%

For P value of ingredients = 0.0004877 which is smaller than 0.05 , which shows that nuisance variability given by this was not significant. But we still blocked it as it was a known source of nuisance. We know statisticians do not go backward in their calculations, even if it was not significant we will live with it , as we already blocked it. The main reason of blocking in first place was, as it was also a source of known nuisance variability