The tensile strength of Portland cement is being studied. Four different mixing techniques can be used economically. A completely randomized experiment was conducted and the following data were collected:
tech1 <- c(3129, 3000, 2865, 2890)
tech2 <- c(3200, 3300, 2975, 3150)
tech3 <- c(2800 ,2900, 2985, 3050)
tech4 <- c( 2600 ,2700, 2600 ,2765)
dafr <- data.frame(tech1,tech2,tech3,tech4)
Test the hypothesis that mixing techniques affect the strength of the cement. Use a= 0.05.
Before we can test via ANOVA, we must check to see if our data is normally distributed and has equal variance and is normally distributed
boxplot(dafr,main='Boxplot for Each Technique Used')
par( mfrow=c(2,2),mar=c(4,4,1,4),mfcol=c(2,2) )
qqnorm(tech1,main='Q-Q for Tech1')
qqnorm(tech2,main='Q-Q for Tech2')
qqnorm(tech3,main='Q-Q for Tech3')
qqnorm(tech4,main='Q-Q for Tech4')
Because our sample size is so small, it is difficult to tell, but I would say that our data is normally distributed and our variances do appear to be equal. Carrying on with our ANOVA testing, where:
Null Hypothesis: Ho:mu(all)=mu(grand)
Alternative Hypothesis: mu(all) ≠ mu(grand)
dafr2 <- cbind(stack(dafr[1:4]))
atest <- aov(values~ind,dafr2)
summary(atest)
## Df Sum Sq Mean Sq F value Pr(>F)
## ind 3 489740 163247 12.73 0.000489 ***
## Residuals 12 153908 12826
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
here we find that the p value is below our alpha of .05 therefore, Our null hypothesis is rejected, and we state that the Mixing technique does have an effect on the Tensile strength of cement
product developer is investigating the tensile strength of a new synthetic fiber that will be used to make cloth for men’s shirts. Strength is usually affected by the percentage of cotton used in the blend of materials for the fiber. The engineer conducts a completely randomized experiment with five levels of cotton content and replicates the experiment five times. The data are shown in the following table:
cwp15 <- c(7 ,7 ,15 ,11, 9)
cwp20 <- c(12 ,17 ,12 ,18,18)
cwp25 <- c(14 ,19 ,19 ,18, 18)
cwp30 <- c(19 ,25 ,22, 19 ,23)
cwp35 <- c(7 ,10, 11, 15 ,11)
dafr2 <- data.frame(cwp15,cwp20,cwp25,cwp30,cwp35)
Is there evidence to support the claim that cotton content affects the mean tensile strength? Use a= 0.05.
boxplot(dafr2,main='Boxplot for Each Technique Used')
par( mfrow=c(2,2),mar=c(4,4,1,4),mfcol=c(2,2) )
qqnorm(cwp15,main='Q-Q for 15%')
qqnorm(cwp20,main='Q-Q for 20%')
qqnorm(cwp25,main='Q-Q for 25%')
qqnorm(cwp30,main='Q-Q for 30%')
par( mfrow=c(1,1),mar=c(4,4,1,4),mfcol=c(1,1) )
qqnorm(cwp35,main='Q-Q for 35%')
Our data does not appear to have equal variances at all, and our plots do not seem to be normally distributed.
We will perform a log transformation to see if our data can be transformed into more regular shapes.
boxplot(log(dafr2),main='Boxplot for Log of Each Technique Used')
par( mfrow=c(2,2),mar=c(4,4,1,4),mfcol=c(2,2) )
qqnorm(log(cwp15),main='Log Q-Q for 15%')
qqnorm(log(cwp20),main='Log Q-Q for 20%')
qqnorm(log(cwp25),main='Log Q-Q for 25%')
qqnorm(log(cwp30),main='Log Q-Q for 30%')
par( mfrow=c(2,2),mar=c(4,4,1,4),mfcol=c(2,2) )
qqnorm(log(cwp35),main='Log Q-Q for 35%')
This attempt to transform the data did not work. We will now attempt the Kruskal-Wallace test instead, as the textbook states on page 128.
Null Hypothesis: Ho:mu(all)=mu(grand)
Alternative Hypothesis: mu(all) ≠ mu(grand)
dafr2 <- cbind(stack(dafr2[1:4]))
kruskal.test(values~ind,dafr2)
##
## Kruskal-Wallis rank sum test
##
## data: values by ind
## Kruskal-Wallis chi-squared = 15.183, df = 3, p-value = 0.001667
We find here again the the cotton weight percent does have an effect on the tensile strength of a mens shirt because our alpha is higher then our pvalue, we do reject the null hypothesis.
An article in the ACI Materials Journal (Vol. 84,1987, pp. 213–216) describes several experiments investigating the rodding of concrete to remove entrapped air. A 3-inch x 6-inch cylinder was used, and the number of times this rod was used is the design variable. The resulting compressive strength of the concrete specimen is the response. The data are shown in the following table:
rodlvl10 <- c(1530, 1530, 1440)
rodlvl15 <- c(1610 ,1650, 1500)
rodlvl20 <- c(1560, 1730, 1530)
rodlvl25 <- c(1500 ,1490 ,1510)
dafr3=data.frame(rodlvl10,rodlvl15,rodlvl20,rodlvl25)
Is there any difference in compressive strength due to the rodding level? Use a= 0.05.
boxplot(dafr3,main='Boxplot of Rodding Levels')
par( mfrow=c(2,2),mar=c(4,4,1,4),mfcol=c(2,2) )
qqnorm(rodlvl10,main='Q-Q for Lvl10')
qqnorm(rodlvl15,main='Q-Q for Lvl15')
qqnorm(rodlvl20,main='Q-Q for Lvl20')
qqnorm(rodlvl25,main='Q-Q for Lvl25')
We can see here our variances are definitely not equal, though our data does seem to be normally distributed.
boxplot(log(dafr3),main='Boxplot of Rodding Levels')
Performing a log transformation did not make our variances equal. However, since our data does seem to be normally distributed, I will use the regular ANOVA test here.
Null Hypothesis: Ho:mu(all)=mu(grand)
Alternative Hypothesis: mu(all) ≠ mu(grand)
dafr3 <- cbind(stack(dafr3[1:4]))
atest <- aov(values~ind,dafr3)
summary(atest)
## Df Sum Sq Mean Sq F value Pr(>F)
## ind 3 28633 9544 1.865 0.214
## Residuals 8 40933 5117
We can see here our p value is quite a bit larger then our alpha, thus, we do not reject the null hypothesis and state the the rodding levels do not affect the strength of the concrete.
All Code Used:
tech1 <- c(3129, 3000, 2865, 2890)
tech2 <- c(3200, 3300, 2975, 3150)
tech3 <- c(2800 ,2900, 2985, 3050)
tech4 <- c( 2600 ,2700, 2600 ,2765)
dafr <- data.frame(tech1,tech2,tech3,tech4)
boxplot(dafr,main='Boxplot for Each Technique Used')
par( mfrow=c(2,2),mar=c(4,4,1,4),mfcol=c(2,2) )
qqnorm(tech1,main='Q-Q for Tech1')
qqnorm(tech2,main='Q-Q for Tech2')
qqnorm(tech3,main='Q-Q for Tech3')
qqnorm(tech4,main='Q-Q for Tech4')
dafr2 <- cbind(stack(dafr[1:4]))
atest <- aov(values~ind,dafr2)
summary(atest)
cwp15 <- c(7 ,7 ,15 ,11, 9)
cwp20 <- c(12 ,17 ,12 ,18,18)
cwp25 <- c(14 ,19 ,19 ,18, 18)
cwp30 <- c(19 ,25 ,22, 19 ,23)
cwp35 <- c(7 ,10, 11, 15 ,11)
dafr2 <- data.frame(cwp15,cwp20,cwp25,cwp30,cwp35)
boxplot(dafr2,main='Boxplot for Each Technique Used')
par( mfrow=c(2,2),mar=c(4,4,1,4),mfcol=c(2,2) )
qqnorm(cwp15,main='Q-Q for 15%')
qqnorm(cwp20,main='Q-Q for 20%')
qqnorm(cwp25,main='Q-Q for 25%')
qqnorm(cwp30,main='Q-Q for 30%')
par( mfrow=c(1,1),mar=c(4,4,1,4),mfcol=c(1,1) )
qqnorm(cwp35,main='Q-Q for 35%')
boxplot(log(dafr2),main='Boxplot for Log of Each Technique Used')
par( mfrow=c(2,2),mar=c(4,4,1,4),mfcol=c(2,2) )
qqnorm(log(cwp15),main='Log Q-Q for 15%')
qqnorm(log(cwp20),main='Log Q-Q for 20%')
qqnorm(log(cwp25),main='Log Q-Q for 25%')
qqnorm(log(cwp30),main='Log Q-Q for 30%')
par( mfrow=c(2,2),mar=c(4,4,1,4),mfcol=c(2,2) )
qqnorm(log(cwp35),main='Log Q-Q for 35%')
dafr2 <- cbind(stack(dafr2[1:4]))
kruskal.test(values~ind,dafr2)
rodlvl10 <- c(1530, 1530, 1440)
rodlvl15 <- c(1610 ,1650, 1500)
rodlvl20 <- c(1560, 1730, 1530)
rodlvl25 <- c(1500 ,1490 ,1510)
dafr3=data.frame(rodlvl10,rodlvl15,rodlvl20,rodlvl25)
boxplot(dafr3,main='Boxplot of Rodding Levels')
par( mfrow=c(2,2),mar=c(4,4,1,4),mfcol=c(2,2) )
qqnorm(rodlvl10,main='Q-Q for Lvl10')
qqnorm(rodlvl15,main='Q-Q for Lvl15')
qqnorm(rodlvl20,main='Q-Q for Lvl20')
qqnorm(rodlvl25,main='Q-Q for Lvl25')
boxplot(log(dafr3),main='Boxplot of Rodding Levels')
dafr3 <- cbind(stack(dafr3[1:4]))
atest <- aov(values~ind,dafr3)
summary(atest)