# DesignofDataProc_省略_alysisofVariance_Pin.docx

Advanced Materials Research Vols. 268-270 2011 pp 2144-2149 © 2011 Trans Tech Publications, Switzerland doi 10.4028/www. scientific, net/AMR. 268-270.2144 Design of Data Processing System on Analysis of Variance Ping Li1,a， Lingke Zeng1b， Bo Wu1cand Xiaosu Cheng1 d 1South China University of Technology, Guangzhou 510640, China aiamapple_, , G, Keywords Visual Basic, analysis of variance, data processing system Abstract. Data processing system on analysis of variance is developed by using Visual Basic. In this document, it introduced conception and functions about analysis of variance in brief, and explained the design of data processing system on analysis of variance in detail. Further more, we uated the perance of data processing system. The result indicated that the system has excellent perance and it is useful in the production and experiment. Introduction In the test data processing, analysis of variance is a very practical and effective of statistical test [1]. It can be used to analyze the significance of relevant factors on test results in inspection and test. If there is only one variance factor, it is called one-way analysis of variance. If there are many variance factors, it is called multi-factor analysis of variance. In multi-factor analysis of variance, two-factor analysis of variance is the most common. In many textbooks, most only introduce two-factor analysis of variance and three or more factors for the analysis of variance are mentioned less. The internal functionality provided by excel can easily implement two-factor analysis of variance, but it is powerless for three or more factors analysis of variance [2]. In many scientific experiments, it often need to study the effect of three or more factors and their interactions, there are many different levels for each factor, in order to improve the reliability of tests, sometimes repeat the test several times. Therefore, to design a data processing system to meet these requirements is meaningful. The following describes the design of the system, some of the s and techniques. Brief introduction of analysis of variance Production and testing process is often very complex. To investigate the reliability and impact factors of an analysis results, research often involves a lot of tests to get a lot of data. In the complex role of various factors, how to determine which factors most affected the results and which factor plays a minor role The to process and determine data is analysis of variance. Using this , we can determine the role of various factors which cause the differences in test results and their interactions. If there are several mutual independent factors that affect the test results, according to the addition theorem of variance, the total variance should be equal to the total sum of all variance. Analysis of variance is to decompose the total variance for each variance component and then analysis to determine by significance test and obtain appropriate conclusions. It can determine the effects of different factors [3]. If tests have many factors, the factors have many levels and tests are repeated, the workload will be very large. The system is able to solve the problem. Design of data processing system interface on analysis of variance There are four parts of the system interface [4]. 1 Parameter settings. Using the popular pull-down menu, you can set the number of factors from lto 9, set the number of repetitions from 1 to 5. The number of level of each factor can be set from 2 to 10 [5]. Advanced Materials Research Vols. 268-270 2145 2 Data . Data with copy and paste function can be realized by using MSFlexGrid cyberware and a floating text box [6]. The whole table data can be copied and pasted. It’s very convenient. 3 Data processing. If you have finished ting all the data, the button “data processing” can be pressed, otherwise the prompt dialog which says “There is still a null value.” will pop up. After completion of data processing, the results will be displayed in the results column, including sources of variance, sum of square, degree of freedom, mean square, F value, etc. 4 Results saving. After completion of data processing， you can press the button “Save results” and save it as a excel document. The saved contents include parameter settings, test data and analysis of variance results. It is convenient for later queries. Data processing s on analysis of variance Obtain the serial sources of variance. The serial sources of variance have one to one relationship between natural numbers. It is shown in Table 1. Table 1 The relationship between the serial sources of variance and natural numbers Natural number 1 2 3 4 5 Binary 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 0 1 0 1 Serial letters D c B A D c B A D c B A D c B A D C B A Sources of variance A B AB c AC The implementation code is as follows For i 二 1 To 2 A factor num 1 factor num is the amount of factors factor jnamei ““ 1 factorname is the name of source of variance For j 0 To factor num - 1 If i \ 2 A j mod 2 Then factor namei 二 factor namei Chr65 j End If Next Next Relationship between the role name and series of data. In the system, the test data is assigned to a two-dimensional array of datai j, where i represents the number of repetitions and j represents test data No j. It has one to one relationship between the role name of data, as shown in Table 2. Table 2 The relationship between the role name and series of data Series of data 0 1 2 3 4 5 The role name of date A1B1C1 A2B1C1 A1B2C1 A2B2C1 A1B3C1 A2B3C1 Series of data 6 7 8 9 10 11 The role name of date A1B1C2 A2B1C2 A1B2C2 A2B2C2 A1B3C2 A2B3C2 Note assuming the test has three factors, factor A has two levels, factor B has three levels and factor C has two levels. The implementation code is as follows total num 1 total num represents the total number of data For i 二 0 To factornum - 1 total num 二 totalnum * levelnumi ’levelnumi is the number of level of factor No.i1 Next lev numO 二 1 2146 Computationa 丨 Materials Science For i 二 1 To factornum lev numi levjnumi - 1 * level_numi - 1 levjnumi is the product of the level numbers of the first i factors Next For i 二 0 To total num - 1 effectnamei 二 MM effect_namei represents the role name of data No.i1 For j 0 To factor num - 1 effect namei 二 effectnamei Chr65 j Chr49 i \ lev_numj Mod level_numj Next Next Calculation of degree of freedom. The implementation code is as follows For i 1 To 2 A factor num - 1 freedomi 二 1 1 freedomi is degree of freedom of source of variance No. i For j 二 0 To Lenfactor_namei - 1 freedomi 二 freedomi * levelnumAscMidfactor_namei， j 1， 1 - 65 - 1 Next Next Algorithm of data processing. The main implementation code is as follows For i 二 0 To 9 kii 0 Next data_total 0 data_total is difference between sum of square and square of sum divided by total number of data total 0 total is the sum of all data For i 二 0 To total num - 1 data_sumi 二 0 data_sumi is the sum of data of repeated test of the role name No.i1 For j 0 To repeat num - 1 data_sumi data_sumi dataj, i data_total data_total dataj, i A 2 total total dataj, i Next Next data_total datatotal _ total A 2 / repeat_num * totalnum For i 二 0 To factornum - 1 For j 0 To levelnumi - 1 fac_namei, j Chr65 i Chr49 j Next Next For j 1 To 2 A facto r n u m - 1 square_sumj 0 square_sumj is the sum of square of source of variance No j 1 1 0 For k 二 0 To Lenfactornamej - 1 For m 0 To factornum _ 1 If Midfactorjnamej, k 1, 1 Chr65 m Then kill二 m 一 11 11 1 End If Next Next Advanced Materials Research Vols. 268-270 2147 For fO 0 To leveljnumO - 1 flag 10 二 True 10二 fO For fl 二 0 To levelnuml - 1 flagll True i⑴ f i For f2 0 To level_num2 - 1 flagl2二 True 12 £2 sumi 0 For i 0 To total num - 1 flag 二 True For m 0 To Lenfactor_namej - 1 flag flag And InStrl， effect namei， fac_namekim， lkim Next If flag Then sumi sumi data sumi End If _ Next square_sumj square_sumj sumi A 2 For k 二 0 To Lenfactornamej - 1 If kik 2 Then flagl2 False End If Next If flagl2 二 True Then Exit For End If Next For k 0 To Lenfactor_namej - 1 If kik 二 1 Then flagll False End If Next If flag 11 True Then Exit For End If Next For k 二 0 To Lenfactornamej - 1 If kik 0 Then flaglO False End If Next If flag 10二 True Then Exit For End If Next num 二 1 For k 二 0 To Lenfactor_namej - 1 num num * level_numkik Next square_sumj square_sumj / repeat num * total num / num 2148 Computationa 丨 Materials Science square_sumj square_sumj - total A 2 / repeat num * total num Next Applications and features of data processing system on analysis of variance Applications of data processing system on analysis of variance. When filling a certain beverage with a canning machine, study the loss of volume caused by the ation of the bubble. Consider three factors nozzle A, operator B, working pressure C. Three factors all have three levels, each experiment was repeated twice, and the test data are shown in Table 3 [7]. Table 3 Test data of volume loss when canning Factor C working pressure ra.ULUi 1 2 3 Factor A nozzle 1 2 3 1 2 3 1 2 3 Factor B operator 1 -35, -25 17,24 -39, -35 100, 75 55, 120 90, 113 4,3 -23, -5 -30, -55 2 -45,-60 -65,-58 -55, -67 ■10, 30 -55,-44 -28, -26 -40,-30 -64,-62 -61, -52 3 -40, 15 20,4 15, -30 80, 54 110,44 110, 135 31,36 -20, -31 54,4 Use this system to analyze these data and the results are listed in Table 4. Table 4 Analysis of variance of test data of volume loss when canning Sources of variance Sum of square Degree of freedom Mean square F Significant level A 865.7778 2 432.8889 1.0421 B 60781 2 30390.5 73.1616 * 氺 AB 6396.889 4 1599.222 3.8499 * c 68187.11 2 34093.56 82.0762 * 氺 AC 7514.111 4 1878.528 4.5223 * BC 12462.56 4 3115.639 7.5005 * 氺 ABC 4634.556 8 579.3194 1.3946 Error 11215.5 27 415.3889 Population 172057.5 53 Look-up F distribution table shows F0.05, 2, 27 3.36, F0.05, 4, 27 二 2.74 and F0.05, 8, 27 2.32. Table 4 shows that the main effect of factor A nozzle is not significant, while the main effect of factor B operator and factor C working pressure have a very high significance, and all two-factor interactions have a high significance. Therefore, the nozzle has little effect on the test, working pressure and operator have a great impact on the test, and their interactions are also high. Features of data processing system on analysis of variance. The data processing system on analysis of variance has the following features. 1 Simple operation. Users only need to set parameters, the corresponding test data, press the button and the results of variance analysis can be seen. 2 System is stable and reliable. When user a null value, it will pop-up dialog box to provide wizard. Properties of the button will vary with the different system states, and the user can determine the system states by the state of the button. It plays the role of the wizard. So the system will not go wrong or crash. Advanced Materials Research Vols. 268-270 2149 3 Easy to data. User can a number of test data to the system by copy and paste , and not need to data one by one through keyboard. 4 Easy to save data. Analysis of variance results can be saved as excel document, the data includes three parts parameter settings, test data and analysis of variance results. It allows user to query all of the ination of analysis of variance clearly. 5 Accurate and reliable results. Analysis of variance results are accurate to four decimal places. Through many tests, the results are very reliable. Conclusion Data processing system on analysis of variance has good perance and simple operation. In the production and experiment it can play a significant role. For example, medical researchers can use this system to study the expression status of proliferating cell nuclear antigen PCNA in gastric cancer A group, gastric cancer tissues B group and normal gastric mucosa C group. As another example, in pulp production test, you can use this system to study the impact of cooking time, pressure and slurry concentration on paper strength. Data processing system on analysis of variance has a great role in production. It also has a certain significance in teaching. Reference [1] H. Wan, X.S. Li, Q. Su, et al. Multivariate Factoral Variance Analysis and Examples of SAS Program. Modem Preventive Medicine, Vol. 375, pp. 804-806, 2010 [2] F. Ren Variance Analysis with Excel for Interacted-Orthogonal Design. Computer Knowledge and Technology, Vol. 621, pp. 5800-5801, 2010 [3] W.J. Zhang, Y.H. Qi Algorithms Integration and Network Implementation of Eight Univariate Variance Analyses. Computer Applications and Software, Vol. 223, pp. 122-125, 2005 [4] J.J. Wei One Hundred Examples of Visual Basic Cyberware Program. Science Press, P.R.China, Beijing, 2002 [5] P. Li, L.K. Zeng, A.Z. Shui, et al. Design of Numerical Simulation Program for Thermal Field in Kiln Wall Based on Visual Basic. Industrial Furnace, Vol. 282, pp. 36-39, 2006 [6] M. Fu On Realization of Edit Capability of MSFLEXGRID Cyberware Grid Cell in VB. Sci/Tech Ination Development Economy, Vol. 112, pp. 32-33, 2001 [7] D.C. Zhang Experiment Design and Data uation. South China University of Technology Press, P.R. China, Guangzhou, 2001