Tuesday, June 5, 2018

My lecture on R-Programming in Whatsapp ...Box-whisker plot

Box-whisker plot


Today we started the discussion with how to *compare two similar datasets* with the help of boxwhisker plot.
When, we find that the data types are same
for example all the data are in continuous and when data size is very big.
Then sometimes we need to compare the training data or the test data with the final data.
Suppose we have collected 200 data and are based on likert scale measuring attitude towards job satisfaction.
And you want to compare the two sets of data one is from 1 to 100 and another from 101 to 200.
We are interested *to prepare the box whisker plot of the two sets of data*.
We can understand by using iris data:
Step 1
*iris1=iris$Sepal.Length [1:75]*
*iris2 =iris$Sepal.Length [76:150]*
Step 2
Test the data size of iris1 and iris2
*NROW(iris1)*
*NROW(iris2)*
Step 3
Make one data frame with iris 1 and iris 2
One vector like
*iris 1_2=data.frame(iris1,iris2)*
Step 4
Make box whisker plot for these two sets of data
*boxplot(iris1_2)*
Step 5
To find out the value of outlier
7 is the outlier we can get it by using *boxplot. Stats (iris3$iristest1)*
Here iris3 is the data frame.
*Cbind*.
Then the vector is equal to c (iris1,iris2). This vector include 2 elements iris1 and iris2
*iris3=c(iris1,iris2)*
To get the different parameters of iris1 and Iris2 we can use the
*sapply (iris3,mean)*
Likewise median /sd/range/summary
========================================================================


No comments:

Post a Comment