0% found this document useful (0 votes)
5 views78 pages

Understanding Structured Data Types

Uploaded by

Shruti Mane
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views78 pages

Understanding Structured Data Types

Uploaded by

Shruti Mane
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Module 1

Exploratory Data Analysis


ELEMENTS OF STRUCTURED DATA

Structured data refers to data that is organized and formatted in a specific way to make it
easily readable and understandable by both humans and machines. It has well-defined
structure and it follows a consistent order and can be easily accessed and used by a
person or a computer program.

● generally stored in well-defined schemas such as Database


● generally tabular with column and rows that define its attributes
● Data conforms to a data model and has easily identifiable structure
Sources of Structured Data
● SQL Databases
● Spreadsheets such as Excel
● OLTP(Online Transaction Processing)
systems
● Online forms
● Sensors such as GPS or RFID tags.
● Network and web server logs
● Medical devices.
Structured Data

Structured Data
Structured data

Numerical Data
Numeric data Categorical Data

Continuous
Lorem Ipsum Discrete
Lorem Ipsum Binary Data Ordinal Data

Nominal Data
● Nominal Data: Data with no inherent order or ranking such as gender or
race.
● Ordinal Data: Data with an ordered series of information is called ordinal
data.
● Binary Data: A special case of categorical data with just two categories of
values, e.g., 0/1, true/false.
● Numeric: Data that are expressed on a numeric scale.
● Continuous: Data that can take on any value in an interval. (Synonyms:
interval, float, numeric)
● Discrete: Data that can take on only integer values, such as counts.
(Synonyms: integer, count)
● Categorical: Data that can take on only a specific set of values
representing a set of possible categories. (Synonyms: enums, enumerated,
factors, nominal)
Binary Data

● Binary data can have only two values. If you can place an observation
into only two categories, you have a binary variable.
● Binary variables are helpful for calculating proportions or percentages,
such as the proportion of defective products in a sample.

Examples of Binary Data :

○ pass/fail, male/female and the presence/absence of a


characteristic are all binary data.
Nominal Data
● Nominal Data is used to label variables without any order or quantitative
value. The color of hair can be considered nominal data, as one color can’t be
compared with another color.
Examples of Nominal Data :
● Colour of hair (Blonde, red, Brown, Black, etc.)

● Marital status (Single, Widowed, Married)

● Nationality (Indian, German, American)

● Gender (Male, Female, Others)


Ordinal Data
Ordinal data have natural ordering where a number is present in some kind of order by their
position on the scale. These data are used for observation like customer satisfaction, happiness,
etc., but we can’t do any arithmetic tasks on them.

Examples of Ordinal Data :

● When companies ask for feedback, experience, or satisfaction on a scale of 1 to 10.


● Letter grades in the exam (A, B, C, D, etc.)
● Ranking of people in a competition (First, Second, Third, etc.)
● Economic Status (High, Medium, and Low)
● Education Level (Higher, Secondary, Primary)
Discrete Data
● The term discrete means distinct or separate. The discrete data contain the values
that fall under integers or whole numbers.
● The total number of students in a class is an example of discrete data. These data
can’t be broken into decimal or fraction values.
Examples of Discrete Data :

○ Total numbers of students present in a class


○ Cost of a cell phone, Days in a week
○ Numbers of employees in a company
○ The total number of players who participated in a competition
Continuous Data
● Continuous data are in the form of fractional numbers. It can be the version of an
android phone, the height of a person, the length of an object, etc.
● Continuous data represents information that can be divided into smaller levels. The
continuous variable can take any value within a range.
In Table 1-1, there is a
mix of measured or
counted data (e.g.,
duration and price),
and categorical data
(e.g., category and
currency). As
mentioned earlier, a
special form of
categorical variable is
a binary (yes/no or 0/1)
variable, seen in the
rightmost column in
Table 1-1—an indicator
variable showing
whether an auction
was competitive or not.
Rectangular Data
● The typical frame of reference for an analysis in data science is a
rectangular data object, like a spreadsheet or database table.
● Rectangular data is the general term for a two-dimensional matrix with
rows indicating records (cases) and columns indicating features
(variables);
Data Frames and Indexes
● Data Frames are data displayed in a format as a table.
● A data frame is a table or a two-dimensional array-like structure in which
each column contains values of one variable and each row contains one set
of values from each column.
● Data Frames can have different types of data inside it. While the first
column can be character, the second and third can be numeric or logical.
However, each column should have the same type of data.
Data frames and indexes
● Indexing is a data structure technique which is used to quickly locate and
access the data in database.
● It optimises the performance of a database by minimising the number of
disk access required when a query is processed
● Indexes are created using a few database columns.
Structure of an Index in Database
● The first column is the search-key that contains a copy of the primary key or candidate
key of the table.
● The second column is the Data Reference or Pointer. It contains a set of pointers
holding the address of the disk block where that particular key-value can be found.
Attributes of Indexing
● Access Types: This refers to the type of access such as value-based search, range access, etc.
● Access Time: It refers to the time needed to find a particular data element or set of elements.
● Insertion Time: It refers to the time taken to find the appropriate space and insert new data.
● Deletion Time: Time taken to find an item and delete it as well as update the index structure.
● Space Overhead: It refers to the additional space required by the index.
Non-rectangular Data Structure
● Non-rectangular data structures are not neatly arranged in rows and
columns. Instead, they are often a culmination of separate data structures
where there is some similarity among members of the same data structure.
● Usually non-rectangular data are stored in lists.
Estimates of Location (Measure of location)
● Variables with measured or count data might have thousands of distinct
values. A basic step in exploring your data is getting a “typical value” for
each feature (variable):an estimate of where most of the data is located.
● Any arithmetic measure which gives the centre or central value of a set of
observations is known as a measure of central tendency or measure of
location
Mean
● The mean is the sum of all the values divided by the number of values
● Consider the following set of numbers: {3,5,1,2}.

The mean is (3 + 5 + 1 + 2) / 4 = 11 / 4 = 2.75.

● the symbol X̄ (pronounced “x-bar”) to represent the mean of a sample


from a population. The formula to compute the mean for a set of n values
𝑥1,𝑥2,...,𝑥𝑛 is:
Example: Calculate the mean of the first 10 natural numbers.
Example: Calculate the mean of the first 10 natural numbers.
Solution:
First 10 natural numbers = 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
Sum of first 10 natural numbers = (1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 +
9 + 10)
Mean = Sum of 10 natural numbers/10
⇒ Mean = (1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10)/10
⇒ Mean = 55/10
⇒ Mean = 5.5
Weighted mean
The sum of all values times a weight divided by the sum of the weights. Let’s assume there are
n number of items in a set i.e., {x1, x2, x3, … xn}, and the frequency of each item is given as
{f1, f2, f3, . . ., fn}. Then, the mean is calculated using the formula:

Trimmed mean
The average of all values after dropping a fixed number of extreme values.
Suppose that a marketing firm conducts a survey of 1,000 households to
determine the average number of TVs each household owns. The data show a
large number of households with two or three TVs and a smaller number with
one or four. Every household in the sample has at least one TV and no
household has more than four. Find the mean number of TVs per household.

Mean = 2.566
1. Consider a dataset of 20 values: [2, 4, 6, 8, 10, 12, 14, 16,
18, 20, 22, 24, 26, 28, 30, 32, 34, 36, 38, 40]. Calculate a
10% trimmed mean.
Median
● The median is the middle number on a sorted list of the data.
● If there is an even number of data values, the middle value is
one that is not actually in the data set, but rather the average of
the two values that divide the sorted data into upper and lower
halves.
● The sorting of the data can be done either in ascending order or
descending order. A median divides the data into two halves.
Example:

●Median salary of five friends, where the individual salary of each friend is, 74,000,
82,000, 75,000, 96,000, and 88,000. First arranged in ascending order 74,000, 75,000,
82,000, 88,000, and 96,000 then by observing the data we get the median salary as 82,000.
●Median Age of a Group: Consider a group of people ages 25, 30, 27, 22, 35, and 40. First,
arrange the ages in ascending order: 22, 25, 27, 30, 35, 40. The median age is the middle
value, which is 30 in this case.
●Median Test Scores: In a class, the test scores of 10 students are 78, 85, 90, 72, 91, 68,
80, 95, 87, and 81. Arrange them in ascending order: 68, 72, 78, 80, 81, 85, 87, 90, 91, and
95. Since there are an even number of scores, the median is the average of the two middle
values, which are 81 and 85. The median test score is (81 + 85) / 2 = 83.
Median Formula (When n is Odd)

If the number of values (n value) in the data set is odd then the formula to calculate the median is,
Median Formula (When n is Even)

If the number of values (n value) in the data set is even then the formula to calculate the median is:
Median of Grouped Data

Grouped data is the data where the class interval frequency and cumulative frequency of the
data are given. The median of the grouped data median is calculated using the formula,
Median = l + [(n/2 – cf) / f]×h
where,
○ l is Lower Limit of Median Class
○ n is Number of Observations
○ f is Frequency of Median Class
○ h is Class Size
○ cf is Cumulative Frequency of Class Preceding Median Class
Example: Find the Median of the following data, If the marks scored by the students in a class test out
of 50 are,
Example: Find the Median of the following data, If the marks scored by the students in a class test out
of 50 are,

Now using the formula,


Median = l + [(n/2 – cf) / f]×h
Comparing with the given data we get,
● l = 20
● n = 30
● f=6
● h = 10
● cf = 13

Median = 20 + [(15 – 13)/6]×10


= 20 + [1/3]x10
= 60/3 + 10/3
= 70/3 = 23.333 (approx)
Thus, the median mark of the class test is 23.3
Example 2: Find the Median of the following data,
If the marks scored by the students in a class test out of 100
are,

Ans:46.6667
Weighted Median:
Consider a weighted median value ‘wi’ when the elements are sorted such that the total
weight of the elements to the left of wi is half of the total weight. Or else such element will
be chosen as pivot whose total weights on left and right side will be of the least difference
possible after crossing the cumulative sum value of 50% of total.

It can be seen from the table that the weighted median element is 4 because at the weight
corresponding to element 4, the total cumulative sum passes 50%.
Mode
● Mode is the most frequently occurring value in a given set of data.
● For example, if a set of numbers had the digits 1,2,2,3,3,3,4,4,5 then the mode would be 3.

f1 is the frequency of the modal class

f0 is the frequency of the class preceding the modal class

f2 is the frequency of the class succeeding the modal class

h is the size of the class intervals

l is the lower limit of the modal class


For a class of 40 students marks obtained by them in maths out of
50 are given below in the table. Find the mode of data given.
For a class of 40 students marks obtained by them in maths out of 50 are given below in the
table. Find the mode of data given.

Maximum Class Frequency = 23


Class Interval corresponding to maximum frequency = 30-40
Modal class is 30-40
Lower limit of the modal class (l) = 30
Size of the class interval (h) = 10
Frequency of the modal class (f1) = 23
Frequency of the class preceding the modal class (f0) = 7
Frequency of the class succeeding the modal class (f2)= 10
Using these values in the formula
Mode = l + [(f1 – f0) / (2f1 – f0 – f2)]×h
⇒ Mode = 30 + [(23-7) / (2×23 – 7- 10)]×10
⇒ Mode = 35.51
Thus, mode of the dataset is 35.51
Calculate the mode of the following data:

To find the mode, we need to identify the class interval with Using these values in the formula
the highest frequency. In this case, the class interval with the
Mode = l + [(f1 – f0) / (2f1 – f0 – f2)]×h
highest frequency is 30-40, which has a frequency of 12.
⇒ Mode = 30 + [(12 – 8)/(2×12 – 8 – 9)] × 10
Modal class is 30-40
Lower limit of the modal class (l) = 30 ⇒ Mode = 30 + (4/7) × 10
Size of the class interval (h) = 10 ⇒ Mode = 30 +40/7
Frequency of the modal class (f1) = 12
⇒ Mode ≈ 30 + 5.71 = 35.71
Frequency of the class preceding the modal class (f0) = 8
So, the mode for this set of data is approximately 35.71.
Frequency of the class succeeding the modal class (f2)= 9
Other Measures of Location
1. Quartiles: When the measurements are arranged in increasing order, they divide the set of
measurements into equal parts,
a. The first quartile Q1 containing 25% of the measurement
b. The second quartile Q2 containing 50% of the measurement
c. The third quartile Q3 contains 75% of the measurement

Note: Q2 is the median

1. Decile: The first decile D1 contain 10% of the measurement. D2 contain 20% of the
measurement and so on.

Note: D5 is the median

1. Percentile: P1 contains 1% of the measurement. P2 contains 2 % of the measurement and so on.

Note: 50th percentile is the median.


Quartile
Quartile:
Q1 = [(n+1)/4]th item

Q2 = [(n+1)/2]th item

Q3 = [3(n+1)/4]th item
Find the Q1, Q2, and Q3 of the given dataset: 3, 5, 7, 8, 10,
11, 3, 1, 11.
We will arrange the data in ascending order: 1, 3, 3, 5, 7, 8, 10, 11, 11
Cut the list into Quarters: (n = number of terms)
● Quartile 1 (Q1) = [(n + 1)/4] th Term = [( 9+ 1) / 4] = 2.25 term
[Rounds off to 3 term] = 3
● Quartile 2 (Q2) = [(n + 1)/2 ] th Term = [{9 + 1)/2] = 5 th Term = 7
● Quartile 3 (Q3) = [3(n + 1)/4 ] th Term = [3 (10 + 1)/4] th Term =
7.5 th Term [Rounds off to 8 th Term] = 11
Imagine you conducted a small study on language development in children
1–6 years old. You’re writing a paper about the study and you want to report
the quartiles of the children’s ages.

Step 1: Count the number of observations in the dataset, Step 4: Find the second quartile
n = 2 + 3 + 4 + 1 + 2 + 2 = 14 n * (2 / 4) = 14 * (2 / 4) = 7
7 is an integer, so Q2 is the mean of the numbers at
Step 2: Sort the observations in increasing order :1, 1,
positions 7 and 8.
2, 2, 2, 3, 3, 3, 3, 4, 5, 5, 6, 6 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 5, 5, 6, 6
Step 3: Find the first quartile Q2 = (3 + 3) / 2
n * (1 / 4) = 14 * (1 / 4) = 3.5 Q2 = 3 years
3.5 is not an integer, so Q1 is the number at Step 5: Find the third quartile
n * (3 / 4) = 14 * (3 / 4) = 10.5
position 4.
10.5 is not an integer, so Q3 is the number at
1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 5, 5, 6, 6 position 11.
Q1 = 2 years 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 5, 5, 6, 6
Q3 = 5 years
Calculate Deciles-3 from the following data 10,50,30,20,10,20,70,30.
Calculate Deciles-7 from the following data
85,96,76,108,85,80,100,85,70,95

Ans: 95.7
Percentile
The distribution of fortnightly wages of 280 employees of an undertaking is given below.
Find the Q1, Q2 and Q3,D4,P66,P10,P90.

Fortnightly wages (Rs.) Frequency Fortnightly wages (Rs.) Frequency Cumulative Frequency
Less than 200 12
Less than 200 12 12
200-400 16
200-400 16 28
400-600 38
400-600 38 66
600-800 78
600-800 78 144
800-1000 80
800-1000 80 224
1000-1200 35
1000-1200 35 259
1200-1400 14
Above 1400 7 1200-1400 14 273

Total 280 Above 1400 7 280


1. Quartiles:
Q1=280/4=70th Observation, which
comes in the interval 600-800.
Q1= 600 +200/78(280/4-66)
= 610.25 Rs.
Q2=789.74 Rs.
Q3=965 Rs.
II. D4:-
P10 = 400+0
(280x4)/10=112th observation
= 400 Rs.
Which lies in the interval 600-800
P90 = 1000 + 200/35[280 x 90/100 -220]
D4 = 600+200/78(112-66)
= 1182.96 Rs.
= 717.95 Rs.

III. P66:-

280x(66/100)=184th Observation

Which lies in the interval 800-1000.

P66 = 800+200/80(184.8-144)

= 902 Rs.
Robust Estimates
● Robustness:
○ Irrespective of the variability in the input, the output variability should be minimal or it should
be within the limits that is prescribed.
○ without changing the cause of variation, you minimize the variation in the output.
○ The ability of Statistical procedures to handle variety of distributions including outliers.
○ Robust statistics is defined as measures on which the extreme observations have little effect.
○ The median is referred to as a robust estimate of location since it is not influenced by outliers
(extreme cases) that could skew the results.

Data Mean Median

1,2,3,4,5,6 21/6=3.5 [3+4]/2=3.5

1,2,3,4,5,1000 169 3.5


Measures of Robustness
I. Breakdown point: proportion of incorrect observation, higher the breakdown point of an
estimator, the more robust it is.

II. The influence function: it is the measure of dependence of the estimator on the value of any
one of the points in the sample.

III. Sensitivity Curve: instead of relying on the data, we can use the distribution of the random
variable.
Estimates of Variability
Location is just one dimension in summarizing a feature. A
second dimension, variability, also referred to as dispersion,
measures whether the data values are tightly clustered or
spread out.
Standard Deviation and Related Estimates
● The most widely used estimates of variation are based on the differences, or deviations,
between the estimate of location and the observed data.
● For a set of data {1, 4, 4}, the mean is 3 and the median is 4. The deviations from the mean
are the differences: 1 – 3 = –2, 4 – 3 = 1, 4 – 3 = 1. These deviations tell us how dispersed the
data is around the central value.
● One way to measure variability is to estimate a typical value for these deviations.
● A simple approach is to take the average of the absolute values of the deviations from the
mean.
● In the preceding example, the absolute value of the deviations is {2 1 1}, and their average is
(2 + 1 + 1) / 3 = 1.33. This is known as the mean absolute deviation and is computed with
the formula:
● The best-known estimates of variability are the variance and the standard deviation which are
based on squared deviations.
● The variance is an average of the squared deviations, and the standard deviation is the square
root of the variance:

● A robust estimate of variability is the median absolute deviation from the median or MAD
● Like the median, the MAD is not influenced by extreme values.
Estimates Based on Percentiles
● A different approach to estimating dispersion is based on looking at the spread of the
sorted data.
● Statistics based on sorted (ranked) data are referred to as order statistics
● The most basic measure is the range: the difference between the largest and smallest
numbers.
● A common measurement of variability is the difference between the 25th percentile and
the 75th percentile, called the interquartile range (or IQR). Here is a simple example:
{3,1,5,3,6,7,2,9}. We sort these to get {1,2,3,3,5,6,7,9}. The 25th percentile is at 2.5, and
the 75th percentile is at 6.5, so the interquartile range is 6.5 – 2.5 = 4.
Suppose the test score where 22,34,68,75,79,79,81,83,84,87,90,92,96 and 99. If
your score was 75, in what percentile did you score?

Solution:

There were 14 scores reported and there were 4 scores at or below yours

(4/14) x 100%=29.

You scored in the 29th percentile


Exploring the Data Distribution
Boxplot
To construct a boxplot:

● Draw a rectangular box whose bottom is the lower quartile (i.e 25th percentile) and
whose top is the upper quartile (75th percentile)
● Draw a horizontal line segment inside the box to represent the median
● Extend horizontal line segments from each end of the box out to most extreme
observation
Find Q1, Q2 and Q3 for the following data set and draw a boxplot.{2,6,7,8,8,11,12,13,14,15,22,23}

Solution:

There are 12 data points arranged. The middle two are 11 and 12 so the median i.e Q2=11.5

The lower half of the data set is {2,6,7,8,8,11}. The median of this lower half is 7.5 i.e Q1=7.5

The upper half of the data set is {12,13,14,15,22,23}. The median of this upper half is 14.5 i.e Q3=
14.5
Outliers
● An outlier is any value that is very distant from the other values in a data set.
● outliers are often the result of data errors such as mixing data of different units (kilometers
versus meters) or bad readings from a sensor.
● When outliers are the result of bad data, the mean will result in a poor estimate of location,
while the median will still be valid.
● Example:

In this set of random numbers, 1 and 201 are outliers:

1, 99, 100, 101, 103, 109, 110, 201

“1” is an extremely low value and “201” is an extremely high value.


● If a data value is very far away from the quartiles (i.e, either much less than Q1 or
much greater than Q3) it is called outliers.
● I Q R= Q3-Q1
○ Thus outlier is any number
■ Less than Q1 - (1.5 x I Q R)
■ Greater than Q3 + (1.5 x I Q R)
Find Q1, Q2 and Q3 for the following data set. Identify any outliers and draw a boxplot.

{5,40,42,46,48,49,50,50,52,53,55,56,58,75,102}
Q1 - (1.5 x I Q R)
Solution:
=46-(1.5 x 10)
There are totally 15 values, hence
=46-15
Q2= 50
=31
Q1 is the 4th data point, i.e Q1= 46
Q3 + (1.5 x I Q R)
Q3 is the 12th data point, i.e Q3=56
=56 + (1.5 x 10)
I Q R= Q3-Q1
=56 + 15
= 56-46
= 71
= 10
Frequency Tables and Histograms
A frequency table of a variable divides up the variable range into equally spaced segments and tells us how many values fall
within each segment
Cumulative frequency(more than) Table Cumulative frequency(less than) Table
Class Frequency Cumulative Class Frequency Cumulative
Interval Frequency Interval Frequency

145-146 2 2 145-146 2 50

147-148 5 7 147-148 5 48

149-150 8 15 149-150 8 43

151-152 15 30 151-152 15 35

153-154 9 39 153-154 9 20

155-156 6 45 155-156 6 11

157-158 4 49 157-158 4 5

159-160 1 50 159-160 1 1

Total 50 Total 50
Histogram
● A histogram is a way to visualize a frequency table, with bins on the x-axis and the data count on the
y-axis.
● Commonly used device for charting continuous frequency distribution
Construction of Histogram
Histogram with equal classes: Histogram with unequal classes:

● If classes are of equal magnitude each class ● If the classes are not uniform, then the
interval is drawn on X-axis by a section which different classes are represented on x-axis by
is equal to the magnitude of the class interval sections which are equal to the magnitude of
● On each class interval insert a rectangle with corresponding classes and the heights of the
corresponding rectangles are to be adjusted
the height proportional to the corresponding
so that the area of the rectangle is equal to
frequency of the class
the frequency of the corresponding class.
● The series of adjacent rectangles so formed ● This can be done by taking the height of each
gives the histogram of the frequency rectangle equal to the corresponding
distribution and its area represent the total frequency density of each class, where
frequency of the distribution
Frequency density of a class= Frequency of a class

Magnitude of the class


Represent the adjoining distribution of marks of 100 students in the examination by a histogram

Marks obtained [Link] Marks [Link]

Less than 10 4 0-10 4 N


o
Less than 20 6 10-20 6-4=2
.
Less than 30 24 20-30 24-6=18 o
f 25
Less than 40 46 30-40 46-24=22

Less than 50 67 40-50 67-46=21 s 20


t 15
Less than 60 86 50-60 86-67=19
u
Less than 70 96 60-70 96-86=10 d 10
e 5
Less than 80 99 70-80 99-96=3
n
0
Less than 90 100 80-90 100-99=1 t 10 20 30 40 50 60 70 80 90
s
Marks
Pie-Diagram
● The frequency or proportion for each category plotted as wedges in a pie.
● Steps for construction of Pie-Diagram:
○ Express each of the component values as a percentage of the respective total
○ Since the angle at the centre of the circle is 360o the total magnitude of the various
components is taken to be equal to 360o.

The degree represented by the various component parts of a given magnitude can be obtained as
follow:

Degree of any component part= component value x 360o

Total Value

● Pie-diagram is also known as circular diagram


Items Agriculture and rural Industries and urban Health and education Miscellaneous
development development

Proposed expenditure (in 4200 1500 1000 500


million Rs.)

Items Proposed expenditure Angle at the centre

(1) (2) 2/7200 x 360o

Agriculture and rural 4200 4200/7200 x 360o


development =210o

Industries and urban 1500 1500/7200 x 360o= 75o


development

Health and education 1000 1000/7200 x 360o=50o

Miscellaneous 500 500/7200 x 360o=25o

Total 7200 360o


Exploring Binary and Categorical Data
● Categorical Variables take on a fixed and limited number of possible values.
● Eg: grades,gender, blood group type etc
● In case of categorical variables the logical order is not the same as categorical data.
Probability
● Use probability to understand more about data and answer questions.

● It is very useful for data scientists to know and understand the chances of
an event occurring and can be very effective in the decision-making
process.

● Probability is the measure of how likely an event will occur.

● Probability=(desired outcomes) / (total outcomes)


● Mean, variance, standard deviation deal with one single variable, called as Univariate
analysis.
● Correlation analysis compares two variables and is called bivariate analysis.
● For more than two variable it is called multivariate analysis.
● Contingency Table: it is a type of table in a matrix format that displays the frequency
distribution of the variable.
● They are used in survey research, business intelligence, engineering and scientific
research.
● Correlation coefficient:A metric that measures the extent to which numeric variables are
associated with one another (ranges from –1 to +1).
● Correlation matrix: A table where the variables are shown on both rows and columns,
and the cell values are the correlations between the variables.
● Scatterplot: A plot in which the x-axis is the value of one variable, and the y-axis the
value of another. The standard way to visualize the relationship between two measured
data variables is with a scatterplot.
Hexagonal binning
● Scatterplots are fine when there is a relatively small number of data values
● It is a plot of two numeric variables with the records binned into hexagons.
● It is another way to manage the problem of having too many points that starts to overlap.
Contour Plot
● A contour plot is a graphical method to visualize the 3-D surface by plotting constant Z slices
called contours in a 2-D format. The contour plot is an alternative to a 3-D surface plot
● That is, given a value for z, lines are drawn for connecting the (x,y) coordinates where that z value
occurs.
● The contour plot is formed by:
○ Vertical axis: Independent variable 2
○ Horizontal axis: Independent variable 1
○ Lines: iso-response values

You might also like