A manufacturer of air conditioning ducts is concerned about the variability of the tensile strength of the sheet metal among the many suppliers of this material. Four samples of sheet metal from four randomly chosen suppliers are tested for tensile strength. The data are given in a. the null hypothesis would be that variance among suppliers is 0 while the alternate would be that the variance among the suppliers is not 0. Looking at the output we have where the F value is 19.044 and the p value is really low, we would reject the null hypothesis, we have significant evidence that the variance in mean tensile strength among suppliers is greater than 0. b. the estimated variance is the mean sum of squares of the residuals which is 139.65 and the estimated variance is the mean sum of squares minus the residuals mean sum of squares and dividing it by the number of levels (which in this case is 4) which would bring us to 629.94

setwd("/Users/harijoshi/Desktop/Spring 2024/STAT 516/HW6")
aird <- read.csv("datatab_6_26.prn", sep = " ")
boxplot(tensile ~ supplier, data = aird)

supplier <- as.factor(aird$supplier)
tensile <- aird$tensile
airdlm <- lm(tensile ~ supplier)
anovair <- anova(airdlm)
anovair
Analysis of Variance Table

Response: tensile
          Df Sum Sq Mean Sq F value    Pr(>F)    
supplier   3 7978.2 2659.40  19.044 7.401e-05 ***
Residuals 12 1675.7  139.65                      
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot(anovair)

plot(airdlm)

Q4 CH 10: for the experiment on growth of cottton, it is a classical split plot design, since the boxplot of the blooming rate and the variety shows that the brate of variety 4 has the most variance, the majority of the observations are in the upper end along with variety 4, making them the highest blooming varieties. in the boxplot for mrate and variety, the means are roughly the same however there is a lot of variance between them. the boxplot for treatments and the brate show that the 2nd treatment shows a better blooming rate as compared to the 1 treatment, but treatment 2 does have an outlier. the mrate and treatment boxplot shows equal means however the 1 treatment is a little bit more dispersed than the second treatment. the anova of the lmer of mrate as a response variable shows that variance and treatment do not contribute to main effects to the mrate, because of the high p-value which kind of supports the boxplot for mrate and trt and mrate and var. for the anova of the lmer of brate as the response variable, it shows that the variety and trt have significant main effects on the variety due to the small p value which shows on the boxplot. The interaction effect of var and trt on both brate and the mrate seem to not have any effects, which holds true of the interaction boxplots.

Q6. For the canned meat dataset, using the boxplot function to view the treatment groups show that both Temperature and time have effects on the quality of the meat, where the quality is worse as time progresses and as the temperature is high. using the ANOVA function on the regression of the main effects and the interaction effects along with the randomized block effects follows the results gained from the boxplot. The main effects which are temp and time have low p values suggesting that they play a major role in the quality of the meat. The interaction effects of time and temperature is lower than the confidence level of 0.05 hence it plays a role too, not as big as the main effects. panel also plays an effect too at the 0.05 confidence level.

setwd("/Users/harijoshi/Desktop/Spring 2024/STAT 516/HW6")
canned_meatdf <- read.csv("datatab_10_30.prn", sep = " ")
head(canned_meatdf)
  OBS TIME PANEL QUAL TEMP
1   1    0     1 2.38    2
2   5    0     2 2.19    2
3   9    2     1 2.74    2
4  13    2     2 2.50    2
5  17    4     1 2.75    2
6  21    4     2 2.74    2
boxplot(QUAL ~ TEMP, data = canned_meatdf)

boxplot(QUAL ~ TIME, data = canned_meatdf)

boxplot(QUAL ~ TIME+TEMP, data = canned_meatdf)

meatlm <- lm(QUAL ~ PANEL + as.factor(TIME) + as.factor(TEMP) + as.factor(TIME)*as.factor(TEMP)+ PANEL*as.factor(TIME)+ PANEL*as.factor(TEMP), data = canned_meatdf)
anova(meatlm)
Analysis of Variance Table

Response: QUAL
                                Df  Sum Sq Mean Sq F value    Pr(>F)    
PANEL                            1  0.7784  0.7784  5.5297   0.03661 *  
as.factor(TIME)                  4 15.2717  3.8179 27.1221 6.248e-06 ***
as.factor(TEMP)                  3 20.5439  6.8480 48.6473 5.454e-07 ***
as.factor(TIME):as.factor(TEMP) 12  4.8861  0.4072  2.8925   0.03897 *  
PANEL:as.factor(TIME)            4  0.3970  0.0992  0.7050   0.60361    
PANEL:as.factor(TEMP)            3  0.2378  0.0793  0.5631   0.64957    
Residuals                       12  1.6892  0.1408                      
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
plot(meatlm)