You are on page 1of 11

Stats101B HW7

YIK LUN, KEI


DIS 1A
2017/3/7

7.21
The factors that are confounded with blocks are ABCD, ABEF, ACE, BDE, CDEF, BCF, and ADF.
ABCD ACE = BDE
ABCD ABEF = CDEF
ACE ABEF = BCF
ABCD ACE ABEF = ADF

8.11

(a)

A B C D=BE E=AC
- - - - + e
+ - - + - ad
- + - + + bde
+ + - - - ab
- - + + - cd
+ - + - + ace
- + + - - bc
+ + + + + abcde

(b)

I=BDE=ACE=ABCD
A (BDE) =ABDE A (ACE) =CE A (ABCD) =BCD A=ABDE=CE=BCD
B (BDE) =DE B (ACE) =ABCE B (ABCD) =ACD B=DE=ABCE=ACD
C (BDE) =BCDE C (ACE) =AE C (ABCD) =ABD C=BCDE=AE=ABD
D (BDE) =BE D (ACE) =ACDE D (ABCD) =ABC D=BE=ACDE=ABC
E (BDE) =BD E (ACE) =AC E (ABCD) =ABCDE E=BD=AC=ABCDE
AB (BDE) =ADE AB (ACE) =BCE AB (ABCD) =CD AB=ADE=BCE=CD
AD (BDE) =ABE AD (ACE) =CDE AD (ABCD) =BC AD=ABE=CDE=BC

(c)

x<-expand.grid(A=c(-1,1),B=c(-1,1),C=c(-1,1))
x$E<-x$A*x$C
x$D<-x$B * x$E
x$y<-c(23.2,16.9,16.8,15.5,23.8,23.4,16.2,18.1)

1
g<-lm(y~A + B + C + D + E,data=x)
summary(g)

##
## Call:
## lm(formula = y ~ A + B + C + D + E, data = x)
##
## Residuals:
## 1 2 3 4 5 6 7 8
## 0.275 -1.550 -0.275 1.550 1.550 -0.275 -1.550 0.275
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 19.2375 0.7871 24.441 0.00167 **
## A -0.7625 0.7871 -0.969 0.43487
## B -2.5875 0.7871 -3.287 0.08140 .
## C 1.1375 0.7871 1.445 0.28528
## D -0.3375 0.7871 -0.429 0.70985
## E 1.1375 0.7871 1.445 0.28528
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 2.226 on 2 degrees of freedom
## Multiple R-squared: 0.8895, Adjusted R-squared: 0.6134
## F-statistic: 3.221 on 5 and 2 DF, p-value: 0.2537
2*coef(g)[-1]

## A B C D E
## -1.525 -5.175 2.275 -0.675 2.275

(d)
From part B, we know that AB and AD are aliased with other factors. If high order interactions are negligible,
then AB and AD could used as an estimate of error.
anova(g)

## Analysis of Variance Table


##
## Response: y
## Df Sum Sq Mean Sq F value Pr(>F)
## A 1 4.651 4.651 0.9385 0.4349
## B 1 53.561 53.561 10.8068 0.0814 .
## C 1 10.351 10.351 2.0885 0.2853
## D 1 0.911 0.911 0.1839 0.7098
## E 1 10.351 10.351 2.0885 0.2853
## Residuals 2 9.913 4.956
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

2
(e)
The residual plots are satisfactory.
par(mfrow=c(2,2))
plot(g)

## hat values (leverages) are all = 0.75


## and there are no factor predictors; no plot no. 5

Standardized residuals
Residuals vs Fitted Normal QQ
4 5 5 4
Residuals

1.5 0.5

0.5
1.5
2 2

14 16 18 20 22 24 1.5 0.5 0.0 0.5 1.0 1.5

Fitted values Theoretical Quantiles


Standardized residuals

ScaleLocation
1.2

4 2 5
0.6
0.0

14 16 18 20 22 24

Fitted values

8.23

(a)

A B C D=AB E=BC
- - - + + de
+ - - - + ae
- + - - - b
+ + - + - abd
- - + + - cd
+ - + - - ac
- + + - + bce
+ + + + + abcde
x<-expand.grid(A=c(-1,1),B=c(-1,1),C=c(-1,1))
x$D<-x$A*x$B
x$E<-x$B*x$C
x$y<-c(de = 95,ae = 134,b = 158,abd = 190,cd =92,ac= 187,bce = 155,abcde = 185)

3
g<-lm(y~(A+B+C+D+E)^5,data=x)
na.omit(2*coef(g)[-1])[1:7]

## A B C D E A:C A:E
## 49.0 45.0 10.5 -18.0 -14.5 13.5 -14.5

(b)

This second fraction is formed by reversing the signs of factor A.


A B C D=-AB E=BC
+ - - + + ade
- - - - + e
+ + - - - ab
- + - + - bd
+ - + + - acd
- - + - - c
+ + + - + abce
- + + + + bcde
newx <- expand.grid(A=c(1,-1),B=c(-1,1),C=c(-1,1))
newx$D<-newx$A*newx$B*(-1)
newx$E<-newx$B*newx$C
newx$y<-c(ade = 136,e =93,ab=187,bd=153,acd=139,c=99,abce = 191,bcde = 150)
X <- as.data.frame(rbind(x,newx))
g<-lm(y~(A+B+C+D+E)^5,data=X)
na.omit(2*coef(g)[-1])[1:15]

## A B C D E A:B A:C A:D A:E B:D


## 44.25 49.25 6.50 -8.00 -8.25 -10.00 7.25 -4.25 -6.00 4.75
## C:D D:E A:B:D A:C:D A:D:E
## -8.50 6.25 6.00 -6.25 4.00

(c)
This second fraction is formed by reversing the signs of all factors.
A B C D=-AB E=-BC
+ + + - - abc
- + + + - bcd
+ - + + + acde
- - + - + ce
+ + - - + abe
- + - + + bde
+ - - + - ad
- - - - - (1)
newxx <- expand.grid(A=c(1,-1),B=c(1,-1),C=c(1,-1))
newxx$D<-newxx$A*newxx$B*(-1)
newxx$E<-newxx$B*newxx$C*(-1)
newxx$y<-c(abc=189,bcd=154,acde=135,ce=96,abe=193,bde=152,ad=137,one=98)
XX <- as.data.frame(rbind(x,newxx))
g<-lm(y~(A+B+C+D+E)^5,data=XX)
na.omit(2*coef(g)[-1])[1:15]

4
## A B C D E A:B A:C A:D A:E B:C B:D B:E
## 43.75 50.25 4.50 -8.75 -7.50 -9.25 6.00 -5.25 -6.50 -7.00 5.25 6.00
## A:B:C A:B:D A:B:E
## -8.00 5.25 7.50

8.37

(a)

Column F = ABC, column G = ABD, and column H = BCDE. Therefore I = ABCF = ABDG = BCDEH

(b)

A = BCF = BDG = CEGH = DEFH B = ACF = ADG = CDEH = EFGH


C = ABF = DFG = AEGH = BDEH D = ABG = CFG = AEFH = BCEH
E = ACGH = ADFH = BCDH = BFGH F = ABC = CDG = ADEH = BEGH
G = ABD = CDF = ACEH = BEFH H = ACEG = ADEF = BCDE = BEFG
AB = CF = DG AC = BF = EGH = ADFG = BCDG
AD = BG = EFH = ACFG = BCDF AE = CGH = DFH = BCEF = BDEG
AF = BC = DEH = ACDG = BDFG AG = BD = CEH = ACDF = BCFG
AH = CEG = DEF = BCFH = BDGH BE = CDH = FGH = ACEF = ADEG
BH = CDE = EFG = ACFH = ADGH CD = FG = BEH = ABCG = ABDF
CE = AGH = BDH = ABEF = DEFG CG = DF = AEH = ABCD = ABFG
CH = AEG = BDE = ABFH = DFGH DE = AFH = BCH = ABEG = CEFG
DH = AEF = BCE = ABGH = CFGH EF = ADH = BGH = ABCE = CDEG
EG = ACH = BFH = ABDE = CDEF EH = ACG = ADF = BCD = BFG
FH = ADE = BEG = ABCH = CDGH GH = ACE = BEF = ABDH = CDFH

(c)

For both the PVM and NPU responses, only factors D and F appear to be significant.
x <- expand.grid(A=c(-1,1),B=c(-1,1),C=c(-1,1),D=c(-1,1),E=c(-1,1))
x$F<-x$A*x$B*x$C
x$G<-x$A*x$B*x$D
x$H<-x$B*x$C*x$D*x$E
y1 <- c(1.00,1.04,1.02,0.99,1.02,1.01,1.01,1.03,1.04,1.14,1.20,1.13,1.14,1.07,1.06,1.13,
1.02,1.10,1.09,0.96,1.02,1.07,0.98,0.95,1.10,1.12,1.19,1.13,1.20,1.07,1.12,1.21)
y2 <- c(5,13,16,12,15,9,12,17,21,20,25,21,25,13,20,26,10,13,17,13,14,11,10,14,28,24,22,
15,21,19,21,27)
g <- lm(y1 ~ A*B*C*D*E*F*G*H,data=x)
data <- as.data.frame(na.omit(2*coef(g)[-1])[1:31])
eff<-data[order(data[,1]),1]
lab <- rownames(data)[order(data[,1])]
y<-c()
for(i in 1:31){y[i] = (i-0.5)/31}
plot(eff,y);text(eff-0.005,y,labels = lab,cex= 0.7)

5
1.0
D
F
B:D
G
E:G
0.8
D:F
B:H
E
H
C:H
D:E
G:H
0.6

C:D
B
A:C
y

E:F
D:H
C:E
0.4

A:H
A:D
A:B:H
F:H
A
A:B:E
0.2

A:C:D
E:H
A:E
C
B:E
A:B
0.0

B:C

0.02 0.00 0.02 0.04 0.06 0.08 0.10

eff
g1<-lm(y1~D+F,data=x)
anova(g1)

## Analysis of Variance Table


##
## Response: y1
## Df Sum Sq Mean Sq F value Pr(>F)
## D 1 0.094613 0.094613 60.854 1.329e-08 ***
## F 1 0.022050 0.022050 14.182 0.0007523 ***
## Residuals 29 0.045087 0.001555
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
g<- lm(y2 ~ A*B*C*D*E*F*G*H,data=x)
data <- as.data.frame(na.omit(2*coef(g)[-1])[1:31])
eff<-data[order(data[,1]),1]
lab <- rownames(data)[order(data[,1])]
y<-c()
for(i in 1:31){y[i] = (i-0.5)/31}
plot(eff,y);text(eff-0.5,y,labels = lab,cex= 0.7)

6
1.0
D
F
E:H
B
G:H
0.8
H
G
A:B
A:C:D
D:H
B:H
B:C
0.6

A:C
E
A:B:H
y

F:H
D:E
A:E
0.4

A:H
C
D:F
C:D
A:B:E
C:E
0.2

C:H
E:G
A
B:D
E:F
A:D
0.0

B:E

2 0 2 4 6 8

eff
g2<-lm(y2~D+F,data=x)
anova(g2)

## Analysis of Variance Table


##
## Response: y2
## Df Sum Sq Mean Sq F value Pr(>F)
## D 1 675.28 675.28 78.915 9.017e-10 ***
## F 1 148.78 148.78 17.387 0.0002519 ***
## Residuals 29 248.16 8.56
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

(d)

The residual plots for the PVM response shown below do not identify any concerns.
par(mfrow=c(2,2))
plot(g1)

## hat values (leverages) are all = 0.09375


## and there are no factor predictors; no plot no. 5

7
Standardized residuals
Residuals vs Fitted Normal QQ
22 22

2
Residuals

0.00

0
9
0.10

2
24 24

1.00 1.05 1.10 1.15 2 1 0 1 2

Fitted values Theoretical Quantiles


Standardized residuals

ScaleLocation
24
22
9
1.0
0.0

1.00 1.05 1.10 1.15

Fitted values
plot(g2)

## hat values (leverages) are all = 0.09375


## and there are no factor predictors; no plot no. 5

8
Standardized residuals
Residuals vs Fitted Normal QQ

10
25 25
Residuals

2
5
0

0
5

2
14 1
14

10 12 14 16 18 20 22 24 2 1 0 1 2

Fitted values Theoretical Quantiles


Standardized residuals

ScaleLocation
25
14
1
1.0
0.0

10 12 14 16 18 20 22 24

Fitted values
##(e) Temperature and Cleaning interval both at low level make PVM unity and the NPU response as
small as possible. Therefore running the Temperature at 20 degree and the Cleaning Interval at 8 is the best
operating conditions.
1.07375 + 0.05437 * 1 + 0.02625 * 1

## [1] 1.15437
1.07375 + 0.05437 * (-1) + 0.02625 * 1

## [1] 1.04563
1.07375 + 0.05437 * 1 + 0.02625 * (-1)

## [1] 1.10187
1.07375 + 0.05437 * (-1) + 0.02625 * (-1)

## [1] 0.99313
17.1562 + 4.5937 * 1 + 2.1563 * 1

## [1] 23.9062
17.1562 + 4.5937 * (-1) + 2.1563 * 1

## [1] 14.7188
17.1562 + 4.5937 * 1 + 2.1563 * (-1)

## [1] 19.5936
17.1562 + 4.5937 * (-1) + 2.1563 * (-1)

## [1] 10.4062

9
8.39
A B C D = AB E = -AC
- - - + - d
+ - - - + ae
- + - - - b
+ + - + + abde
- - + + + cde
+ - + - - ac
- + + - + bce
+ + + + - abcd

(a)

5 factors are investigated

(b)

3 factors are in the basic design

(c)

D = AB and E = -AC, therefore I = ABD = -ACE

(d)

No, since E = -AC

(e)

I = ABD = -ACE = BCDE

(d)

The resolution of this design is III (3)

8.48

(a)

D = -ABC
x <- expand.grid(A=c(-1,1),B=c(-1,1),C=c(-1,1))
x$D<-c(1,-1,-1,1,-1,1,1,-1)
x$E<-c(1,1,-1,-1,-1,-1,1,1)
x$y<-c(40,10,30,20,40,30,20,30)
alias(lm(y~.^5,x))

10
## Model :
## y ~ (A + B + C + D + E)^5
##
## Complete :
## (Intercept) A B C D E A:B A:C
## A:D 0 0 0 0 0 -1 0 0
## A:E 0 0 0 0 -1 0 0 0
## B:C 0 0 0 0 0 1 0 0
## B:D 0 0 0 0 0 0 0 -1
## B:E 0 0 0 1 0 0 0 0
## C:D 0 0 0 0 0 0 -1 0
## C:E 0 0 1 0 0 0 0 0
## D:E 0 -1 0 0 0 0 0 0
## A:B:C 0 0 0 0 -1 0 0 0
## A:B:D 0 0 0 -1 0 0 0 0
## A:B:E 0 0 0 0 0 0 0 1
## A:C:D 0 0 -1 0 0 0 0 0
## A:C:E 0 0 0 0 0 0 1 0
## A:D:E -1 0 0 0 0 0 0 0
## B:C:D 0 -1 0 0 0 0 0 0
## B:C:E 1 0 0 0 0 0 0 0
## B:D:E 0 0 0 0 0 0 -1 0
## C:D:E 0 0 0 0 0 0 0 -1
## A:B:C:D -1 0 0 0 0 0 0 0
## A:B:C:E 0 1 0 0 0 0 0 0
## A:B:D:E 0 0 -1 0 0 0 0 0
## A:C:D:E 0 0 0 -1 0 0 0 0
## B:C:D:E 0 0 0 0 1 0 0 0
## A:B:C:D:E 0 0 0 0 0 -1 0 0

(b)

E = BC

(c)

If this design were folder over, the resolution is IV (4)

11

You might also like