Lec 52 05 04 2023

IIT Kanpur July 201
20 followers
Oct 23, 2023
So, let us continue our lecture on the data visualization, we discussed about the data
visualization framework, the upsides and downside of it and what are the various tips when you
are trying to present a data, when we can present it for just for presentation itself,
we can present it for the interaction with the audience, we can present it for interactive
storytelling where the audience can ask the question or it incites the audience to have
more information about it, while clicking at various points or various figures or various
pictures in the website page that you have developed.
Now, the different kinds of the data chart or graphs or plot types are there, tables
are there, how do we present the data for data visualization, we will discuss in this
lecture.
When you talk about data visualization types, it could be certain targets, there could be
certain basic or primary functions that it has to fulfill, it could be comparisons,
it could be proportions, it could be relationships or hierarchies only to be shown, concepts,
location, path to a whole, then distribution.
If I talk about these graphs, these graphs allow you to get straight to the point, a
simple graph can tell a story of a thousand words as I said before, so these graphs allows
to get straight to the point, this also helps us to understand what are the trends, patterns,
exceptions in the data, when I say exceptions, I can see the outliers which are there, then
different kinds of the charts are there that could be used for comparison, if I talk about
the comparison charts only, one can visit the website which is given in the reference
here, it is dataviscatalog.com, where in comparisons we can have bar chart, we can have bubble
chart, may be box and whisker chart, certain other charts like line graph also is a kind
of a comparison, when we are trying to compare the sales in year 1 and year 2 or we are trying
to have a scatter plot even, where we are trying to compare one thing with other, we
are trying to have a correlation between them, so these all could be drawn, then an
important chart or plot here is bullet graph.
Because when I say exceptions, exception is outliers, the bullet graph helps us to understand
that what the exception is, so these charts are generally are having x and y axis which
I am mentioning, there could be certain charts without axis even like the donut chart or
maybe dot matrix or heat map, pie chart itself does not have even an axis, so when an axis
is there and when axis is not there, what are the advantages and disadvantages of these
that I will also discuss in the coming slides here in this lecture itself, so these are
the certain charts.
Then, we have proportions, when I talk about proportions, proportions could be the comparison
again in one way, it is a visualization method that use size or area to source differences
or similarities between different values or parts to a whole system, so Berber plot is
also one that shows proportion.
Then, we have a word cloud that shows proportion, when we try to write a big word, for example
if you put a big word data analytics that could be big colour in red, the colour of
different words related to it would be very close to it, the size of the word would be
telling maybe how often this word is being used in the data analytics, the word could
be data, it could be information, it could be big data, it could be interactive tools,
it could be computer, certain words in the word cloud could come, so these proportions
helps us to understand depending what is the size.
In the bubble plot itself, it is a 3 dimensional plot that I will also discuss, if 2 dimensions
are there in a scatter plot, the third dimension can put in a bubble plot with the size of
the bubble tells here the specific proportion of the specific parameter that we are trying
to talk about.
For example, the size of the bubble if it is presenting the age of the person, the larger
bubble will be presenting the person who is more aged than the person with the lower bubble
size.
Then we have certain other plots such as stacked bar charts, stacked bar graphs, these are
also comparisons.
Then comes the relationships, just number them 2, relationships means when we are trying
to connect between the different parameters and how are the variables are correlated,
there could be certain examples, it could be simple Venn diagram that you see, it could
be tree diagram, it could be simple bubble plot or scatter plot.
Heat map is also one of the examples, where we are trying to see what are the relationships
between the variables, the variables could be 2 or more, if 2 variables are there, scatter
plot could be used for example, if 3 variables are there, scatter plot turns into a bubble
plot or we can have certain other plots maybe heat map could be used.
Then arc diagram, cot diagram, these are all used for different relationship presentation.
Then comes hierarchy, simple hierarchy when we try to see top management, middle management,
lower level management, it is a simple tree diagram, there is one director at IIT Kanpur,
below him we have deputy director, we have different deans, different deans report to
the deputy director only, then different staff in that dean office reports to the dean, then
there is separate category of just below the director, which are the departments, in
the department we have different department, in different department we have head of departments,
this is a tree diagram.
Other than the tree diagram, we can even have a tree map or maybe circle parking, so these
are all visualization methods, where different objects are ranked and ordered together in
an organized system.
Now, we have concept notes as well here, concept note when I say concept graphs, it means we
are trying to brainstorm something or we are trying to illustrate something, it could
be multiple ways we try to put a concept, it could be Venn diagrams for example, simple
flow chart itself is a concept diagram right, then we have Venn diagram or maybe for brainstorm
itself, if you use different kinds of the word cloud, that also could be a concept.
Other than that we have location graphs, when I say location graphs, it only shows the data
over different geographical regions, this could again be the maps in representing in
a different form, it could be a bubble map that okay, it is a specific bubble, the people
who are taking the courses on data analytics in India, there are more people in Uttar Pradesh,
there are lesser number of people in Gujarat, there are even lesser number of people in
Tamil Nadu or so, this could be a bubble plot or bubble map, not plot, double bubble map,
where we are trying to say the location of the person, location of the specific map or
it could be flow map is even like the people from IIT Kanpur has flown to different parts
of the world, we can show a flow map from here to Australia, here to Canada, here to
different kind of companies in US or so, it could be also a flow map of location.
Then to path to a whole is also one of the categories of the data visualisation, where
one part is connected to the overall graph itself, so here the doughnut charts, the stacked
bars, one part is itself showing something, pie chart itself is a path to a whole, one
chart or one part of the pie, one pie that you are taking that is presenting one specific
category, one specific parameter here, so this is one kind of the chart.
Then we have distributions, this is very important when we talk about distribution, the different
kinds of distribution, it could be density plot, simple density plot that we call it
as when we say suppose a normal plot, it is a normal plot, technically it is just a density
plot, then telechart is also a distribution, timeline is also distribution, BOSC and whisker
is also distribution, so this can different kinds of distribution could be given in the
geographical data itself, the dot map, the flow map, the bubble map are also the distribution
charts as well.
There are certain other categories that we can see how the things work, this is a demonstration
or the label diagram of something, how the android form is working, then processes and
methods of something, different kinds of the patterns could be used, the range, data over
time, analysing test, reference tools, multiple kinds of the data visualisation charts and
graphs are available but still there are simple charts or simple graphs or simple tools which
are more important to understand, I will take only a few of them which are most prominently
used.
So let me start with very simple data presentation tool which are tables, when I say tables,
tables means where we are trying to present the data in a matrix form, it is X bar Y,
we have number of rows, number of columns, so here certain ingredients or characteristics
of table are we need to have a table title, the table presents the number of kids by sex
and age, we need to have a column title, it is age between 12 to 13, 14 to 15, 16 to 17
or so, then the total number of students which are there or the kids which are there, these
are the column titles, then we have the row titles, girls, boys, total.
In certain tables, we also have footnotes that tell some specific information which
is not put in the cells, the sample survey, fitness club, other notes and comments, this
comes as a footnote here, yes cells are most important here, girls aged between 12 to 13,
there are 5 girls, girls aged between 14 to 15, there are 6 girls, girls between 16 to
17 years of age are 2, total number of girls are 13, these are the cell points.
This is very important, tables present the data, the grouping of the data, we can have
a comparison between 2 different kind of the forms, okay point 1 is for example, if I need
to compare 2 different softwares depending upon number, point number 1 is speed, high,
low, then we have the availability, available, not available, then we have the cost, low,
high, a table could present this thing as well, so tables are very simple or directly
or very widely used data visualisation tools, I am taking table as a data visualisation
tools because the data is presented in the form of a tables, all the times it is there,
the table itself we are trying to generate the graphs, so tables are also sometime presented
if you see certain posters as well, certain tables are also presented there, so this is
the second table that presents average between 3 variables, it is height, weight, age, this
is the third table where several statistics are given for example, minimum, average, maximum,
so I would say statistics or the parameters are given here, minimum, average or maximum.
Another kind of the tables that we are presenting here are percentages, this is the starting
point of data visualisation, simple tables have only numbers here, now here I am trying
to present tables with percentages, when I say percentages, the frequencies which were
given in the first set are now converted into percentages, a sample percentages are directly
comparable to the population per percentages, so this is a basic rule, so percentages to
be used with caution because when the sample is small, percentage it does not mean anything,
if I say out of 3, 1 is successful, 33% is a success rate that does not mean much, if
the sample is high out of 300, if 100 have grown, I can say okay, 33% people have grown,
so if the sample size is smaller, percentages are not well targeted upon, so percentages
one may also perceive one dimension as a cause, another dimension as a effect in the percentages
even, the reason why we use row percent or column percent is often a particular interest
in the distribution of one dimension, while the other dimension is only seen in as a grouping
only.
For instance, here the girls and boys are taken as grouping, these are the different
age groups, we are saying 16.7% girls are there or 20% of girls are there between 14
and 15 or 6.7% girls are there between 16 and 17 age group, so total 43.3% are the girls
and 56.7% are the boys, the percentages are also important because the percentages help
us to also build up different kind of chart, for instance pie chart is build up through
the percentages only.
Let me talk about an important graph that is known as bar graph, when I say bar graph,
this is a bar presenting the heights in centimetre for girls, this is the key, the purple colour
and the dark pink colour is for boys, so height in centimetre is 148 for girls and for boys
it is 163, this is height and weight, two different bar graphs are put, these two are
comparable.
Now, bar graphs are familiar to most of the people in general, so in this case this kind
of the chart can be constructed to cheat with the scales as well, for instance if we just
need to say okay, the height between the girls and boys, this is the difference, this is
the showing that okay, the boys are this higher than girls, it is just presenting these are
our girls and these are the boys, directly we can see the difference between the heights
here.
Now, we can cheat with the scales here, for instance if I do not start my scale from the
origin, that is why I showed you the charts starting with the origin, without origin,
the charts that has origin can be used to cheat with scale, I am saying used to because
we only need to take advantage of it but this also comes as one of the demerits, when
the scale is there for cheat, we should not be cheated upon, for instance here you can
say it started from 0 to 180, you can see the rise between 148 to 163, it was only 15
points here, this rise here.
Here the scale started from 140, it looks like the boys are quite taller than girls,
so cheating with scales is there, so here bar charts in the line diagram itself, cheating
with scales do happen, so it is important to be aware of the axis when studying the
bar charts as well as when constructing them, it is important to be very careful about it,
so bar charts are very commonly used, these are the common bars, it could even be stacked
bars, yes height cannot be stacked, for instance if I say the sales in one year, it could be
this for example, this is product 1, 2, 3, 1, 2, 3, 1, 2, 3, so this is I could say year
2020, 2021, 2022, so these are sales, these are known as stacked bars, these are known
as stacked bars.
It could be vertically stacked, it could also be horizontally stacked bars, different examples
could be put for them, there is a bar which is stacked horizontally as well, certain examples
could be the number of students, number of students, it could be different branches here,
maybe mechanical engineering, then second one is electrical engineering and so on, it
could be computer engineering, see per year or what are the different ranks of the students,
so this could be horizontally and vertically stacked bars.
Next comes the line chart similar to bar chart, bar chart is when we have something in a discrete
form, we try to use a bar chart, line charts are also there, line charts are used to illustrate
a trend, you can see here is an increasing trend, bar chart is only comparison between
the two or multiple data points that is okay, this is high, this is low, when we need to
say that okay, this high and low also gives us a trend, it is increasing trend, decreasing
trend, then we come up with a line chart, this is the mean weight of the students, you
can see the age of the students or the kids and average weight is given, when we have
plotted that this is the average weight and this is the mean weight which is plotted here,
this is our line chart, so there are certain tips for it, when we are trying to put a line
chart here, use at most 4 lines because so many complex lines if you try to put, so many
lines here in the line chart, it would not give your message, great, try to use at most
4 lines and try to connect them with a solid line for example, this is a solid connection,
if I try to say this is line and try to have a disc dotted point, this is not recommended
and line graphs with a label itself are also important for example, this is a line graph
where I am presenting something, I can also put a label here, 13 year, this value I can
say this is 50 or I can say this value here for 15 years of age, this value is 61.75 or
so for example, if my focus of interest is only 15 years of aged girls, I can even highlight
this, so these are certain tips for the line graphs itself, yes cheating of scales when
line graphs is also there, you can see here because axis starts from 0, from 0 to 80,
you can see, we can only see the trend increasing from around 48 to 66, there is an increasing
trend here, 48 to 66, so this trend is which is to be shown higher, we can choose a different
scale starting from 45 to 70 only, the scale is chosen different here, so what was given
is specific this height with a scale starting from 0 is now shown in this height, scale
starting from 45 to 70, here it looks like that a trend angle is higher, you can see
if this angle, this angle let me say, if it is 30 degrees, the angle of the above graph
is only around may be 2 degrees only but it is giving the same data and same information
however, how do you read it again to keep the axis or choose the axis is an important
point when we talk about any plot that starts from origin, so cheating with axis is to be
taken care of.
Next comes the pie chart, pie chart is very important chart, there is no axis, no cheating
is possible here, I would say no cheating with scales, no cheating with scale possible,
so pie chart here you can only see the girls and boys, number of girls and number of boys,
it could be put in a histogram itself or a bar graph here, number of girls and boys
but here the cheating with scales could happen, if I start the scale from 10 to 15, I can
show here, okay these many girls are there and these many boys are there, it looks like
the number of boys are doubled here but it is only a 4 is the rise in the number, so
here there could be no cheating of scales and pie chart is very widely used.
So, there are certain characteristics of pie chart even, it is perfectly used for displaying
proportions and percentages in a part to a whole relationship, so here it is very important
tip is less is more, for example we can further divide this pie into the sun-bunch charts,
we can have certain distributions or we can have even have a fan plot of it but pie chart
in itself is less, it is trying to present the categories, I would say 5 categories
at most are recommended for here.
So, clearly labelling of the system also has to be there, for instance it is only given
13 and 17, it is only quantitative figure, if I need to convert into percentages, I can
given percentages even here, that is an important characteristic, so there are certain points
that sometimes we say okay, specific our area of interest in a specific pie chart could
be given as a separate entity but I do not recommend this thing, I would better present
it as just a part of itself, so this separation of the pie does not mean anything.
Pie charts could also be given in a 3 dimensional form or we can also present a pie chart here
itself with the bar diagram itself because pie charts gives us the broad information
of what our chart or what our data is trying to tell and histogram or the bar charts could
give us the detail information okay, what are the different kinds of the plots, different
kinds of the heights that we are trying to present.
Now, the pie chart is an important chart that does not have an origin, let us have a look
over few more charts such as scatter plot, scatter plot is best used when we compare
a variable with other, when 2 variables are both in the interval or ratio scales that
means that we have a quantitative data for instance, we have weight and height here,
we can compare that the weight and height, how is it related and definitely when we have
a scatter plot, we can always draw a trend.
Scatter plot is majorly one that helps us to understand the relationship between 2 variables,
we can have an understanding of the trend or what is the trend between 2 variables and
also we can have multiple trends as given for instance, if this is the height and the
weight of the badge of the students in a class that is now current, we can even have a comparison
between the badge of the students in the class, 5 years back for instance, another data plot
could be plotted here maybe and the second line of trend could be something like this,
so we can say a similar trend is there or maybe 1 degree slope difference is there,
so scatter plot is used for this specific purpose.
So, to show relationship between 2 variables, it is perfect to use the relationship for
large populations, so we use lines to show trends and relationships and obviously as
few as possible lines are used, 2 to 3 lines could be used, 2 to 3 lines or trends could
be used but it is always recommended to use one scatter plot for one kind of data plot
or one kind of the specific period of the time that we are talking about, to use as
few line as possible is the first tip.
The second tip here would be, y axis should always be started from 0, you can see the
x axis has started from 100 here, so y axis is always started from 0 because we start
from the origin itself without even cheating with scales, we start with the 0 itself that
what is the trend, how is the trend varying from the datum itself, 0, I would write it
here, y axis should start at, so this helps us to understand whether we really need the
correlation between the 2 variables which is height and weight here or not or on the
other hand, one cannot by any statistical methods or by studying graphs determine whether
there is a cause and effect, so causation is always missed in the scatter plot or in
the correlation plot even.
Another tip here would be, if there are outlier, those are very important for instance, if
this is scatter plot something like this and the trend is like this, if there is an outlier
there, this definitely becomes our course or the area of interest, if the outlier would
be here, the trend would go something like this, this outlier would be influencing the
trend because the average is going towards this side here, this is outlier, so this becomes
our area of interest, there are certain other things in the scatter plot that we can add
for example, if the third dimension is here with height and weight itself, if age is also
added here that plot is known as bubble plot, the bubble size is proportional to age, here
you can see for the same height and weight, where fitness data is there for the tables
that we saw in the previous slides here, if fitness data is there, you can say there were
13 girls, 17 boys, total 30 candidates were there, so these 30 candidates are plotted
here in the bubble plot with their ages as well, the age is also given in this data,
the ages ranges from 12 to 13 years for few, then 14 to 15 years and then for 16 to 17
years, they are categories or the classes of the ages here, in this bubble plot each
data point has its age and within that age group that lies, the use of the bubble plot
is that while using different size or colour of the bubbles, the bubbles can show relationship
between data in a very clear manner and that means the third or fourth variable could also
be introduced, here already 3 variables are there, one is weight, second is height, third
is age that is the size of the bubble, also I can put the colour of the bubble, colour
of bubble employs the category or I would say gender, for instance I can even colour
the bubbles here, let me say a colour, there are 13 girls, there are 13 bubbles which are
of green colour and the size of the bubble is anyway representing the age, I am putting
more girls on the downside because I do not have the specific data, this is just for example
because the girls are considered to be of lower weight and height might also be lower,
so there are 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, so here green colour I can put
a key, green colour are girls and the purple colour are boys, so we ended up with having
4 variables, number 1 is weight, height, age and fourth is a categorical variable that
is the gender.
In the bubble plot, there is a shape that for the bubble that is given is circle only,
we can also pick different shapes, circle is a very simple shape, there could be a shape
of the hexagon is even, there could be the shape of a diamond, there could be a shape
of square, it depends upon what kind of the shapes or what kind of graphs you are showing,
if you are showing trying to show different products, you can pick different kinds of
the bubbles even.
Here, the fifth variable could be the age groups now or the class of students now or
the previous, we can say different periods, example age is now, I can even plot another,
I will call it bubble even but it is of a different shape, this might be something of
the previous year, 30 points you can take, so we have 5 different variables in a single
plot where simple scatter plot was here, where only 2 variables were there, height and weight,
we added age as a bubble size, we added colour of the bubble as the gender, we added shape
of the bubble as another variable for different period right, maybe period 1 and period 2,
this is period 1, period 1 and this is period 2, so on, I will get 30 points right, for
the same people, the height that was taken in the previous period or the weight was taken
in the previous period, that is how it is different, that is the weight, weight was
the lower in the previous period, we can have interpretation like those, so this is a bubble
plot.
Now, an important point in the bubble plot is that the key should be given in a very
clear manner, the colour, the size and what are the different variables it is presenting,
number 2, the most fair way is the size of the bubble should be exactly proportional
to the data size or data point size that we are trying to present, instance if the age
is 10 years, the size of the bubble could be maybe 10 mm, if the age is 8 years, it
could be 8 mm, I am talking about diameter, yes, an important point is the bubble size
could be varied as per the dia or as per area, area of bubble or barred bubble, both could
represent, it depends upon how variable the data is, if the data variation is low, we
can use the diameter of the bubble only as the variation of the data, if the data variation
or variability is too heavy, one bubble could come very small, another would come very big,
we can take the area, in that case the variation would be looking lower, right, so it depends
upon what we are trying to present in the bubble plot.
Next come another kind of the plot, it is known as histogram, histogram is a special
or specific type of bar chart only where you can see the bars are there, bar 1, 2, 3, 4
and 5 which are placed at a specific distance, so here the frequency of the data values is
given and how do we visualize the distribution of data value that is given, it is the central
location of the data and how large is the spread of the data, both of things are given,
here the central height is 150 that is given here, it varies from 150 minus 40 plus 40
that is between 110 to 190, so measure of central tendency and measure of dispersion
both are given in this histogram, this x axis give me the measure of central tendency and
y axis give me what is the number of the students in the class, those who are having height
110, number of students in the class having height 130, when I say 130, it is a range
between may be 120 to 140 which is given the value 130 here, so you can see these values
10, 100, 1000, 10000, the how the number of bars should be stacked, this is the value,
so we cannot have 200 bars in one graph because we need the data should be meaningful, we
cannot have very complex diagram that no one understands, it is given yes, if the number
of values you have are 10, 3 graphs could be used, 10 values are there, use 3 graphs,
if the number of values are 100, use 7 graphs, if the number of values are 1000, use 10 graph,
if the number of values are 10000, use 13 graphs because this is being presented as
a discrete data as of now. At most 13 bars are only suggested as given
in the book by Madsen, there is a book, these all graphs are taken from that book only,
the title of the book is statistics for non-statisticians, the reference of the book is given in the
reference slide of this PPT, on the left hand side in the y axis, we are having the frequency
that gives me the measure of dispersion and anyway even the normal graph is also built
from the histogram itself, when the number of histograms are very large, we are trying
to have it as a continuous data, in this kind of the discrete data only maximum 13 bars
are suggested, when we try to have a continuous data, we can club the large number of bars
into a continuous line and if histograms are placed in such a way, so on these can be plotted
as a what I call as density plot that is taken from the histogram itself, so the general
consideration that you have in mind for having these many number of bars is only that the
bars should fit on the paper, if you try to print it, then you should be able to accommodate
all the observations, to accommodate all the observations only if 10,000 observations are
there, 13 bars could be put there, we divide it into the equal number of classes accordingly.
It is important that the data basic meaning is always covered for example, there are multiple
bulges here or there is only one bulge here in the data, this is a bulge, there could
be some data points in histogram itself, where there could be more than one bulges, it goes
something like this, in this case we cannot limit it to the 13 only because actual information
of the data, actual information or this specific knowledge that is to be taken out from these
two bulges has to come out, so intervals must be defined clearly, so that we have good number
of the bars, good means the right number of the bars that should fit through a paper that
should not make the data unclear.
So, this is histogram, histogram is very widely used, we will select the interval length,
we round off the result to the approximate number and we try to plot it to have the normal
graph even.
So, these were the all the major graphs which I discussed, which are very widely used, the
kinds of the graphs which are other than these are very widely also used in the website designs
such as box and whisker plot, there could be plots like different kinds of trees are
there for a decision tree itself, the tree plot is there, there could be bubbles which
are intersecting, which are also known as the Venn diagram itself, so multiple plots
are there, multiple charts and graphs are rather there, which are used in data visualization,
I have only discussed very widely used data visualization plots here.
In the previous lecture, Professor Deepu Philip only discussed, how do you translate from
HTML to PHP, then to try to display the data, with this the course content is over, we have
covered majorly the data visualization techniques in this week and in the previous weeks, what
is discussed that I will discuss in the last lecture, where I will try to summarize the
course.
Thank you.
