The 23 Factorial Design in R

The paper describes the factorial design of the experiment with three input factors that change on two levels. For given values of the input parameters, it is shown how to obtain a variance analysis table and which factors and interactions between factors are significant. The example was done in the software intended for the design of the experiment and in the software R. It is shown how to use the software R to arrive at the final solution of the given example.


Introduction
Researchers use design of experiment to study the performance of systems and processes.If there are several factors involved in experiment and if it is necessary to analyze effect of the input factors and all possible interactions between them on a response, the factorial design is widely used.The 2 k is a specific instance of the common factorial design, where k are factors that are being analyzed and 2 are levels of the factors.Levels of the factors are usually marked as high "+" or "1" and low "-" or "-1". 2 k is very often used in industrial experiments and is referred to screening design due to the process where a large number of factors are presented that might be significant in an experiment [1,2].
It is useful to have larger number of replications on the experiment and then it is possible to represent it as  • 2  .Factors are usually represented by uppercase latin letters and in this papers they will be represented as A, B and C factor.For the following example it will be considered 2 3 factorial design experiment with two replicates.

2 3 Factorial Design
For this case of the factorial design, we will assume that there are three input factors which can be notated as A,B and C, table 1 [2].This is an example of factorial design that give us possibility to analyze effects of three input variables on two levels.
In this design there are seven degrees of freedom.Three of them are for the input factors which are notated as A, B and C and four degrees of freedom refer to the interactions between three input factors.AB, AC, BC and ABC.

2 3 Design Example
Now, suppose we have three input factors which values are changed on two levels, minimum and maximum value and also we suppose that the experiment has been repeated two times, which means we have two replications.The results of those experiments are shown in Table 1 and with those results it is able to statistically analyze this example.

Table 1. Results of experiment
To determine statistical parameters it is recommended to use some of softwers for statistics and in this case we used Design Expert software.Figure 1 shows how treatment combinations can be displayed geometrically as a cube.It is helpful to use some statistical software to calculate values such as Sum of Squares (SS), Degrees of Freedom (dF), Mean of Squares (MS) and Fisher's coefficients.Those values are needed for Analysis of Variance (ANOVA) table 2. ANOVA table is used to compare differences of means among groups of datas [3].The F-value of model from Table 3 shows that the model is significant.P-values calculated in table 2 which are less than 0,0500 shows that those terms of model are significant.In our example terms A, B, C, AC, ABC are significant.

Design of experiment in R
In order to be able to do the given example in the software R, it is necessary to have basic knowledge of the software [4].First we have to input parameters as following: # input parameters icas<-matrix(c(5.2,6.1,3.5,2.9,9.1,9.9,3.After that it is necessary to give number of replicates and input command for effects of factors and interaction of factors [4].After we run this commands software will calculate p values which are shown in Table 4. Factor which have p value lower then 0,01 are significant for significance factor α= 1%.

Conclusion
The paper presents a comparative analysis of the results obtained in the Design Expert software and in the R software.From the displayed results, we see that in the R software it is possible to obtain the same results in the ANOVA table.However, in order to obtain accurate results, it is necessary to know the basics of programming in the R software.On the other hand, to analyze the results of the experiment in the Design Expert software, it is enough to correctly select the type of experiment and enter the results.The biggest advantage of R software is that it is open source software and it can be downloaded and used by anyone.

Figure 1 .
Figure 1.Geometrical view of 2 3 design Values that are shown in Figure 1 are arithmetic mean of two experiment replicates results from table 1 and are centered in eight vertices of the cube.
Figure 2 shows a normal probability plot of model residuals and Figure 3 plot of the residuals versus the predicted yield.Both plots are satisfactory.

Table 2 .
Analysis of variance (ANOVA) table in Design Expert software