You are on page 1of 8

MAT2001 - STATISTICS FOR ENGINEERS

DIGITAL ASSIGNMENT

FACULTY: - YOGALAKSHMI T
SLOT: - B2 + TB2
NAME: - BALAMURUGAN GUGAN S
REGISTERATION NUMBER: - 20MIS0402
Question 1)
> date()
[1] "Wed Dec 01 22:45:49 2021"
> #BALAMURUGAN GUGAN S
> #20MIS0402
>
data=c(1600,1610,1650,1680,1700,1720,1800,1580,1640,1640,1700,1750,1460,1550,1600,1620,1640,1660,
1740,1820,1510,1520,1530,1570,1600,1680)
>
batchs=c("batch1","batch1","batch1","batch1","batch1","batch1","batch1","batch2","batch2","batch2","bat
ch2","batch2","batch3","batch3","batch3","batch3","batch3","batch3","batch3","batch3","batch4","batch4",
"batch4","batch4","batch4","batch4")
> Anova1=aov(data~batchs)
> summary(Anova1)
Df Sum Sq Mean Sq F value Pr(>F)
batchs 3 44361 14787 2.149 0.123
Residuals 22 151351 6880

OUTPUT

We may regard the four batches of electric lamps to be homogeneous

Question 2)
> date()
[1] "Wed Dec 01 22:54:58 2021"
> #BALAMURUGAN GUGAN S
> #20MIS0402
>
data=c(24.7,20.6,27.7,16.2,16.2,24.9,27.3,28.8,22.7,15.0,17.0,22.5,38.5,39.5,36.8,19.6,15.4,26.3,28.5,31.0,34.9,14.1,1
7.7,22.6)
> blocks=gl(4,6)
> treatments=gl(6,1,24)
> rbdfit=aov(data~blocks+treatments)
> rbdfit
Call:
aov(formula = data ~ blocks + treatments)

Terms:
blocks treatments Residuals
Sum of Squares 219.4279 901.1921 229.6396
Deg. of Freedom 3 5 15

Residual standard error: 3.912711


Estimated effects may be unbalanced
> summary.aov(rbdfit)
Df Sum Sq Mean Sq F value Pr(>F)
blocks 3 219.4 73.14 4.778 0.0157 *
treatments 5 901.2 180.24 11.773 9.28e-05 ***
Residuals 15 229.6 15.31
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

OUTPUT: -
Here P< 0.05. Then Blocks are not homogenous .Treatments effects are not alike .
Question 3)
> date()
[1] "Wed Dec 01 22:59:22 2021"
> #BALAMURUGAN GUGAN S
> #20MIS0402
> fertil <- c(rep("fertil1",1), rep("fertil2",1), rep("fertil3",1), rep("fertil4",1),rep("fertil5",1))
> treat <- c(rep("treatA",5), rep("treatB",5), rep("treatC",5), rep("treatD",5), rep("treatE",5))
> seed <- c("A","E","C","B","D", "C","B","A","D","E",
"B","C","D","E","A","D","A","E","C","B","E","D","B","A","C")
> freq <- c(42,45,41,56,47, 47,54,46,52,49, 55,52,57,49,45, 51,44,47,50,54,44,50,48,43,46)
> mydata <- data.frame(treat, fertil, seed, freq)
> myfit <- lm(freq ~ fertil+treat+seed, mydata)
> anova(myfit)
Analysis of Variance Table

Response: freq
Df Sum Sq Mean Sq F value Pr(>F)
fertil 4 17.76 4.440 0.7967 0.549839
treat 4 109.36 27.340 4.9055 0.014105 *
seed 4 286.16 71.540 12.8361 0.000271 ***
Residuals 12 66.88 5.573
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
OUTPUT
• The difference between group considering the fertilizer is not significant (p-value
➢ 0.1);
– The difference between group considering the tillage is quite significant (p-value
• < 0.05);
– The difference between group considering the seed is very significant (p-value <
• 0.001)

Question 4) C.P-1

> date()
[1] "Wed Dec 01 23:05:01 2021"
> #BALAMURUGAN GUGAN s
> #20MIS0402
> data<-
c(14.85,15.00,15.25,15.10,14.80,14.28,14.42,14.16,14.15,14.19,14.50,15.25,15.30,15.10,15.35,15.00,14.60,1
4.84,14.82,14.74)
> machine<-c("A","A","A","A","A","B","B","C","C","C","C","D","D","D","D","D","E","E","E","E")
> Anova1=aov(data~machine)
> summary(Anova1)
Df Sum Sq Mean Sq F value Pr(>F)
machine 4 2.6205 0.6551 28.11 8.18e-07 ***
Residuals 15 0.3496 0.0233
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

OUTPUT
We may regard the machines to be homogeneous

Question 5) C.P-2

> date()
[1] "Wed Dec 01 23:09:59 2021"
> #BALAMURUGAN GUGAN S
> #20MIS0402
> data<-c(14,12,22,23,16,18,20,25,15,14,23,28,17,11,19,21,13,18,20,14,10,17,21,18)
> blocks=gl(6,4)
> machine=gl(4,1,24)
> rbdfit=aov(data~blocks+machine)
>
> rbdfit
Call:
aov(formula = data ~ blocks + machine)

Terms:
blocks machine Residuals
Sum of Squares 53.3750 263.4583 161.7917
Deg. of Freedom 5 3 15

Residual standard error: 3.284222


Estimated effects may be unbalanced

OUTPUT
Here P< 0.05. Then Blocks are not homogenous. MACHINE effects are not alike.

QUESTION 6: -
> date()
[1] "Wed Dec 01 23:13:58 2021"
> #BALAMURUGAN GUGAN S
> #20mis0402
> wheat<-c(rep("wheat1",1),rep("wheat2",1),rep("wheat3",1),rep("wheat4",1))
>
> yield<-c(rep("yieldA",4),rep("yieldB",4),rep("yieldC",4),rep("yieldD",4))
> seed<-c("C","A","B","D","B","D","A","C","A","C","D","B","D","C","B","A")
> freq<-c(25,19,19,17,23,19,14,20,20,21,17,21,20,18,20,15)
> mydata<-data.frame(wheat,yield,seed,freq)
> myfit<-lm(freq~wheat+yield+seed,mydata)
> anova(myfit)
Analysis of Variance Table

Response: freq
Df Sum Sq Mean Sq F value Pr(>F)
wheat 3 46.500 15.5000 7.3907 0.01937 *
yield 3 7.500 2.5000 1.1921 0.38933
seed 3 46.417 15.4722 7.3775 0.01944 *
Residuals 6 12.583 2.0972
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
OUTPUT

The difference between group considering the fertilizer is not significant (p-value > 0.1); – The difference
between group considering the tillage is quite significant (p-value < 0.05); – The difference between group
considering the seed is very significant (p-value < 0.001)

You might also like