23.12.2014 Views

R code for Ex 5.19 (3 factor factorial designs)

R code for Ex 5.19 (3 factor factorial designs)

R code for Ex 5.19 (3 factor factorial designs)

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

R <strong>code</strong> <strong>for</strong> <strong>Ex</strong> <strong>5.19</strong> (3 <strong>factor</strong> <strong>factor</strong>ial <strong>designs</strong>)<br />

# R <strong>code</strong> <strong>for</strong> 3 <strong>factor</strong> <strong>factor</strong>ial design <strong>Ex</strong> <strong>5.19</strong><br />

data=read.table("C:/Users/Mihinda/Desktop/ex519.txt", header=T) #the data file<br />

data$CycleTime


Output<br />

> # R <strong>code</strong> <strong>for</strong> 3 <strong>factor</strong> <strong>factor</strong>ial design <strong>Ex</strong> <strong>5.19</strong><br />

> data=read.table("C:/Users/Mihinda/Desktop/ex519.txt", header=T) #the<br />

data file<br />

> data$CycleTime data$Operator data$Temperature par(mfrow=c(2,2))<br />

> plot.design(data)<br />

> interaction.plot(data$CycleTime,data$Operator,data$Score)<br />

> interaction.plot(data$CycleTime,data$Temperature,data$Score)<br />

> interaction.plot(data$Operator,data$Temperature,data$Score)<br />

mean of Score<br />

29 30 31 32 33 34 35<br />

50<br />

2<br />

3<br />

40<br />

60 1<br />

CycleTime<br />

350<br />

300<br />

Temperature<br />

mean of data$Score<br />

26 28 30 32 34 36<br />

40 50 60<br />

data$Operator<br />

2<br />

1<br />

3<br />

Factors<br />

data$CycleTime<br />

mean of data$Score<br />

28 30 32 34<br />

data$Temperature<br />

350<br />

300<br />

mean of data$Score<br />

30 32 34 36<br />

data$Temperature<br />

350<br />

300<br />

40 50 60<br />

data$CycleTime<br />

1 2 3<br />

data$Operator


fit anova(fit)<br />

Analysis of Variance Table<br />

Response: Score<br />

Df Sum Sq Mean Sq F value Pr(>F)<br />

Operator 2 261.33 130.667 39.8644 7.439e-10 ***<br />

CycleTime 2 436.00 218.000 66.5085 8.141e-13 ***<br />

Temperature 1 50.07 50.074 15.2768 0.0003934 ***<br />

Operator:CycleTime 4 355.67 88.917 27.1271 1.982e-10 ***<br />

Operator:Temperature 2 11.26 5.630 1.7175 0.1938948<br />

CycleTime:Temperature 2 78.81 39.407 12.0226 0.0001002 ***<br />

Operator:CycleTime:Temperature 4 46.19 11.546 3.5226 0.0158701 *<br />

Residuals 36 118.00 3.278<br />

---<br />

Signif. <strong>code</strong>s: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!