Answer Sheet Komal Patil 8596

You might also like

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

Answer Sheet

Question NO 1
Aim:
To find max, min, mean, median and mode values by using
Iris dataset .
Table:
Sr.NO Input Output
1 sepal_length<- > max(sepal_length)
c(5.1,4.9,4.7,4.6,5.0,5.4,4.6 [1] 5.4
) > min(sepal_length)
max(petal_length) [1] 4.6
min(petal_length) > mean(sepal_length)
mean(petal_length) [1] 4.9
median(petal_length) >
mode(petal_length) median(sepal_length)
[1] 4.9
>
mode(sepal_length)
[1] "numeric"
2 sepal_width<- [1] 3.9
c(3.5,3.0,3.2,3.1,3.6,3.9,3.4 > min(sepal_width)
) [1] 3
max(sepal_width) > mean(sepal_width)
min(sepal_width) [1] 3.385714
mean(sepal_width) >
median(sepal_width) median(sepal_width)
mode(sepal_width) [1] 3.4
> mode(sepal_width)
[1] "numeric"
>
3 petal_length<- [1] 1.7
c(1.4,1.4,1.3,1.5,1.4,1.7,1.4 > min(petal_length)
) [1] 1.3
max(petal_length) > mean(petal_length)
min(petal_length) [1] 1.442857
mean(petal_length) >
median(petal_length) median(petal_length)
mode(petal_length) [1] 1.4
> mode(petal_length)
[1] "numeric"
4 petal_width<-
c(0.2,0.2,0.2,0.2,0.2,0.4,0.3 [1] 0.4
) > min(petal_width)
max(petal_width) [1] 0.2
min(petal_width) > mean(petal_width)
mean(petal_width) [1] 0.2428571
median(petal_width) >
mode(petal_width) median(petal_width)
[1] 0.2
> mode(petal_width)
[1] "numeric"
>
Appendix:

Question 2:
Aim:
To find the correlation between the age of cars and annual
maintenance .
Table:
Sr Input Output
n
o
1 Age_cars=c(2,4,6,7,8,10,12) [1]
Annual_Cost=c(1600,1500,1800,1900,1700,2 0.83574
100,2000) 48
result=cor(Age_cars,Annual_Cost)
result=cor(Age_cars,Annual_Cost,method
="spearman")
result=cor(Age_cars,Annual_Cost,method
="pearson")
result

Appendix :

Interpretation :
From Above table we can conclude that the, The correlation
between the Age of cars and annual maintenance is
0.8357448 .
Question 4
A)
B)
input
a<-c(90,50,100,40,20)
pie(a)
mylabel<-
c("AB1","AB2","AB3","AB4","AB5")
pie(a,label=mylable,main
="Amount produces in MT")
colours<-
c("red","blue","pink","violet","yell
ow")
pie(a,label=mylable,main
="Amount produces in
MT",col=colours)

You might also like