Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 29

THE EFFECT OF DIFFERENT POTENTIAL OF HYDROGEN AND THE AMOUNT OF

CALCIUM IN THE SOIL ON THE GROWTH RATE OF RICE SEEDLING USING

FACTORIAL DESIGN.

PRESENTED BY

KANYI JANIFFER WAIRIMU

P102/0957G/19

RESEARCH PROJECT SUBMITTED IN PARTIAL FULFILLMENT FOR THE AWARD

OF DEGREE IN BACHELOR OF SCIENCE IN APPLIED STATISTICS WITH COMPUTING

KARATINA UNIVERSITY

2023.

i
DECLARATION.

I declare that this research project is my original work and has not been presented for examination

to any other University.

Sign------------------------------------- Date ---------------------------

KANYI JANIFFER WAIRIMU

P102/0957G/19

SUPERVISOR’S APPROVAL

“This research project has been submitted for examination with our approval as university

supervisors”.

Signed………………………………. Date……………………

Name……………………...…………

ACKNOWLEDGEMENT

ii
I first take this chance to acknowledge the Almighty God for being with me throughout this process. He

has been faithful to me for good health throughout my research process; I also recognize my supervisor

Mr.Kamau for his availability and support with my research and finally my parent and guardians for their

endless support in my studies.

ABSTARCT

Rice production plays a very crucial role in the fight against hunger as it is among the staple foods in
iii
Kenya. Rice farming is affected by many factors two among them being the soil pH and amount of

calcium in the soil, which if not well considered during plantation of the seedlings lowers the yield of

rice. Farmers do not have enough information about how these two factors are likely to affect the growth

of the rice from the nursery to the final product. In most cases the seedlings may be exposed too high

calcium levels and very low levels and without noticing the effects the plant is transplanted to another

region with the same levels of calcium leading to stunted growth hence low produce. Kenya’s

consumption rate of rice has really increased with production rate of rice reducing due to such factors.

This study will aim at finding out the effects of different levels of pH and amount of calcium in the soil

on the different rice seedling using the factorial design. Therefore, the small scale farmers of mwea

Kirinyaga county, county government of Kirinyaga and other individuals like the consumers will highly

benefit from this research on how the two factors affect the rice seedlings. Primary data is to be collected

from the experiment, which will be done and analyzed using R. The findings of this work will be

explained using the ANOVA tables. Finally, the research paper discusses the results and recommends

what should be done.

iv
Table of Contents

DECLARATION...........................................................................................................................1
ACKNOWLEDGEMENT............................................................................................................1
ABSTARCT....................................................................................................................................2
CHAPTER ONE: INTRODUCTION..........................................................................................3
1.0 BACKGROUND OF THE STUDY.................................................................................................3
1.1 STATEMENT OF PROBLEM.......................................................................................................4
1.2 PURPOSE OF THE STUDY.........................................................................................................4
1.3 MAIN OBJECTIVE....................................................................................................................4
1.4 SPECIFIC OBJECTIVES..............................................................................................................5
1.5 HYPOTHESIS OF THE STUDY....................................................................................................5
1.6 LIMITATION OF THE STUDY....................................................................................................5
1.7 DELIMITATIONS OF THE STUDY..............................................................................................5
1.8 SIGNIFICANCE OF THE STUDY.................................................................................................5
1.9 OPERATIONAL DEFINITION OF TERMS.....................................................................................6
CHAPTER TWO: LITERATURE REVIEW.............................................................................7
2.0 INTRODUCTION.......................................................................................................................7
2.1AMOUNT OF CALCIUM IN THE SOIL.........................................................................................7
2.1.1 Calcium deficiencies.......................................................................................................7
2.2 SOIL PH..................................................................................................................................8
2.2.1 Effects of soil pH.............................................................................................................8
2.3 RESEARCH GAP.......................................................................................................................8
CHAPTER THREE; METHODOLOGY.................................................................................10
3.0 INTRODUCTION.....................................................................................................................10
3.1 RESEARCH DESIGN................................................................................................................10
3.2 TARGET POPULATION AND PROPOSED STUDY AREA.............................................................10
3.3 METHOD OF DATA COLLECTION...........................................................................................11
3.4 DEFINITION OF VARIABLES...................................................................................................11
3.5.1 Field layout...................................................................................................................12
3.5 METHOD OF DATA ANALYSIS...............................................................................................12
3.5.1 Two -Factor factorial ANOVA table.............................................................................12
3.6 ASSUMPTION OF THE STUDY.................................................................................................13
CHAPTER FOUR: RESULTS AND DISCUSSION................................................................14

v
4.0 INTRODUCTION.....................................................................................................................14
4.1 FEEDING THE DATA INTO R SOFTWARE................................................................................14
4.2 ANOVA TABLE...................................................................................................................14
4.3 Q-Q PLOT.............................................................................................................................15
4.4 INTERACTION PLOTS.............................................................................................................16
4.5 INTERPRETATION OF THE RESULTS.......................................................................................17
4.5.1 Main effect.....................................................................................................................17
4.5.2 Interaction effect...........................................................................................................18
4.6 SUMMARY.............................................................................................................................18
CHAPTER FIVE: SUMMARY, CONLUSION AND RECOMMEDATIONS.....................19
5.0 INTRODUCTION.....................................................................................................................19
5.1 SUMMARY.............................................................................................................................19
5.2 CONCLUSION.........................................................................................................................20
5.3 RECOMMENDATION..............................................................................................................20
REFERENCE...............................................................................................................................21

vi
CHAPTER ONE: INTRODUCTION

1.0 Background of the study

Agriculture is the backbone of the economy of Kenya contributing to about 34% of

Kenya’s gross domestic product (GDP). Rice is among the most popular main food crops grown

in Kenya. Rice production plays a very crucial role in the fight against anger as it is ranked the

third staple food in Kenya after maize and wheat and also as a source of livelihood from the

labor and crops production. In Kenya the production of rice is mainly dependent of the small

scale farmers in the central part of Kenya (mwea), Ahero, Bunyala, Msambweni, west Kano,

Kuria and Migori.

Currently Kenya is capable of producing above 11.2t ha -1. But in spite of such a high

production capability, from the recent record of rice produced, Kenya can only manage a 6.96t

ha-1. Such rate of rice production has created gaps between the rate of consumption and

production. As earlier said rice is one of the Kenya’s main food crop which mean a large

population which continues to increase each and every year depend on the rice for food. In order

to close the gap between production and consumption rate this mean that some factors affecting

the growth of rice need to be considered especially during the first stage of rice cultivation which

is the vegetative phase. There are two factors that farmers need to consider during rice farming

which is the soil pH and the amount of calcium in the soil since without healthy rice plants the

yields will automatically reduce. Most farmers do not have such kind information and knowledge

and neither can they carry out such experiments like the factorial experiments comparing the

effects of calcium and pH on the growth of the rice which would help them understand how

these two factors affect the growth of the rice seedlings.

1
This study applies the use of factorial design with “k” factors and two levels. With this

therefore this study aims to study the effects of the two factors and their interactions. For

example, helping to know whether the combination of different levels of calcium and pH would

be efficient in the growth of rice plant

1.1 Statement of problem

Rice farming is affected by many factors two among them being the soil pH and amount

of calcium in the soil, which if not well considered during plantation period lowers the rice

produce. Therefore, there is the need to determine the best pH and calcium levels that favors

healthy growth of the rice seedlings. And provide the farmers with such information so that they

can improve their quality and quantity of rice production.

1.2 Purpose of the study

Different calcium levels in the soil affect the pH levels differently as a certain level can

be beneficial to the plant while another damages the plant. Therefore, the purpose of the study is

to find out the effects of different levels of pH and amount of calcium in the soil on rice growth

and their interactions effects using the two factor factorial design. This research study covers the

application of the two factor factorial design on the growth of rice culm diameters. Factor A with

a levels being the reactants which are pH and calcium factor B with b levels being calcium. At

the end of the study this research will be able to provide farmers and any other agricultural

specialist with information helpful in improving the growth of rice hence high produce.

1.3 Main objective

To test the effect of different levels of factor A (pH) and factor B (calcium) in the soil on

the rate of growth of rice seedlings and the interaction effect between factor A and factor B

levels.

2
1.4 Specific objectives

1. To develop an up-to two factor factorial design

2. To test the significance of factor A levels and factor B levels of rice stems.

3. To test the effect of the interaction between factor A levels and factor B levels.

1.5 Hypothesis of the study

H 0 : The pH levels are not significant

H 1: The pH levels are significant

H 0: The calcium levels are not significant

H 1 : The calcium levels are significant

H 0: There is no interaction between levels of factor A and B

H 1: There is an interaction between the levels of factor A and B

1.6 Limitation of the study

 Financial constraints-funds to collect secondary data

 Time –more time is consumed in data collection.

 Accuracy of the data- some values may not be correct and consistent

1.7 Delimitations of the study

This research study only focuses on two factors affecting the growth of rice even though

there are other several factors that affect the rate of the growth rice.

3
1.8 Significance of the study

The findings from the research study aims to provide Mwea the rice farmers, county

government and the academicians with information on the calcium and PH factor levels affect

the growth of rice and their interaction effect. The study also helps in bridging the gap between

consumption and rice production in Kenya as it helps the small scale famers in Mwea with

knowledge on how to control this two factor by using the appropriate levels.

1.9 Operational definition of terms

 pH- potential of hydrogen

 Calcium- it’s a secondary macronutrient in the soil which helps in the growth of plants, cell-wall

formation, pollination and cell division.

 Interaction- simultaneous change resulting from two or more factors.

 Culm- the rice stem

4
CHAPTER TWO: LITERATURE REVIEW

2.0 Introduction

According to Cox (2017) the factorial design examines how two or more independent

factors or variable impact the dependent variable. This chapter contains the theoretical

foundation of the study, factors affecting the rate of growth of rice seedlings in the nursery bed.

The considered perceived factors are the soil's acidity or alkalinity and the amount of calcium in

the ground. The rate of growth of a plant (rice seedlings) depends on several factors, but the

research work only majored on two factors. In attaining different soil pH, the experimenter used

elemental Sulphur and soda ash to achieve different values of Ph. A ccording to

Haynes, R. J. The elemental is the cheapest way of lowering the soil ph. He suggests that when

added the soil bacteria converts the sulfur into a sulfuric acid which lowers the level of soil Ph.

The soda ash on the other hand plays a very important role of increasing alkalinity in the soil.

2.1Amount of calcium in the soil.

Calcium division, and pollination plays a vital role in most plant growth, specifically cell

wall development, cell division and pollination. Calcium in the form of due to improper cell wall

formation according to choundhary and kharche most agricultural soils comprise of considerable

amounts of calcium (Choudhary & Kharche, 2018). They also suggest that a good estimate is

that for each of the exchangeable calcium is always equivalent to about 400kg/ha to around a

depth of 15cm. Most soils contain a number of tons of exchangeable calcium on cation

exchangeable sites.

2.1.1 Calcium deficiencies

Since calcium is not mobile within the plant, the plant relies on transpiration in which

plant roots take up soil solutions that contain Ca, transport them to the required areas of the plant

5
which is the tips of the crop. According to Koch Anything that slows transpiration, such as high

humidity or cold temperatures, can induce Ca deficiencies even if Ca levels are sufficient in the

growing medium (Koch, 2020). As calcium helps in the cell walls and the cell membranes it can

also be harmful if applied in very large quantities as the plant cannot stand anymore. Koch

therefore suggests that it is important for farmers to determine the level of calcium a plant

requires so as to increase on the quantity and quality of the yields.

2.2 Soil pH

Soil pH is the measure of acidity or basicity of soil. Fine defines it as the negative

logarithm of the hydrogen ions concentration in the ground. (Fine, 2017). The pH scale runs

from one to fourteen at a value of seven; the concentration of hydrogen ions is neutral (neutral

pH that is neither acidic nor basic) as the pH values increase from seven basicity increases while

when it decreases from seven acidity increases. Several factors cause the difference in the pH

values. These include the soil parent material and amount of yearly rainfall an area receives.

Most plants enjoy slightly acidic conditions.

2.2.1 Effects of soil pH

According to Zhang pH levels have indirect, yet far-reaching effects on plants at lower

rate of growth as the plant can't manufacture enough food to support it. different plants require

different levels of pH during their growth process. Some plants can survive very well in acidic

conditions while others definitely die and wither out as they are favored by basic conditions. The

other thing is that it can cause plant poisoning should it be shallow. According to Zhang

maintaining the pH of soil at the right level is a continuous process, especially in natural acidic

soils since rainfall, fertilizers can shift your pH and cause harm to the seedlings (Zhang et al.,

2020).

6
2.3 Research gap

Most conducted research on agricultural products mainly covers about the major factors

which affect the growth of rice like effects of fertilizers and many others. They have therefore

neglected other factors like the soil pH and calcium naming them as minor not knowing that they

too highly contribute in the growth of the rice plant. In most experimental research project, the

researchers have often used the randomized completely block, design, randomized block design

and others leaving out the two factor factorial design.

7
CHAPTER THREE; METHODOLOGY

3.0 Introduction

The methods- sections of a research paper is the systematic, theoretical analysis of the

methods applied to a field of study. It comprises the theoretical analysis of the body of methods

and principles associated with a branch of knowledge.

3.1 Research design

Data was collected by carrying out a factorial design which involves factor A (pH) and B

(calcium), where each had two levels that is, high and low levels of calcium and high and low

levels of ph. A complete replicate of such a design required a 2x2x2…x2 = 2 k observations

commonly known as the 2k design. The base in this case represented the number of levels which

were two while the power is the number of factor which are also two. This design allowed the

use of both the qualitative and quantitative data but in this study the Quantitative data was the

most considered.

This design is the most appropriate for this study because all the possible treatment

combinations of factor levels can be investigated in each and every replicate. The main purpose

of using this design is because it easily identifies the effects of the factors and most important the

interaction effects among the two different factors.

8
3.2 Target population and proposed study area

The target population for the study was the rice nursery, where the height of the rice

seedlings represented the rice population. The experiments of the study mainly focused on heights

of the seedling within 40days in a nursery bed. The experiment was carried out at Kenya

agricultural and livestock research organization (Nairobi county).

3.3 Method of data collection

The data used in these projects was secondary data obtained from KALRO which means

the researcher was not directly involved in data collection in the field. Nevertheless, after

consulting the KALRO officials, they were able to explain on the procedure used to gather the

data. The method of data collection employed in collecting the data was mainly observational

and recording of results from the experiment. The measurement taken were the heights of the

rice seedlings measured in centimeters and the values recorded. Observational method of data

collection was considered as it helps gather the data within a concise period and at a relatively

cheap cost. It was also the only method that could give us the effective required data for the

study (Kalashnikov et al., 2018). The measurements were taken using a thirty-centimeter ruler

lubricated in centimeters with the millimeter scale.

3.4 Definition of variables

In this study, the dependent variable is the observations made, the heights of rice

seedlings under different levels of calcium amounts and soil pH. The independent variables are

the soil pH values and amount of calcium in the soil and also the interaction of the two factor

level.

The model used is of the form:

y ijk = μ+α i + β j +¿

9
y ijk =the observations taken under ith level of factor A of Jth level of factor B in the Kth replicate.

µ=overall mean

α i= effect of the ith level of factor A

β j =effect of the jth level of factor B

¿= effect of interaction of ith level of factor A and jth level of factor B

ε ijk=random error component N (0, δ2)

Factor A – potential of hydrogen (low and high levels)

Factor B- calcium (low and high level)

3.5.1 Field layout

Factor A Factor B low (-) high (+) Totals

Low (-) Y111, Y112, …. Y11n Y121 Y122,…. Y12n Y1..

High (+) Y211,Y212,…Y21n Y221, Y222, …..Y22n Y2..

Totals Y.1. Y.2. Y…

Factors Treatment Replicating Totals

A B combination

_ _ A Low B Low Y111, Y112, …. Y11n Y11 (I)

+ _ A High B Low Y211,Y212,…Y21n Y21 A

_ + A Low B High Y121 Y122,…. Y12n Y12 B

+ + A High B High Y221, Y222, …..Y22n Y22 Ab

10
3.5 Method of data analysis

This research study used both the two factor ANOVA table and R programming in the analysis

of the replicate of the factor levels (data).

3.5.1 Two -Factor factorial ANOVA table

Source Degree of Sum of Mean squared error F value P

of variation freedom squares

A 1 SSA MSA= SSA/(1) FA = MSA/MSE

B 1 SSB MSB = SSB/(1) FB = MSB/MSE

AB 1 SSAB MSAB = SSAB/(1) FA∗FB=MSAB/MSE

Error 4(n-1) SSE MSE= SSE/4(n− 1))

Totals 4n-1 SST

Table 3.1: two factor factorial ANOVA

3.6 Assumption of the study

1. It is assumed that the amount of calcium and pH are independent.

2. Factors are fixed

11
CHAPTER FOUR: RESULTS AND DISCUSSION
4.0 Introduction
This chapter contains the results of the data analyzed; the analysis is also discussed, which

involves explanation, description and description and interpretation of the results. The results are

presented in the form of tables and figures for straightforward interpretation.

4.1 Feeding the data into R software


Treatment Replicates

combination

A (pH) B (calcium) I II III

4 10 28 25 27

7 10 36 32 32

4 30 18 19 23

7 30 31 30 29

This is the initial data obtained from the experiment before entering it into R software. The

values in the table represents the seedling height (cm) which was recorded after a period of four

weeks. The first two columns (pH and calcium) represent the two factors and the levels that were

applied in the field. The other three columns represent the values the replications of the rice

seedlings heights (cm)after a given period.

12
4.2 ANOVA Table
Analysis of variance (ANOVA) is a test which provides assessment of the statistical differences

within more than two groups of an experiment. the results obtained using the ANOVA test are

usually displayed in a tabular manner referred to as the ANOVA table. It is the work of the

ANOVA table to display the statistics that are used in testing the hypothesis about the population

means.in this case the ANOVA plays a very important role as it helps in interpreting and making

the final conclusion since it provides the P-values which is compared with the confidence

interval to make the necessary conclusions.

The table above is the ANOVA table which will help in making statistically correct

interpretations and conclusions since it provides F-values and p-values which should be

compared with the Fishers values in the table with the help of the confidence level.

13
4.3 Q-Q Plot

In statistics course the quantile –quantile (Q-Q) plot play a very crucial role in graphically

analyzing and comparing two probability distributions through plotting their quantiles against

each other. If the two distributions being compared are equal, then that means that the points on

the QQ plot must all lie perfectly on a straight line y=x. therefore the above QQ plot is not

normal since the bottom end deviates from the straight line which implies that it has a long tail to

its left hence it is negatively skewed.

4.4 Interaction plots


The plots help the researcher to determine if there is any effect of one of the independent

variable depending on another independent variable. The graphs below represent the interaction

of the two factors. In factorial design the interaction of factors is said to be absent if the plotted lines

are parallel and considered to be present if the lines meet or intersect at a point within the given

responses. In our case the lines are not parallel and neither do they meet. So these means that at

the height of 18- 32cm of the rice seedlings there cannot be any interaction between the factors

but as the height of the rice seedling increases there is a chance of the factors interaction.

14
15
4.5 Interpretation of the results

4.5.1 Main effect


4.5.1. H 0: The calcium levels are not significant

H 1 : The calcium levels are significant

In the ANOVA table the p-value of factor B reads as (0.002362) which is less than the

level of significance (0.05). Therefore,we reject the null hypothesis at 5% level of significance and

conclude that the effect of the calcium levels are statistically significant.

4.5.2 Interaction effect


H 0: There is no interaction between levels of factor A and B

H 1: There is an interaction between the levels of factor A and B

Since the p-value of the interaction of the two factors (0.182776) is higher than our 0.5% level of

significance; therefore, we fail to reject the null hypothesis at the level of 5% level of

significance and conclude that there is no interaction between factor A and factor B.

4.6 Summary
This chapter is based on analysis and interpretation of data using the objectives of the study

which is to formulate a 2x2 factorial design, effects of the two factors and their interactions on

the growth of the rice seedlings. The data was analyzed using the R software which the

researcher in understanding the effect of the different factors towards the growth of the rice

seedlings. From the ANOVA table all the main effects of the two factor gave a p- value which is

less than our 5% confidence level which clearly means that the pH and calcium levels are

16
significant. Although the ANOVA table p-value on interaction denotes no significance between

the two factors, the interaction plots indicate that there might be a chance of interaction between

the factors as the height of the seedlings increase the other factors remaining constant.

CHAPTER FIVE: SUMMARY, CONLUSION AND RECOMMEDATIONS


5.0 Introduction
This is the final chapter of this study which brings together the other chapters of the study in

brief summary. In the summary the objectives, purpose and the protocol followed to achieve the

objectives and the hypothesis are included.

The chapter also provides the conclusion of the study which is the summing up of all the

activities carried out throughout the whole projects and majorly stating if the objectives of the

study were achieved.

At the end of this chapter the researcher gives the recommendations which are based on the

conclusions drawn from the results of the study and appropriate advice to the individuals whom

the study concerns and the scholars who might find the study useful to them.

5.1 Summary
The main goal of this study was to test for effects of different levels of pH and calcium in the soil

and their combined effects towards the rate of growth of the rice seedlings which were examined

for a period of 40 days and the result (heights) recorded. The objectives I wished to achieve at

the end of the study were; developing an up-to two factor factorial design, testing if there is some

significance on factor A and factor B on the growth of rice seedlings and if there is any

interaction between the two factors. Rice is a very important staple food in Kenya but in the

recent years the consumption rate has greatly exceeded the production rate meaning there might

17
be a problem in rice farming in Kenya. That is why I decided to step in, in search for more

knowledge concerning the effects caused by different elements in soil that is pH and calcium

levels on the growth of rice seedlings. This study borrowed some ideas and information from

different researchers and literatures from various sources which also based their arguments and

claims on the effects of pH and calcium on the growth of rice. The different ideas from the

different researchers also helped me in developing the best design (factorial design) to use in the

analysis of the data obtained from the experiment by using the R programming language and

software. The results obtained helped in making sure that the objectives of the study were met as

it was the main purpose of the study.

5.2 Conclusion
From the data recorded that was recorded in the field experiment an analysis was carried out

using the R programming software and from the results chapter four it is evident that both

calcium and pH levels are statistically significant on the growth of the rice seedlings. On the

other hand, the analysis of the interaction effect from the ANOVA table indicate that there is no

interaction between the two factors. But using the interaction plots we were able to see that there

is a possibility of interaction between factor A and factor B since the lines are not completely

parallel. It means that as the height of the seedlings increase there might be an interaction.

5.3 Recommendation
Since time is always a changing factor we would advise farmers to always take a deep analysis

of the soil with the help of agricultural research organizations during the planting seasons since

the components in the soil might increase and decrease with time. Also the soil components are

distributed differently and so through the analysis they can be able to know the levels of different

components like pH and calcium that are appropriate for the better growth rate of the rice. For

higher productions of rice and profits then the farmers should keep records of their soil

18
components through the help of farming professionals since their measurements of the soil

components are much more accurate and elaborate than those performed at home.

Reference
Choudhary, O. P., & Kharche, V. K. (2018). Soil salinity and sodicity. Soil Science: An Introduction,

353-384.

Cox, G. M., & Cochran, W. G. (2017). Experimental designs. New York.

European Journal of Soil Biology, 96, 103151. Rice-Evans, C. A., Miller, N. J., & Paganga, G. (1996).

Structure-antioxidant activity relationships of flavonoids and phenolic acids. Free radical

biology and medicine, 20(7), 933-956.

Haynes, R. J. (1983). Soil acidification induced by leguminous crops. Grass and Forage Science, 38(1),

1-11.

19
Kalashnikov, D., Irpan, A., Pastor, P., Ibarz, J., Herzog, A., Jang, E., ... & Levine, S. (2018, October).

Scalable deep reinforcement learning for vision-based robotic manipulation. In Conference on

Robot Learning (pp. 651-673). PMLR.

Klotzbücher, Thimo, Christian Treptow, Klaus Kaiser, Anika Klotzbücher, and Robert Mikutta.

"Sorption competition with natural organic matter as a mechanism was controlling silicon

mobility in soil." Scientific Reports 10, no. 1 (2020): 1-11.

Rogers, E. J., Rice, S. M., Nicolosi, R. J., Carpenter, D. R., McClelland, C. A., & Romanczyk Jr, L. J.

(1993). Identification and quantitation of γ‐oryzanol components and simultaneous assessment of

tocols in rice bran oil. Journal of the American Oil Chemists' Society, 70(3), 301-307.

Yirga, C., Erkossa, T., & Agegnehu, G. (2019). Soil Acidity Management.

Zhang, K., Chen, L., Li, Y., Brookes, P. C., Xu, J., & Luo, Y. (2020). Interactive effects

of soil pH and substrate quality on microbial utilization.

20
# R code for 2^k Factorial Experiments

#Example: we use a 2^2 Factorial design with 3 replicates

#can be extended to 3 factors (2^3)or more

# Compute main effects and interaction effects

A <- c(-1, 1, -1,1)#shows the two factor levels for factor A

B <- c(-1, -1, 1, 1)#shows the two factor levels for factor B

I <- c(28, 36, 18, 31)

II <- c(25, 32, 19, 30)

III <- c(27, 32, 23, 29)

#run the data to show the layout

data<- data.frame(A, B, I, II, III)

data

# compute sums for each combination

sums <- apply(data[,3:5], 1, sum)

names(sums) <- c("(1)", "(a)", "(b)", "(ab)")

sums

#compute mean of responses

ybar <- sums/3

ybar

21
# Interaction plots

par(mfrow=c(1,2))

interaction.plot(A, B, ybar)

interaction.plot(B, A, ybar)

# Build ANOVA table

y <- c(I, II, III)

[1] 28 36 18 31 25 32 19 30 27 32 23 29

factorA <- as.factor(rep(A,3))

factorB <- as.factor(rep(B,3))

g <- lm(y ~ factorA + factorB + factorA*factorB)

anova(g)

windows()

# residual analysis

par(mfrow=c(1,2))

# normal plot

qqnorm(g$residuals)

qqline(g$residuals)

# residual plot

plot(g$fitted.values,g$residuals)

22
23

You might also like