Module 1 b
BOXPLOT
Univariate
Q) b
Draw the boxplot of the following data,
b b b b b b b
X=80,60,90,10,40,60,70,20,40,30
Ans ) programme :
b b b
x<-c(80,60,90,10,40,60,70,20,40,30)
boxplot(x,main="Boxplot",ylab="x",col="red",pch=2,lwd=5)
Output : b
> x<-c(80,60,90,10,40,60,70,20,40,30)
b
>x
[1] 80 60 90 10 40 60 70 20 40 30
b b b b b b b b b b
> boxplot(x,main="Boxplot",ylab="x",col="red",pch=2,lwd=5)
>
,Bivariate
Q ) Draw the boxplot of the following data, X=80,60,90,10,40,6
b b b b b b b b b
0,70,20,40,30 Y=189,170,130,123,156,175,160,130,155,135
b
Ans ) programme :
b b b
x<-c(80,60,90,10,40,60,70,20,40,30)
y<-c(189,170,130,123,156,175,160,130,155,135)
boxplot(x,y,main="Boxplot",xlab="x",ylab="y",col="red",pch=2,lwd=5)
Output : b
> x<-c(80,60,90,10,40,60,70,20,40,30)
>x
[1] 80 60 90 10 40 60 70 20 40 30
b b b b b b b b b b
> y<-c(189,170,130,123,156,175,160,130,155,135)
>y
[1] 189 170 130 123 156 175 160 130 155 135
b b b b b b b b b b
,> boxplot(x,y,main="Boxplot",xlab="x",ylab="y",col="red",pch=2,lwd=5)
>
STEM AND LEAF DIAGRAM b b b
Univariate
Q ) Draw the stem and leaf diagram of the following data, X=80,
b b b b b b b b b b b b
60,90,10,40,60,70,20,40,30
Ans ) programme :
b b b
x<-c(80,60,90,10,40,60,70,20,40,30)
stem(x)
Output : b
> x<-c(80,60,90,10,40,60,70,20,40,30)
>x
[1] 80 60 90 10 40 60 70 20 40 30
b b b b b b b b b b
, > stem(x)
The decimal point is 1 digit(s) to the right of the | 0
b b b b b b b b b b b b b
|0
b
2 | 00
b b
4 | 00
b b
6 | 000
b b
8 | 00
b b
>
BAR PLOT b
Bivariate
Q ) Draw the Bar plot of the following data, X=80,60,90,10,40,6
b b b b b b b b b b
0,70,20,40,30 Y=189,170,130,123,156,175,160,130,155,135
b
Ans ) programme :
b b b
x<-c(80,60,90,10,40,60,70,20,40,30)
y<-c(189,170,130,123,156,175,160,130,155,135)
barplot(x,y,main="Barplot",xlab="x",ylab="y",col="red",pch=2,lwd=5)
Output : b
> x<-c(80,60,90,10,40,60,70,20,40,30)
>x
[1] 80 60 90 10 40 60 70 20 40 30
b b b b b b b b b b
> y<-c(189,170,130,123,156,175,160,130,155,135)
>y
[1] 189 170 130 123 156 175 160 130 155 135
b b b b b b b b b b
> barplot(x,y,main="Barplot",xlab="x",ylab="y",col="red",pch=2,lwd=5)
>