qos CHAPTER 8 (DATA ANALYSIS)
jr js DATAANALYSIS?
wolves sorting through masgi
i pivotves # MAstive amou,
ints,
oD hese insights are enormously ayy forded information and deriving key
ere: data analysis and data science arg ot -making at companies of all sizes.
jam js typically more advanced (a Igt mony ae Although they belong to the same family,
, i n0dels et.) ming, creating new algorithms, building
sn inroncton 10 the data analyses process,
je the question oF goal behind the anal: ay,
collect the right data to help answer this question, ‘are you trying to discover?
Geom data clesning/data wrangling to impr
} tion-getting data into the right fa
improve data
‘quality and prepare it for analysis and
vetakes, e%C- ma Getting rid of unnecessary data, correcting spelling
ipulate data using Excel or Google Sheets thie;
i ae ‘and soon. This may include plotting the data out, creating pivot
i st the dat i istic
eras dat accinah pa finding correlations, trends, outliers, etc.)-
"i . 5 lizations, charts, table s, ete. Dat ts
tithe findings to project manteecs deoartiaea teats end mckacieesl caren coe othe
fap hem make decisions and spot patterns and tends execu
analytics hard? Well, the great thing about data
a jump right in with basic knowledge after yo
see afew key skills. (Of course, it certainly won't
cratic!)
a data analyst can also open the door to lucrative careers like data science and data engineering.
fattoname. few) as You gain more experience onthe ob |
44.1 Types OF DATA ANALYSIS
‘Whats the key objective of data analysis? That depends on what typeof data analysis skills you're using. Here
refivekinds of data analytics.
4.1.1 DESCRIPTIVE ANALYSIS:
Descriptive analytics is designed to answer the question "What happened?” The goal of descriptive analyties
istosummarize data in a meaningful and descriptive manner, not to make any predictions. Examples include
nonthly revenue reports and KPI dashboards,
M42 EXPLORATORY ANALYSIS:
‘Exploratory analysis dives a bit deeper than descriptive analytics, skimming for detectable patterns and trends
{néta. Another way to think of this is the initial investigation phase,
analysis is thatit's more of an entry-level role, meaning
wv take some data analysis courses for beginners and
hurt if you already have experience with coding, math,
M43 Diagnostic ANALYSIS:
‘alg ‘insights found from both descriptive and exploratory analytics and investigates further to find the |
Jawad Aslam Ansari be ACHAFTER 8 (Dry 4”
[Link] PREDICTIVE ANALYSIS:
‘This type is often used more by data scientists, rather than data analysts. It uses data, statistics, ang
learning algorithms and techniques to figure out the likelihood of future outcomes based on datg nie
include sales forecasting and risk assessment. Paty
8.A1.5 PRESCRIPTIVE ANALYSIS:
Takes insights found from all types of data analysis (descriptive, exploratory, diagnostic, Pret,
determine the best course of action. 4
8.1.2 Data ANALYSIS METHODS
Next, what are the methods data analysts use to accomplish these various objectives? Here's a
introduction to data analytics methods.
8.4.24 CLUSTER ANALYSIS: a
Organizes data into groups, or clusters, that share common characteristics. More on this here: ¢,..°
“Analysis and Unsupervised Machine Learning in Python
[Link] REGRESSION ANALYSIS:
Aset of statistical processes that allows you to examine the relationship between two OF more variables. Ley
more about this method here: Regression Analysis / Data Analytics in Regression —
[Link] FACTOR ANALYSIS:
Condenses several variables into just a few to make data analysis easier. Learn more: An Introducticg »
Factor Analysis
[Link] DATAMINING: : :
‘The process of finding trends, patterns, and correlations in large data sets. 3
[Link] TEXTANALYSIS; é
Extract machine-readable information from
emails). .
8.2 IMPLEMENTATION OF STATISTICAL.
set ie, Ce
a
Suara
of test groups, one or moi
choice of an error-spending— CHAPTER 8 (DATA ANALYSIS)
es of te rest ae alo owe, wilh aly cocoS MTA ANALB)
ann sdintha dass with certain caveats, Procedures to ensure basic data-
ca
quali
e ical design is crucial for making su
getty and thus the nus inference cay Gata that wll enter the decision-making process is of
pece™ i ‘F estimation will be valid
Ce sgn cane asa el cin lel In se nts i
n not perform . ,
10 erainty around them, making them tein test at all since the data will have a false
results are not what was expected, anyone searchers for a reason once it is found
ot Ry
ni tistical tests.
‘pein statist are used to determine whether observed differences are statistically significant
4 PARAMETRIC Tests
sed when data follow a particular distribution (e.g, a normal distribution—a bell-shaped distribution
Mere the median, mean, and mode are all equal). These tests are generally more powerful.
NONPARAMETRIC TESTS,
pre used oe . ee distribution cannot be assumed; they rank data rather than taking absolute
$2.3 UNPAIRED TESTS
‘compare values from independent samples. |
$24 PAIRED Tests |
se performed on paired data. For example, where the same parameter is measured on each patient before
god after an intervention,
$2.5 TWO-TAILED TesTS
Should be used when an intervention could potentially lead to either an increase or decrease of the outcome.
8.2.6 ONE-TAILED Tests
should be used when an intervention can have only one plausible effect on the outcome.
8.3 T-Test
Attest is a statistical test that is used to compare the means of two groups. It is often used in hypothesis
testing to determine whether a process or treatment actually has an effect on the population of interest, or
‘whether two groups are different from one another.
ttest example
‘You want to know whether the mean petal length of iris lowers differs according to their species. You find
two different species of irises growing in a garden and measure 25 petals of each species. You can test the
difference between these two groups using a t test and null and alterative hypotheses.
+ The null hypothesis (Ho) is that the true difference between these group means is zero.
+ The alternate hypothesis (Ha) is that the true difference is different from zero,
_ Muhammad Jawad Aslam AnsariCHAPTER 8 (Daty AN
8.3.1 WHEN TO Use AT-TesT?
‘Attest can only be used when comparing the means of two groups (a.k.a. pairwise comparison). If yoq
to compare more than two groups, or if you want to ‘do multiple pairwise comparisons, use an ANOVA te
a post-hoc test.
‘The t test is a parametric test of difference, meaning that it makes the same assumptions about your tay,
other parametric tests. The t test assumes your data:
+ Are independent
+ Are (approximately) normally distributed : ;
+ Havea similar amount of variance within each group being compared (a.k.a. Homogeneity of variangs,
If your data do not fit these assumptions, you can Uy nonparametric alternative to the ¢ test, Such as,
Wilcoxon Signed-Rank test for data with unequal variances.
8.3.2 WHAT TYPE OF T-TEST SHOULD | USE?
‘When choosing attest, you will ned to consider two things whether the groups being compared come pq
2 single population or two diferent populations, and whether you want totes the difference in a spedig,
fe
cone seaar toes exten or entre io?
+ If the groups come from a single population {eg., measuring before and after an experiment
treatment), perform a paired t' isis a within-subjects design.
+ If the groups come from two different populations (e., two different species, or people from tw
‘separate cities), perform a two-sample ¢ test (a.k.a. independent t test). This is a between-subje
design.
‘« Ifthere'is one group being compared against a standard value (¢.2., comparing the acidity of a liquig
‘a neutral pH of7), perform a one-samplettest.
ies), so you perform a two
a difference, so you choost
mine whether your datchi-square goodness of fit test
+ Megorca variable is different from yous e® 2 1 test wether the
a juare test of i eestations,
he chi-sal pendence iets tit eter,
CHAPTER 8 (DATA ANALYSIS)
frequency distribution of a
Categorical variables are related
are is often written as Xand is pronounced at-gnc«
“Sauare” (rhymes with “eye-square”), It is also called
sat WHAT IS A CHI-SQUARE Test?
ats chi-square (X°) tests, often referred to :
Peamramettic tests. Nonparametric a > simply as chi-square tests,
ests are
fats expecially the assumption ofa normal Pasion Tere
are among the most common
‘the assumptions of parametric
Spee oremeres test Can’ test Lrpotheees about the tration of a calomel avnbio. Ket Gs
Beare s categorical variahle as anindepmdent vacshle(og,4NOVA,).
4.2 TEST HYPOTHESES AgouT FREQUENCY DISTRIBUTIONS
There are two types of Pearson's chi-square tests, but they both test whether the observed frequency
s significantly different from its expected frequency distribution. A
frequency distribution describes how observations are distributed between different groups.
Frequency distributions are often displayed using frequency distribution tables. A frequency distribution table
shows the number of observations in each group. When there are two categorical variables, you can use a
specific type of frequency distribution table called a contingency table to show the number of observations in
each combination of groups. |
Example: Bird species at a bird feeder |
Frequency of visits by bird species at a bird feeder during a 24-hour period
Birdspecies = = = Frequency
i
i
ees
i
8
aeoo ge
A chi-square test (a chi-square goodness of fit test) can test whether these observed frequencies
significantly different from what was expected, such as equal frequencies.
Example: Handedness and nationality
“Muhammad Jawad Aslam AnsariContingency table of
‘Right-handed _—
aS 6
Canadian 157
whether these observed frequencies
[Acchisquare test (atest of independence) €4 15 TT tod to nationality. bos:
different from the frequencies expected if handedness
«formula to calealate the test statistic chi-squayy
Both of Pearson's chi-square tests use the sam ey,
mays
Where:
+ Xtis the chi-square test statist
: aan aen crea operator it eeane take chao of)
expectations (O - E in the equati
on), the
“ideaANOVA (analysis of variance) has one cu
sama ated continues,
t variable (also known as a factor)
pendent variable.
; only the One-Way ANOVA,
.Y (FACTORIAL) ANOVA
(analysis of variance) has two or more categorical i
e.
imples t-Test can compare the means for two