#Question A
library(FrF2)
## Loading required package: DoE.base
## Loading required package: grid
## Loading required package: conf.design
## Registered S3 method overwritten by 'DoE.base':
## method from
## factorize.factor conf.design
##
## Attaching package: 'DoE.base'
## The following objects are masked from 'package:stats':
##
## aov, lm
## The following object is masked from 'package:graphics':
##
## plot.design
## The following object is masked from 'package:base':
##
## lengths
y<-c(12,18,13,16,17,15,20,15,10,25,13,24,19,21,17,23)
a<-c(-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1,-1,1)
b<-c(-1,-1,1,1,-1,-1,1,1,-1,-1,1,1,-1,-1,1,1)
c<-c(-1,-1,-1,-1, 1,1, 1,1, -1,-1,-1,-1, 1,1, 1,1)
d<-c(-1,-1,-1,-1,-1,-1,-1,-1,1,1,1,1,1,1,1,1)
dat<-data.frame(y,a,b,c,d)
full.mod<-lm(y~(a+b+c+d)^4, data=dat)
DanielPlot(full.mod, half=TRUE)
Based on the half-plot test done above, the significant factors are a,d,
ac, and ad.
#Question b
red.mod<-lm(y~a+c+d+a:c+a:d, data=dat)
anova(red.mod)
## Analysis of Variance Table
##
## Response: y
## Df Sum Sq Mean Sq F value Pr(>F)
## a 1 81.00 81.000 49.8462 3.456e-05 ***
## c 1 16.00 16.000 9.8462 0.0105485 *
## d 1 42.25 42.250 26.0000 0.0004647 ***
## a:c 1 72.25 72.250 44.4615 5.583e-05 ***
## a:d 1 64.00 64.000 39.3846 9.193e-05 ***
## Residuals 10 16.25 1.625
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
summary(red.mod)
##
## Call:
## lm.default(formula = y ~ a + c + d + a:c + a:d, data = dat)
##
## Residuals:
## Min 1Q Median 3Q Max
## -1.6250 -0.9375 0.1250 0.8750 1.3750
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) 17.3750 0.3187 54.520 1.04e-13 ***
## a 2.2500 0.3187 7.060 3.46e-05 ***
## c 1.0000 0.3187 3.138 0.010549 *
## d 1.6250 0.3187 5.099 0.000465 ***
## a:c -2.1250 0.3187 -6.668 5.58e-05 ***
## a:d 2.0000 0.3187 6.276 9.19e-05 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 1.275 on 10 degrees of freedom
## Multiple R-squared: 0.9443, Adjusted R-squared: 0.9165
## F-statistic: 33.91 on 5 and 10 DF, p-value: 5.856e-06
Based on the analysis created, the factors that are significant are a,c,d,ac,ad. The rest of the possible solutions can be pulled and can be deemed not significant. This is because the p-val at level.05 is less than the actual value given. This means that the critical value is higher than the significant level.