You are on page 1of 4

EXPERIMENT 10 STATISTICS FOR

ENGINEERS

Course Code : MAT2001


Name : Mehta Karan Hemendra
Registration Number : 15BCE0877
Slot : L1+L2
Q1. Three different machines are used for a production. On the basis of
the outputs, set up one-way ANOVA table
and test whether the machines are equally effective.
Machine 1

Machine 2

Machine 3

10

20

15

16

11

10

10

14

CODE:
> data= read.csv("/home/mehtakaran9/Desktop/Data1.csv",sep = " ",header=T)
> data
[,1] [,2]
[1,] 12

[2,]

[3,]

7 14

>
> r = c(t(as.matrix(data)))

> f = c("Machine 1","Machine 2","Machine 3")


>k=3
>n=4
> tm = gl(k,1,n*k,factor(f))
> crdfit = aov(r ~ tm)
> summary(crdfit)

Q2. Five breeds of cattle B 1 , B 2 , B 3 , B 4 , B 5 were fed on four


different rations R 1 , R 2 , R 3 , R 4 . Gain in weight in kg
over a given period were recorded and given below:

B1

B2

B3

B4

B5

R1

1.9

2.2

2.6

1.8

2.1

R2

2.5

1.9

2.3

2.6

2.2

R3

1.7

1.9

2.2

2.0

2.1

R4

2.1

1.8

2.5

2.3

2.4

Is there a significant difference between


(a) breeds
(b) rations

CODE:
> data= read.csv("/home/mehtakaran9/Desktop/Data2.csv",sep = " ",header=T)
> data
[,1] [,2]
[1,] 12

[2,]

[3,]

7 14

>

> r=c(t(as.matrix(data)));
> f=c("B1","B2","B3","B4","B5");
> k=5;
> n=4;
> tm=gl(k,1,n*k,factor(f));
> blk=gl(n,k,k*n);
> rbdfit=aov(r~tm+blk);
> summary(rbdfit)

Q3. The following data resulted from an experiment to compare three


burners B 1 , B 2 and B 3 . A Latin square design was used as the tests
were made on 3 engines and were spread over 3 days.
Engine 1

Engine 2

Engine 3

Day 1

B1 16

B2 16

B3 - 20

Day 2

B2 - 16

B3 21

B1 - 15

Day 3

B3 - 15

B1 - 12

B2 13

Using R, test the hypothesis that there is no difference between the


burners.

CODE:
> days = c(rep("Day 1",1), rep("Day 2",1), rep("Day 3",1))
> engine = c(rep("Engine 1",3), rep("Engine 2",3), rep("Engine 3",3))
> burner = c("B1","B2","B3","B2","B3", "B1","B3","B1","B2")
> freq = c(16,16,15,17,21,12,20,15,13)
> mydata = data.frame(days,engine,burner,freq)
> mydata
days engine burner freq

1 Day 1 Engine 1

B1 16

2 Day 2 Engine 1

B2 16

3 Day 3 Engine 1

B3 15

4 Day 1 Engine 2

B2 17

5 Day 2 Engine 2

B3 21

6 Day 3 Engine 2

B1 12

7 Day 1 Engine 3

B3 20

8 Day 2 Engine 3

B1 15

9 Day 3 Engine 3

B2 13

>
> myfit = lm(freq ~ days+engine+burner, mydata)
> anova(myfit)

RESULT:

Analysis of Variance Table

Response: freq
Df Sum Sq Mean Sq F value Pr(>F)
days

2 34.889 17.4444 22.429 0.04268 *

engine

2 1.556 0.7778 1.000 0.50000

burner

2 30.889 15.4444 19.857 0.04795 *

Residuals 2 1.556 0.7778


--Signif. codes: 0 *** 0.001 ** 0.01 * 0.05 . 0.1 1

You might also like